Repository navigation
Conversation
Add small control and exploit-shaped multipart requests to assess selective Cloudflare blocking without running memory-pressure probes. Keep WAF results separate from vulnerability status and support existing CLI, path, threading, and JSON options. Adapt the WAF-check technique and multipart layout from Matt Suiche's php2shell_waf_check. Add local HTTP integration tests, verdict tests, and usage documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing scanner treats rejected probes as inconclusive and uses large multipart bodies to look for PHP failure signals. This adds an opt-in
--waf-checkmode for checking edge mitigation with a benign control and a small exploit-shaped multipart request.The shaped request contains
PHP_SESSION_UPLOAD_PROGRESS, threet[]fields, and two 4 KB file parts. Both requests use the same cookie context. This mode never builds or sends the existing memory-pressure probes.A passing control followed by HTTP 403 with a Cloudflare block-page marker reports
BLOCKED. Accepted shaped requests reportNOT BLOCKED; rejected controls, non-Cloudflare rejections, redirects, and request errors remain distinct. Results describe only the tested shape and do not identify the rule that fired or establish PHP patch status.vulnerablestays null in WAF mode.Existing URL/path, custom-header, TLS, timeout, and threading options apply. JSON includes all WAF results; quiet mode prints checks that are not confirmed blocked. Exit status is 0 only when every tested target/path is blocked, 1 otherwise, or 2 on output-write failure. The default vulnerability scan retains its existing behavior.
Attribution
The WAF-check technique and multipart layout are adapted from my earlier php2shell_waf_check, credited to Matt Suiche, Tolmo in the README and implementation.
Validation
21 tests pass on Python 3.9.25 and Python 3.14.7:
Tests cover payload structure and size, verdicts, control rejection, redirects, network errors, custom-cookie handling and credential redaction, multi-path aggregation, threaded and quiet output, JSON, exit statuses, and the existing scanner mode. Integration tests use a local HTTP server; no external targets are probed. Changed executable lines have 100% line coverage. Basic lint and
git diff --checkalso pass.