wafrift · 2026-07-30 · product
Meet wafrift: a programmable WAF-evasion engine.
A web application firewall (WAF) you have never attacked is a ruleset you are trusting on faith. wafrift attacks it for you. It mutates real attack payloads through encoding layers, grammar rules, and protocol tricks, fires them at your WAF, and runs evolutionary search over what gets through. The bypasses that win are persisted to a per-WAF gene bank, so the next scan starts from everything the last one learned.
Install it
cargo install wafrift-cli
git clone https://github.com/santhreal/wafrift && cd wafrift && cargo build --release
wafrift is for infrastructure you own or are authorized to assess. Point it at your own WAF, never at someone else's.
Mutate a payload without a target
wafrift evade is the offline half. Pipe a payload in, get bypass variants
out, no target required. Every strategy is addressable as a path, so you can include
or exclude exactly the layers you want:
echo "' OR 1=1--" | wafrift evade --only encoding/url/triple
echo "' OR 1=1--" | wafrift evade --exclude grammar/sql/comments
Encodings cover URL, double and triple URL, Unicode, hex, base64, and chained combinations. Grammars are dialect-aware: a SQL mutation understands tautologies and comment syntax, an XSS mutation understands event handlers and tag structure, so the variants are attacks, not byte noise.
Scan a live WAF and get a verdict
wafrift scan fires variants at a live target and classifies each response
with a multi-signal oracle: block, bypass, challenge, or rate-limit. It honors
Retry-After instead of tripping your own rate limits. The JSON report ends
in a blunt verdict:
wafrift scan https://your-app.example/search?q=test
"waf_bypass": {
"waf_in_play": true,
"bypass_confirmed": true,
"verdict": "bypass_confirmed"
}
Exit codes match the verdict. 0 means a bypass is confirmed.
4 means the WAF fought back and no variant won. 6 means no WAF
is in play on that parameter at all, which is a different finding: your measurement was
never about the WAF. CI can gate on each outcome separately.
Know which WAF you are fighting
wafrift detect fingerprints the WAF, CDN, and origin on four independent
axes, so stripping one layer does not hide the rest: HTTP response headers and body
(over 160 vendor rules), the DNS CNAME chain (37 vendor rules), reverse DNS on the
leaf IP, and a BGP origin-ASN lookup. eBay's custom proxy banner resolves to Akamai
through its CNAME chain. Stripe's Server: nginx resolves to AWS through
the ASN axis. The fingerprint decides which mutation families are worth spending
requests on.
The part that learns
Static mutation lists hit the same wall as static rulesets: the WAF vendor updates,
the list does not. wafrift treats bypass discovery as a search problem. Hill-climbing,
simulated annealing, tabu search, novelty search, and MAP-Elites (an illumination
algorithm that keeps a map of diverse elite candidates rather than one best answer)
all run over the mutation space. Every confirmed bypass is persisted to a per-WAF
gene bank under ~/.wafrift, so the next engagement against the same
stack starts with zero discovery cost.
When you already have a working bypass, wafrift distill shrinks it. It
applies Zeller's ddmin algorithm (delta debugging: systematically remove chunks and
keep whatever still fails the test) to find the smallest payload that both bypasses
the WAF and still executes as an attack. A semantic oracle gates every reduction, so
the minimal form cannot collapse into a benign string that merely passes the filter.
Drop it into an existing workflow
- As a proxy.
wafrift-proxysits between Burp, Caido, or mitmproxy and the target, applies evasion at the upstream forward, and records bypasses to the gene bank. MITM mode with TLS impersonation (Chrome, Firefox, Safari ClientHellos, with matching header order) is built in. - As a one-shot report.
wafrift oneshotruns detect, fingerprint, and bypass-probe against one target and stitches the results into a single Markdown writeup. - As a replay.
wafrift replayre-fires a known-good bypass against any target, exits 0 on bypass, 2 on block. Regression tests for a WAF rule change become one line of CI. - As libraries. Encoding, grammar, detection, smuggling, evolution, oracle, and strategy are separate crates on crates.io. You can embed the mutation engine without the CLI.
Honest status
wafrift is beta. Local stacks (ModSecurity paranoia levels 1 through 4, Coraza,
BunkerWeb, naxsi) are exercised in CI under wafrift-bench/. Cloud-WAF
coverage (Cloudflare, AWS WAF, Akamai, Imperva, F5) is still sparse, so treat those
results as preliminary and tell us what you hit. The full version history is in the
changelog.
Try it
github.com/santhreal/wafrift - MIT OR Apache-2.0, no telemetry. Install instructions and the feature overview live at santh.dev/wafrift. Use it against assets you own or are authorized to test.