Below is a list of 100 patterns that can be used at the Web Application Firewall (WAF) level to detect potential HTTP traffic attempting to bypass WAF protections. These patterns focus on common evasion techniques, unusual behaviors, and malicious payloads that attackers might use to circumvent standard WAF rules. Note that these patterns should be tailored to your specific WAF solution and environment, and some may require regex or custom logic for implementation.
General Evasion Techniques
- Unusual HTTP Methods: Detect non-standard HTTP methods (e.g.,
TRACE
,TRACK
,OPTIONS
) not typically used by your application. - Encoded Characters in URL: Look for excessive URL encoding (e.g.,
%25%32%35
for%25
). - Double Encoding: Identify double-encoded characters (e.g.,
%252F
instead of/
). - Null Bytes: Detect null byte injections (e.g.,
%00
) in URL or headers. - Unicode Abuse: Spot Unicode-encoded characters (e.g.,
%u002f
for/
). - Mixed Case Headers: Identify headers with unusual casing (e.g.,
HoSt
instead ofHost
). - Whitespace Variations: Catch excessive or unusual whitespace in requests (e.g.,
GET /path
). - Chunked Transfer Encoding: Flag unexpected use of
Transfer-Encoding: chunked
. - Multiple Content-Length Headers: Detect requests with conflicting
Content-Length
values. - Invalid Content-Length: Spot mismatches between
Content-Length
and actual body size.
Parameter and Payload Manipulation
- Parameter Pollution: Identify duplicate parameters (e.g.,
id=1&id=2
). - Nested Parameters: Detect attempts to nest parameters (e.g.,
param[a][b]=malicious
). - JSON in Unexpected Fields: Catch JSON payloads in URL parameters or headers.
- Base64 Encoded Payloads: Look for Base64 strings in parameters or cookies (e.g.,
YWRtaW4=
). - Hex Encoded Payloads: Detect hex-encoded strings (e.g.,
0x414141
). - Long Parameter Values: Flag unusually long parameter values (e.g., >1000 characters).
- SQL Injection Variants: Catch SQL keywords with odd spacing (e.g.,
S E L E C T
). - SQL Comments: Detect inline SQL comments (e.g.,
--
or/* */
) in parameters. - Command Injection Variants: Spot OS commands with separators (e.g.,
;ls
,||whoami
). - Path Traversal Attempts: Identify
../
or..\
with variations (e.g.,%2e%2e%2f
).
Header Manipulation
- Fake User-Agent: Detect suspicious or malformed
User-Agent
strings (e.g.,<script>
). - Missing User-Agent: Flag requests with no
User-Agent
header. - Custom Headers: Catch unusual custom headers (e.g.,
X-Forwarded-For: malicious
). - Host Header Tampering: Detect
Host
header mismatches with the target domain. - Referrer Spoofing: Spot suspicious
Referer
values (e.g.,<script>
or off-site URLs). - Accept Header Abuse: Identify malformed
Accept
headers (e.g.,Accept: */*;q=evil
). - Cookie Tampering: Detect oversized or malformed cookies (e.g.,
cookie=evil;cookie2=evil
). - Proxy Headers: Catch unexpected proxy headers (e.g.,
Via
,X-Proxy-ID
). - Multiple Host Headers: Flag requests with more than one
Host
header. - Invalid Protocol: Detect requests with non-HTTP protocols in headers (e.g.,
ftp://
).
Request Body and File Uploads
- Malformed JSON: Identify invalid JSON structures in POST requests.
- XML Injection: Detect XML tags in non-XML contexts (e.g.,
<tag>
in form data). - File Upload Extensions: Catch suspicious file extensions (e.g.,
.php
,.exe
). - MIME Type Mismatch: Flag mismatches between
Content-Type
and actual content. - Binary Data in Text Fields: Detect binary data in text-based parameters.
- Excessive POST Size: Identify oversized POST requests beyond app limits.
- Multipart Form Abuse: Spot malformed
multipart/form-data
boundaries. - Serialized Data: Catch PHP/Java serialized objects (e.g.,
O:4:"Evil"
). - Encoded File Content: Detect Base64-encoded files in form fields.
- Null-terminated Strings: Flag strings ending with
%00
in body.
Behavioral Patterns
- High Request Rate: Detect rapid requests from a single IP (e.g., >100 req/sec).
- Randomized Parameter Names: Spot requests with gibberish parameter names (e.g.,
xjdks=1
). - Invalid HTTP Version: Catch requests with odd HTTP versions (e.g.,
HTTP/9.9
). - Slow HTTP Attacks: Identify requests with delayed headers or body (e.g., slowloris).
- Non-Standard Ports: Flag requests targeting unusual ports (e.g.,
:8080
if not allowed). - Suspicious Query Strings: Detect query strings with script tags (e.g.,
?q=<script>
). - Directory Brute Force: Catch repeated requests to non-existent paths (e.g.,
/admin1
,/admin2
). - Repeated 403/404 Responses: Flag IPs triggering excessive errors.
- Geolocation Anomalies: Detect requests from unexpected regions (if geo-filtering applies).
- Tor/Proxy Usage: Identify traffic from known anonymizing services (e.g., Tor exit nodes).
Implementation Notes
- These patterns should be implemented as rules or signatures in your WAF, often using regular expressions, anomaly scoring, or behavioral analysis.
- Combine these with allow/deny lists, rate limiting, and session tracking for better accuracy.
- Test rules in a staging environment to avoid false positives that might block legitimate traffic.
- Adjust thresholds (e.g., request rates, parameter lengths) based on your application’s normal behavior.
Advanced Evasion Techniques
- Percent Encoding Variants: Detect alternate percent encodings (e.g.,
%c0%af
for/
). - Overlong UTF-8: Spot overlong UTF-8 sequences (e.g.,
%c1%9c
instead of<
). - Backslash Instead of Slash: Catch
\
instead of/
in URLs (e.g.,domain\path
). - URL Fragment Abuse: Detect suspicious fragments (e.g.,
#<script>
). - Padded Requests: Identify requests padded with junk data (e.g.,
GET /?a=1&junk=xxx
). - Non-ASCII Characters: Flag non-ASCII characters in URLs or headers (e.g.,
café
). - HTTP/0.9 Requests: Detect legacy HTTP/0.9-style requests (no headers).
- Invalid URL Schemes: Catch requests with odd schemes (e.g.,
data://
,file://
). - Mixed Slash Directions: Spot URLs with mixed slashes (e.g.,
/path\to/file
). - Unusual Character Sets: Detect charset mismatches (e.g.,
charset=evil
).
Header Manipulation (Continued)
- X-HTTP-Method-Override: Flag misuse of
X-HTTP-Method-Override
to fake methods. - Expect Header Abuse: Detect
Expect: 100-continue
with malicious payloads. - Malformed Range Header: Catch invalid
Range
values (e.g.,Range: bytes=0-evil
). - Connection Header Tricks: Spot
Connection: keep-alive
with odd values. - TE Header Abuse: Detect
TE: trailers
with suspicious trailers. - Upgrade Header: Flag
Upgrade: websocket
on non-websocket endpoints. - Accept-Encoding Tricks: Catch
Accept-Encoding: gzip;q=evil
. - If-Modified-Since Injection: Detect script tags in
If-Modified-Since
. - Pragma Header: Spot unexpected
Pragma: no-cache
variations. - Cache-Control Abuse: Identify
Cache-Control: no-store;evil
.
Payload and Parameter Manipulation (Continued)
- SQL Concatenation: Detect concatenated SQL (e.g.,
CONCAT('a','b')
). - Hexadecimal SQL: Catch hex-encoded SQL (e.g.,
0x73656c656374
forselect
). - Obfuscated XSS: Spot script tags with obfuscation (e.g.,
scr<script>ipt
). - Polyglot Payloads: Detect payloads valid in multiple contexts (e.g., JS+SQL).
- Eval Constructs: Flag
eval()
,exec()
, or similar in parameters. - LDAP Injection: Catch LDAP syntax (e.g.,
*
,)(
in parameters). - NoSQL Injection: Detect MongoDB/JSON operators (e.g.,
$ne
,$gt
). - CRLF Injection: Spot
%0d%0a
(CRLF) in parameters or headers. - Parameter Name Injection: Detect tags in parameter names (e.g.,
<script>=1
). - Boolean Blind SQL: Catch
1=1
,true
, orfalse
in odd contexts.
Request Body and File Uploads (Continued)
- Gzip Bomb: Detect compressed payloads that expand excessively.
- Malformed XML Entities: Catch
<!ENTITY
or XXE attempts (e.g.,<!DOCTYPE
). - SOAP Injection: Spot SOAP envelopes in non-SOAP endpoints.
- Hidden File Fields: Detect unexpected
multipart/form-data
fields. - Executable MIME Types: Flag
application/x-executable
uploads. - Double Extensions: Catch files like
image.jpg.php
. - Trailing Data: Detect junk after file content in uploads.
- Empty File Names: Spot uploads with blank
filename=""
. - JSONP Abuse: Catch
callback=evil
in JSON requests. - CSV Injection: Detect
=CMD
or@SUM
in form data.
Behavioral and Protocol Anomalies
- HEAD Flood: Flag excessive
HEAD
requests to bypass logging. - HTTP Pipelining: Detect multiple requests in a single connection.
- Invalid Status Codes: Catch requests specifying odd status (e.g.,
HTTP/1.1 999
). - Session ID Tampering: Spot malformed or oversized session tokens.
- Cookie Overflow: Detect cookies exceeding size limits (e.g., >4096 bytes).
- Rapid UA Switching: Flag IPs changing
User-Agent
frequently. - Suspicious Timing: Catch requests with precise millisecond gaps.
- TLS Fingerprinting: Detect odd SSL/TLS client hello patterns.
- HTTP/2 Abuse: Spot HTTP/2-specific attacks (e.g., SETTINGS flood).
- WebDAV Methods: Flag
PROPFIND
,MOVE
, orCOPY
on non-DAV apps.
Implementation Tips
- Use regex or pattern matching for string-based detections (e.g.,
%0d%0a
). - Leverage anomaly detection for behavioral patterns (e.g., rapid UA switching).
- Combine with IP reputation, rate limiting, and context-aware rules.
- Monitor logs for emerging patterns not yet codified here.
- Test extensively to minimize false positives, especially with encoded or behavioral rules.
Let me know if you’d like examples of regex for any of these or assistance integrating them into a specific WAF!