Expand description
wafrift-core — Façade crate re-exporting all WAF Rift modules.
This crate is a convenience umbrella. Each module lives in its own
focused crate; this crate re-exports them all under a single namespace
so existing consumers (wafrift-cli, wafrift-transport, integration
tests) can continue using wafrift_core::*.
§Examples
Use the umbrella to drive a payload through three subsystems without depending on each subcrate by name:
use wafrift_core::{encoding, grammar};
// Classify, mutate, encode — three lego-blocks, one façade.
let p = "' OR 1=1 --";
assert_eq!(grammar::classify(p), grammar::PayloadType::Sql);
let mutations = grammar::mutate(p, 3);
assert!(!mutations.is_empty());
let encoded = encoding::encode(p, encoding::Strategy::UrlEncode).unwrap();
assert!(encoded.contains("%27"));Use the re-exported types to build a request without naming
wafrift_types:
use wafrift_core::{Method, Request};
let r = Request::get("https://example.com").header("X-Test", "1");
assert_eq!(r.method(), &Method::Get);
assert_eq!(r.headers().len(), 1);§Crate structure
§Re-exported crates
| Crate | Re-exported as | Purpose |
|---|---|---|
wafrift-types | (crate root via *) | Core types: Request, Technique, EvasionResult |
wafrift-encoding | encoding, header | Payload encoding + header obfuscation |
wafrift-grammar | grammar | Grammar-aware payload mutations |
wafrift-content-type | content_type | WAFFLED Content-Type switching |
wafrift-smuggling | smuggling, h2_evasion | HTTP smuggling + HTTP/2 frame-level evasion |
wafrift-fingerprint | fingerprint, tls_fingerprint | Browser + TLS JA3/JA4 fingerprint profiles |
wafrift-detect | waf_detect, response_fingerprint | WAF detection (HTTP headers, DNS CNAME, BGP ASN) |
wafrift-evolution | evolution, advisor, differential, custom_rules, intelligence | Genetic algorithm + MCTS + advisor |
wafrift-oracle | oracle | Payload validity oracles (SQL, XSS, SSTI, …) |
wafrift-strategy | host_state, strategy | Evasion pipeline + gene bank + adaptive host state |
wafrift-transport | transport | Evasion-aware HTTP client + stealth profiles |
proxywire | pool | Canonical proxy substrate (routing, rotation, auth) |
wafrift-recon | recon | Origin discovery via CT logs + DNS history |
§NOT re-exported by this crate
These crates are part of the workspace but are not included in wafrift-core
to avoid the associated heavy dependencies (wasmtime, ed25519-dalek, etc.)
in consumers that don’t need them. Use the sub-crates directly:
wafrift-wafmodel— L* WAF decompiler + offline SFA bypass miningwafrift-genome-registry— ed25519 genome signing + trust-list managementwafrift-plugin-api— TOML + WASM external tamper SDKwafrift-graphql— GraphQL-specific evasion payloadswafrift-grpc-evasion— gRPC opaque-payload bypasswafrift-captchaforge-bridge— headless Chromium challenge solver
Re-exports§
pub use wafrift_content_type as content_type;pub use wafrift_http3_evasion as http3_evasion;pub use wafrift_oracle as oracle;pub use proxywire as pool;pub use wafrift_transport as transport;pub use wafrift_recon as recon;
Modules§
- advisor
- WAF-aware strategy advisor.
- bogon
- Canonical bogon / non-public IP classification for the workspace.
- calibration
- WAF calibration — detect whether a target has a WAF at all.
- canary
- Per-probe correlation token shared by every wafrift evasion module that emits wire-format payloads.
- config
- Evasion configuration — knobs for the strategy engine.
- custom_
rules - Community-configurable WAF detection and evasion rules.
- differential
- WAF rule differential analysis — reverse-engineer what a WAF blocks.
- discovery
- encoding
- Payload encoding strategies — transform payloads to bypass WAF keyword detection.
- entropy
- Information-theoretic primitives shared across the workspace.
- escalation
- Escalation levels — how aggressively we need to evade.
- evolution
- Feedback-driven evolutionary evasion engine.
- explanation
- fingerprint
- Compatibility facade for shared browser HTTP fingerprint profiles.
- format
- gene_
bank_ io - Canonical schema for the operator’s per-host gene-bank persistence
file (default path:
~/.wafrift/gene-bank.json). - grammar
- Grammar-aware payload mutation engine.
- h2_
evasion - HTTP/2 frame-level evasion and downgrade techniques.
- hash
- Pure, deterministic, dependency-free hashing primitives shared across the workspace.
- header
- HTTP header obfuscation for WAF bypass.
- host_
state - Per-host evasion state — tracks what works and what doesn’t.
- injection_
context - intelligence
- Intelligence loop — connects differential analysis, evolution, and strategy.
- loaders
- Shared file-discovery primitives for
.tomlrule directories. - oob
- pick
- Random selection from a static pool — workspace-wide primitive.
- probe
- Workspace-wide
SmuggleProbetrait — uniform interface for the seven (and growing) probe families wafrift emits. - probe_
aggregator - Single aggregator that pulls every wafrift smuggle probe under one operator-iterable interface.
- request
- HTTP method and request types — the foundation layer all wafrift crates depend on.
- response_
fingerprint - Response fingerprinting for silent-block detection.
- result
- Evasion result — a transformed request with metadata.
- session
- smuggling
- HTTP request smuggling payloads for WAF bypass.
- strategy
- Evasion strategy engine — the pipeline that wires ALL modules.
- technique
- Evasion technique identifiers.
- tls_
fingerprint - Compatibility facade for shared TLS ClientHello fingerprint profiles.
- utf7
- UTF-7 (RFC 2152) codec — a foundational, self-contained primitive.
- verdict
- WAF response verdict taxonomy.
- waf_
class - WAF classification by architectural backing — governs which evasion sub-engines are activated for a given target.
- waf_
detect - WAF detection from response headers and body.
Structs§
- Evasion
Config - Evasion configuration.
- Evasion
Result - A transformed request ready to send.
- Host
State - Per-host evasion state — tracks what works and what doesn’t.
- Request
- A request that wafrift can transform.
Enums§
- Block
Reason - Extracted block reason from a WAF response.
- Calibration
Result - Result of WAF calibration check.
- Connection
Behavior - Connection behavior anomalies that influence verdict classification.
- Escalation
Level - How aggressively we need to evade.
- Method
- HTTP method — enforced at the type level instead of a bare
String. - Signal
- A classification signal that contributed to a verdict.
- Technique
- An evasion technique that was applied.
- Verdict
- WAF response verdict — the output of the response oracle.
- WafClass
- High-level WAF architectural class.
Constants§
- BLOCK_
SCAN_ BODY_ WINDOW - Workspace-canonical body-scan window size (bytes) used by every WAF-block classifier that reads the response body.
- DEFAULT_
EGRESS_ CHALLENGE_ THRESHOLD - Default egress-pool “burn threshold” — the number of challenge /
rate-limit verdicts on a single egress identity before that egress
rotates into cooldown. Pre-R63 the literal
3was open-coded at 7 production sites (cli config defaults, scan/raw_runner, hunt_cmd, import_curl, model_evade_cmd, and main.rs clap defaults). Anchoring here makes the value tunable in one place and prevents the silent divergence where one site updates and others don’t. - DEFAULT_
EGRESS_ COOLDOWN_ SECS - Default egress-pool cooldown duration in seconds after
thresholdstrikes. Pre-R63 the literal300was hardcoded at 6 sites includingwafrift_transport::egress_pool’s builder’sunwrap_orfallback — meaning a CLI default and a builder default could silently disagree. - DEFAULT_
MAX_ REDIRECTS - Default redirect chain depth allowed when wafrift acts as an HTTP client. Mirrors curl’s default to minimise practitioner surprise.
- DEFAULT_
REQUEST_ TIMEOUT_ SECS - Default per-request HTTP timeout (seconds). Used by every reqwest
client builder in the workspace unless the caller explicitly opts
into a different value (e.g.
bench-waf --timeout-secs). - DEFAULT_
SMUGGLE_ BODY_ DIVERGENCE_ THRESHOLD - Default body-length divergence threshold for the fire-mode
classifier. 5% delta =
body-divergedsignal. Tuned to avoid noise from server-timestamp headers while catching real per-route page-shape divergence. - DEFAULT_
SMUGGLE_ COMPOSED_ CAP - Default cap on emitted composed artifacts in
smuggle-cross-product/smuggle-chain. The cartesian product grows polynomially — 64 is the empirical sweet spot between coverage and operator-readable output volume. - DEFAULT_
SMUGGLE_ FIRE_ DELAY_ MS - Default inter-request delay (ms) in sequential fire mode. Rate-limit-friendly default; operators raise/lower per target.
- DEFAULT_
SMUGGLE_ FIRE_ PARALLEL - Default concurrent in-flight smuggle-fire probes. 1 =
sequential (respects
--delay-ms); >1 = parallel. - DEFAULT_
SMUGGLE_ FIRE_ TIMEOUT_ SECS - Default per-request HTTP timeout (seconds) for smuggle-fire subcommands. 10s matches the scan-path convention.
- FNV_
OFFSET_ 64 - FNV-1a 64-bit offset basis (RFC reference value).
- FNV_
PRIME_ 64 - FNV-1a 64-bit prime (RFC reference value).
- HOST_
STATES_ CAP - Workspace-canonical cap on the in-memory per-host evasion/state map
shared by
wafrift-transport’sEvasionClientand the scan-path clients. The cap prevents a long-running session scanning thousands of distinct hostnames from growing the map unboundedly. - HOST_
TECHNIQUE_ HINTS_ CAP - Workspace-canonical cap on the
prioritized_techniquesandavoided_techniqueshint lists stored in awafrift_strategy::HostState(a downstream crate, so this is a plain code span, not an intra-doc link). - MAX_
RESPONSE_ BODY_ BYTES - Workspace-canonical ceiling on the largest HTTP response / decoded body
wafrift holds in memory at once. ONE source of truth for the three sites
that each previously defined their own
64 * 1024 * 1024and were kept in sync only by a comment (§7 DEDUPLICATION — “two = a future drift bug”): - REGEX_
NFA_ SIZE_ LIMIT - Workspace-canonical compiled NFA byte-size limit for
RegexBuilder::size_limitandRegexSetBuilder::size_limit.
Functions§
- binary_
shannon - Binary Shannon entropy of a Bernoulli with parameter
p, in bits. - fnv1a_
64 - Hash a byte slice with FNV-1a-64 in a single call.
- fnv1a_
64_ extend - Streaming variant — fold
bytesinto the runninghin place. Equivalent to*h = bytes.iter().fold(*h, fnv1a_64_step)but preserves the existing call site shape fromevolution::h1_dedup. - fnv1a_
64_ step - Single-byte step of FNV-1a-64. Exposed for streaming callers (e.g.
evolution::h1_dedup’s incremental fingerprint over a tokenised request, where each segment is fed independently). - glob_
match - Tiny ASCII glob matcher:
*matches any byte run (including empty),?matches exactly one byte, everything else is a case-insensitive literal. The match is anchored at both ends (full-string). - glob_
match_ bytes - Byte-slice core of
glob_match. Exported for crates that already hold&[u8]and want to avoid the UTF-8 round-trip. - ip_
addr_ is_ bogon - True if this IP should be blocked when private/upstream lab access is disallowed.
- shannon
- General Shannon entropy over a discrete distribution
probs, in bits.H(p_1, …, p_n) = -Σ p_i · log2(p_i), with the convention0 · log 0 = 0(the mathematical limit).