@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
package/LICENSE ADDED
@@ -0,0 +1,80 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: WAFtester
6
+ Licensed Work: WAFtester
7
+ The Licensed Work is (c) 2026 WAFtester
8
+ Additional Use Grant: You may use the Licensed Work for any purpose,
9
+ except you may not use it to provide a commercial
10
+ WAF testing, security scanning, or vulnerability
11
+ assessment service to third parties.
12
+ Change Date: January 31, 2030
13
+ Change License: Apache License, Version 2.0
14
+
15
+ Terms
16
+
17
+ The Licensor hereby grants you the right to copy, modify, create derivative
18
+ works, redistribute, and make non-production use of the Licensed Work. The
19
+ Licensor may make an Additional Use Grant, above, permitting limited
20
+ production use.
21
+
22
+ Effective on the Change Date, or the fourth anniversary of the first publicly
23
+ available distribution of a specific version of the Licensed Work under this
24
+ License, whichever comes first, the Licensor hereby grants you rights under
25
+ the terms of the Change License, and the rights granted in the paragraph
26
+ above terminate.
27
+
28
+ If your use of the Licensed Work does not comply with the requirements
29
+ currently in effect as described in this License, you must purchase a
30
+ commercial license from the Licensor, its affiliated entities, or authorized
31
+ resellers, or you must refrain from using the Licensed Work.
32
+
33
+ All copies of the original and modified Licensed Work, and derivative works
34
+ of the Licensed Work, are subject to this License. This License applies
35
+ separately for each version of the Licensed Work and the Change Date may vary
36
+ for each version of the Licensed Work released by Licensor.
37
+
38
+ You must conspicuously display this License on each original or modified copy
39
+ of the Licensed Work. If you receive the Licensed Work in original or
40
+ modified form from a third party, the terms and conditions set forth in this
41
+ License apply to your use of that work.
42
+
43
+ Any use of the Licensed Work in violation of this License will automatically
44
+ terminate your rights under this License for the current and all other
45
+ versions of the Licensed Work.
46
+
47
+ This License does not grant you any right in any trademark or logo of
48
+ Licensor or its affiliates (provided that you may use a trademark or logo of
49
+ Licensor as expressly required by this License).
50
+
51
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
52
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
53
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
54
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
55
+ TITLE.
56
+
57
+ MariaDB hereby grants you permission to use this License's text to license
58
+ your works, and to refer to it using the trademark "Business Source License",
59
+ as long as you comply with the Covenants of Licensor below.
60
+
61
+ Covenants of Licensor
62
+
63
+ In consideration of the right to use this License's text and the "Business
64
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
65
+ other recipients of the licensed work to be provided by Licensor:
66
+
67
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
68
+ or a license that is compatible with GPL Version 2.0 or a later version,
69
+ where "compatible" means that software provided under the Change License can
70
+ be included in a program with software provided under GPL Version 2.0 or a
71
+ later version. Licensor may specify additional Change Licenses without
72
+ limitation.
73
+
74
+ 2. To either: (a) specify an additional grant of rights to use that does not
75
+ impose any additional restriction on the right granted in this License, as
76
+ the Additional Use Grant; or (b) insert the text "None".
77
+
78
+ 3. To specify a Change Date.
79
+
80
+ 4. Not to modify this License in any other way.
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WAFtester
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ This license applies to the community payloads located in:
26
+ payloads/community/
27
+
28
+ The core WAFtester software is licensed under BSL 1.1 (see LICENSE file).
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # @waftester/cli
2
+
3
+ [![npm](https://img.shields.io/npm/v/@waftester/cli)](https://npmjs.com/package/@waftester/cli)
4
+ [![downloads](https://img.shields.io/npm/dw/@waftester/cli)](https://npmjs.com/package/@waftester/cli)
5
+ [![license](https://img.shields.io/npm/l/@waftester/cli)](https://github.com/waftester/waftester/blob/main/LICENSE)
6
+
7
+ The most comprehensive WAF testing CLI & MCP server. Detect, fingerprint, and bypass Web Application Firewalls with 2,800+ payloads and quantitative security metrics.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ # Run without installing
13
+ npx -y @waftester/cli scan --target https://example.com
14
+
15
+ # Or install globally
16
+ npm install -g @waftester/cli
17
+ waf-tester scan --target https://example.com
18
+ ```
19
+
20
+ ## MCP Server Setup
21
+
22
+ WAFtester includes a built-in [Model Context Protocol](https://modelcontextprotocol.io/) server for AI-powered security testing from Claude Desktop, VS Code, Cursor, and other MCP clients.
23
+
24
+ ### Claude Desktop
25
+
26
+ Add to `claude_desktop_config.json`:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "waf-tester": {
32
+ "command": "npx",
33
+ "args": ["-y", "@waftester/cli", "mcp"]
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ### VS Code
40
+
41
+ Add to `.vscode/mcp.json` in your workspace:
42
+
43
+ ```json
44
+ {
45
+ "servers": {
46
+ "waf-tester": {
47
+ "command": "npx",
48
+ "args": ["-y", "@waftester/cli", "mcp"]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ### Cursor
55
+
56
+ Add to Cursor MCP settings:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "waf-tester": {
62
+ "command": "npx",
63
+ "args": ["-y", "@waftester/cli", "mcp"]
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ## CLI Usage
70
+
71
+ ```bash
72
+ # Full automated assessment
73
+ waf-tester auto -u https://target.com --smart
74
+
75
+ # WAF vendor detection
76
+ waf-tester vendor -u https://target.com
77
+
78
+ # XSS payload testing
79
+ waf-tester run -u https://target.com -category xss
80
+
81
+ # Bypass discovery with tamper chains
82
+ waf-tester bypass -u https://target.com --smart --tamper-auto
83
+
84
+ # Version check
85
+ waf-tester version
86
+ ```
87
+
88
+ ## Platform Support
89
+
90
+ | Platform | Architecture | Package |
91
+ |---|---|---|
92
+ | macOS | x64 (Intel) | `@waftester/darwin-x64` |
93
+ | macOS | arm64 (Apple Silicon) | `@waftester/darwin-arm64` |
94
+ | Linux | x64 | `@waftester/linux-x64` |
95
+ | Linux | arm64 | `@waftester/linux-arm64` |
96
+ | Windows | x64 | `@waftester/win32-x64` |
97
+ | Windows | arm64 | `@waftester/win32-arm64` |
98
+
99
+ ARM64 platforms with x64 emulation (Rosetta 2, Windows WoW) are supported as fallback.
100
+
101
+ ## Environment Variables
102
+
103
+ | Variable | Description |
104
+ |---|---|
105
+ | `WAF_TESTER_BINARY_PATH` | Override binary path (skip platform resolution) |
106
+ | `WAF_TESTER_PAYLOAD_DIR` | Override bundled payload directory |
107
+ | `WAF_TESTER_TEMPLATE_DIR` | Override bundled template directory |
108
+
109
+ ## License
110
+
111
+ [Business Source License 1.1](https://github.com/waftester/waftester/blob/main/LICENSE) — converts to open source after the change date. See [LICENSE](https://github.com/waftester/waftester/blob/main/LICENSE) for full terms.
112
+
113
+ Community payloads are licensed under [MIT](https://github.com/waftester/waftester/blob/main/LICENSE-COMMUNITY).
114
+
115
+ ## Links
116
+
117
+ - [GitHub](https://github.com/waftester/waftester)
118
+ - [Documentation](https://github.com/waftester/waftester/blob/main/docs/EXAMPLES.md)
119
+ - [Installation Guide](https://github.com/waftester/waftester/blob/main/docs/INSTALLATION.md)
120
+ - [Changelog](https://github.com/waftester/waftester/blob/main/CHANGELOG.md)
121
+ - [Issues](https://github.com/waftester/waftester/issues)
package/bin/cli.js ADDED
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ // — Runtime Node.js version check (engines field is advisory only) —
6
+ const major = parseInt(process.versions.node.split(".")[0], 10);
7
+ if (major < 16) {
8
+ console.error(
9
+ `WAFtester requires Node.js >= 16 (found ${process.version}).`
10
+ );
11
+ process.exit(1);
12
+ }
13
+
14
+ const { execFileSync } = require("child_process");
15
+ const { existsSync } = require("fs");
16
+ const path = require("path");
17
+
18
+ const PLATFORMS = {
19
+ "darwin-x64": "@waftester/darwin-x64",
20
+ "darwin-arm64": "@waftester/darwin-arm64",
21
+ "linux-x64": "@waftester/linux-x64",
22
+ "linux-arm64": "@waftester/linux-arm64",
23
+ "win32-x64": "@waftester/win32-x64",
24
+ "win32-arm64": "@waftester/win32-arm64",
25
+ };
26
+
27
+ // ARM64 → x64 emulation fallback (Rosetta 2 / Windows ARM emulation)
28
+ const EMULATION_FALLBACK = {
29
+ "darwin-arm64": "@waftester/darwin-x64",
30
+ "win32-arm64": "@waftester/win32-x64",
31
+ };
32
+
33
+ function resolvePkgBinary(packageName) {
34
+ const binaryName =
35
+ process.platform === "win32" ? "waf-tester.exe" : "waf-tester";
36
+ const pkgJsonPath = require.resolve(`${packageName}/package.json`);
37
+
38
+ // Yarn PnP: detect if resolved path is inside a .zip archive
39
+ if (pkgJsonPath.includes(".zip/")) {
40
+ console.error(
41
+ `WAFtester: binary resolved inside a zip archive (Yarn PnP).\n` +
42
+ `Set preferUnplugged: true for ${packageName} in .yarnrc.yml,\n` +
43
+ `or run: yarn unplug ${packageName}`
44
+ );
45
+ process.exit(1);
46
+ }
47
+
48
+ return path.join(path.dirname(pkgJsonPath), "bin", binaryName);
49
+ }
50
+
51
+ function getBinaryPath() {
52
+ // 1. Environment variable override (for development/debugging)
53
+ const envPath = process.env.WAF_TESTER_BINARY_PATH;
54
+ if (envPath) {
55
+ if (!existsSync(envPath)) {
56
+ console.error(
57
+ `WAFtester: WAF_TESTER_BINARY_PATH does not exist: ${envPath}\n` +
58
+ `Unset WAF_TESTER_BINARY_PATH to use the bundled binary.`
59
+ );
60
+ process.exit(1);
61
+ }
62
+ return envPath;
63
+ }
64
+
65
+ const platformKey = `${process.platform}-${process.arch}`;
66
+
67
+ // 2. Exact platform match
68
+ const packageName = PLATFORMS[platformKey];
69
+ if (packageName) {
70
+ try {
71
+ return resolvePkgBinary(packageName);
72
+ } catch {
73
+ // Fall through to emulation fallback
74
+ }
75
+ }
76
+
77
+ // 3. Emulation fallback (ARM64 → x64 via Rosetta 2 / WoW)
78
+ const fallbackPkg = EMULATION_FALLBACK[platformKey];
79
+ if (fallbackPkg) {
80
+ try {
81
+ const fallbackPath = resolvePkgBinary(fallbackPkg);
82
+ console.error(
83
+ `WAFtester: native binary for ${platformKey} not found.\n` +
84
+ `Falling back to x64 binary under emulation.`
85
+ );
86
+ return fallbackPath;
87
+ } catch {
88
+ // Fall through to error
89
+ }
90
+ }
91
+
92
+ // 4. Unsupported or missing — actionable error message
93
+ if (!packageName) {
94
+ console.error(
95
+ `WAFtester: unsupported platform ${platformKey}\n` +
96
+ `Supported: ${Object.keys(PLATFORMS).join(", ")}\n` +
97
+ `Install from source: ` +
98
+ `go install github.com/waftester/waftester/cmd/cli@latest`
99
+ );
100
+ } else {
101
+ console.error(
102
+ `WAFtester: ${packageName} is not installed.\n\n` +
103
+ `Try reinstalling:\n` +
104
+ ` npm install @waftester/cli\n\n` +
105
+ `If --no-optional was used:\n` +
106
+ ` npm install @waftester/cli --include=optional\n\n` +
107
+ `Or install from source:\n` +
108
+ ` go install github.com/waftester/waftester/cmd/cli@latest`
109
+ );
110
+ }
111
+ process.exit(1);
112
+ }
113
+
114
+ // — Set payload/template directories (user env vars take precedence) —
115
+ const cliDir = path.resolve(__dirname, "..");
116
+ if (!process.env.WAF_TESTER_PAYLOAD_DIR) {
117
+ process.env.WAF_TESTER_PAYLOAD_DIR = path.join(cliDir, "payloads");
118
+ }
119
+ if (!process.env.WAF_TESTER_TEMPLATE_DIR) {
120
+ process.env.WAF_TESTER_TEMPLATE_DIR = path.join(
121
+ cliDir,
122
+ "templates",
123
+ "nuclei"
124
+ );
125
+ }
126
+
127
+ // — Execute the Go binary (esbuild + Turbo pattern) —
128
+ // execFileSync inherits stdio and throws on non-zero exit.
129
+ // The thrown error's .status property contains the exit code.
130
+ try {
131
+ execFileSync(getBinaryPath(), process.argv.slice(2), {
132
+ stdio: "inherit",
133
+ env: process.env,
134
+ });
135
+ } catch (e) {
136
+ // execFileSync throws for non-zero exit OR spawn failure.
137
+ // Forward the child's exit code if available.
138
+ if (e && e.status != null) {
139
+ process.exit(e.status);
140
+ }
141
+ // Spawn failure (ENOENT, EACCES, etc.)
142
+ if (e && e.code === "ENOENT") {
143
+ console.error(`WAFtester: binary not found.`);
144
+ console.error(`Try reinstalling: npm install @waftester/cli`);
145
+ } else if (e && e.code === "EACCES") {
146
+ console.error(`WAFtester: permission denied.`);
147
+ console.error(`Try: chmod +x <binary path>`);
148
+ } else {
149
+ console.error(`WAFtester: ${(e && e.message) || e}`);
150
+ }
151
+ process.exit(1);
152
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@waftester/cli",
3
+ "version": "2.8.0",
4
+ "description": "WAFtester — the most comprehensive WAF testing CLI & MCP server",
5
+ "license": "BUSL-1.1",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/waftester/waftester.git"
9
+ },
10
+ "homepage": "https://github.com/waftester/waftester",
11
+ "bugs": "https://github.com/waftester/waftester/issues",
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "provenance": true
15
+ },
16
+ "keywords": [
17
+ "waf",
18
+ "security",
19
+ "testing",
20
+ "firewall",
21
+ "mcp",
22
+ "web-application-firewall",
23
+ "penetration-testing",
24
+ "owasp",
25
+ "sqli",
26
+ "xss",
27
+ "security-scanner",
28
+ "model-context-protocol",
29
+ "ai-security"
30
+ ],
31
+ "bin": {
32
+ "waf-tester": "bin/cli.js"
33
+ },
34
+ "files": [
35
+ "bin/",
36
+ "payloads/",
37
+ "templates/",
38
+ "LICENSE",
39
+ "LICENSE-COMMUNITY"
40
+ ],
41
+ "engines": {
42
+ "node": ">=16"
43
+ },
44
+ "optionalDependencies": {
45
+ "@waftester/darwin-x64": "2.8.0",
46
+ "@waftester/darwin-arm64": "2.8.0",
47
+ "@waftester/linux-x64": "2.8.0",
48
+ "@waftester/linux-arm64": "2.8.0",
49
+ "@waftester/win32-x64": "2.8.0",
50
+ "@waftester/win32-arm64": "2.8.0"
51
+ }
52
+ }
@@ -0,0 +1,45 @@
1
+ # Community Payloads
2
+
3
+ Free, open-source attack payloads for WAF testing. Licensed under MIT.
4
+
5
+ ## Categories
6
+
7
+ | Category | Description | Files |
8
+ |----------|-------------|-------|
9
+ | `auth/` | Authentication bypass payloads | JWT, OAuth, session attacks |
10
+ | `injection/` | SQL, NoSQL, Command injection | SQLi, CMDi, LDAP |
11
+ | `traversal/` | Path traversal attacks | LFI, directory traversal |
12
+ | `xss/` | Cross-site scripting | Reflected, stored, DOM XSS |
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ # Run all community payloads
18
+ waftester -u https://example.com -payloads community
19
+
20
+ # Run specific category
21
+ waftester -u https://example.com -payloads community/xss
22
+ ```
23
+
24
+ ## Contributing
25
+
26
+ We welcome payload contributions! See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
27
+
28
+ ### Payload Format
29
+
30
+ ```json
31
+ {
32
+ "id": "unique-id",
33
+ "name": "Human readable name",
34
+ "category": "xss|sqli|injection|traversal|auth",
35
+ "payload": "actual attack string",
36
+ "encoding": "none|url|base64|html",
37
+ "expected_block": true,
38
+ "cwe": "CWE-79",
39
+ "severity": "high|medium|low"
40
+ }
41
+ ```
42
+
43
+ ## License
44
+
45
+ MIT - See [LICENSE-COMMUNITY](../../LICENSE-COMMUNITY)
@@ -0,0 +1,173 @@
1
+ [
2
+ {
3
+ "id": "AI-ML-001",
4
+ "payload": "/api/assets?metadata={\"description\":\"<script>alert(1)</script>\"}",
5
+ "tags": [
6
+ "ml-poisoning",
7
+ "xss",
8
+ "metadata",
9
+ "quick",
10
+ "high"
11
+ ],
12
+ "expected_block": false,
13
+ "severity_hint": "High",
14
+ "notes": "XSS in ML-generated image description",
15
+ "category": "AI"
16
+ },
17
+ {
18
+ "id": "AI-ML-002",
19
+ "payload": "/api/assets/upload",
20
+ "method": "POST",
21
+ "body": "adversarial_image_with_misclassification_pattern.jpg",
22
+ "tags": [
23
+ "ml-poisoning",
24
+ "adversarial",
25
+ "classification",
26
+ "medium"
27
+ ],
28
+ "expected_block": false,
29
+ "severity_hint": "Medium",
30
+ "notes": "Adversarial image to poison ML classification",
31
+ "category": "AI"
32
+ },
33
+ {
34
+ "id": "AI-ML-003",
35
+ "payload": "/api/search/metadata?q=../../etc/passwd",
36
+ "tags": [
37
+ "ml-poisoning",
38
+ "path-traversal",
39
+ "high"
40
+ ],
41
+ "expected_block": true,
42
+ "severity_hint": "High",
43
+ "notes": "Path traversal in ML metadata search",
44
+ "category": "AI"
45
+ },
46
+ {
47
+ "id": "AI-ML-004",
48
+ "payload": "/api/assets?faces=[{\"name\":\"<img src=x onerror=alert(1)>\"}]",
49
+ "tags": [
50
+ "ml-poisoning",
51
+ "xss",
52
+ "face-recognition",
53
+ "quick",
54
+ "high"
55
+ ],
56
+ "expected_block": false,
57
+ "severity_hint": "High",
58
+ "notes": "XSS in face recognition metadata",
59
+ "category": "AI"
60
+ },
61
+ {
62
+ "id": "AI-ML-005",
63
+ "payload": "/api/assets?objects=[\"' OR '1'='1\"]",
64
+ "tags": [
65
+ "ml-poisoning",
66
+ "sqli",
67
+ "object-detection",
68
+ "high"
69
+ ],
70
+ "expected_block": false,
71
+ "severity_hint": "High",
72
+ "notes": "SQLi in object detection metadata",
73
+ "category": "AI"
74
+ },
75
+ {
76
+ "id": "AI-ML-006",
77
+ "payload": "/api/assets?description={{constructor.constructor('return process')().mainModule.require('child_process').execSync('id')}}",
78
+ "tags": [
79
+ "ml-poisoning",
80
+ "rce",
81
+ "ssti",
82
+ "critical"
83
+ ],
84
+ "expected_block": false,
85
+ "severity_hint": "Critical",
86
+ "notes": "SSTI/RCE in ML description field",
87
+ "category": "AI"
88
+ },
89
+ {
90
+ "id": "AI-ML-007",
91
+ "payload": "/api/assets?tags=[\"tag1\",\"tag2\",\"tag3\",...x10000]",
92
+ "tags": [
93
+ "ml-poisoning",
94
+ "dos",
95
+ "resource-exhaustion",
96
+ "quick",
97
+ "medium"
98
+ ],
99
+ "expected_block": false,
100
+ "severity_hint": "Medium",
101
+ "notes": "DoS via excessive ML tags",
102
+ "category": "AI"
103
+ },
104
+ {
105
+ "id": "AI-ML-008",
106
+ "payload": "/api/search/smart?q=UNION SELECT password FROM users--",
107
+ "tags": [
108
+ "ml-poisoning",
109
+ "sqli",
110
+ "smart-search",
111
+ "critical"
112
+ ],
113
+ "expected_block": false,
114
+ "severity_hint": "Critical",
115
+ "notes": "SQLi in AI-powered smart search",
116
+ "category": "AI"
117
+ },
118
+ {
119
+ "id": "AI-ML-009",
120
+ "payload": "/api/assets?location={\"latitude\":\"'; DROP TABLE assets;--\",\"longitude\":0}",
121
+ "tags": [
122
+ "ml-poisoning",
123
+ "sqli",
124
+ "geolocation",
125
+ "high"
126
+ ],
127
+ "expected_block": false,
128
+ "severity_hint": "High",
129
+ "notes": "SQLi in ML geolocation metadata",
130
+ "category": "AI"
131
+ },
132
+ {
133
+ "id": "AI-ML-010",
134
+ "payload": "/api/assets?ocr_text=javascript:alert(document.domain)",
135
+ "tags": [
136
+ "ml-poisoning",
137
+ "xss",
138
+ "ocr",
139
+ "quick",
140
+ "high"
141
+ ],
142
+ "expected_block": false,
143
+ "severity_hint": "High",
144
+ "notes": "XSS in OCR extracted text",
145
+ "category": "AI"
146
+ },
147
+ {
148
+ "id": "AI-ML-011",
149
+ "payload": "/api/search/clip?embedding=[0.1,0.2,...,NaN,...,0.5]",
150
+ "tags": [
151
+ "ml-poisoning",
152
+ "model-confusion",
153
+ "medium"
154
+ ],
155
+ "expected_block": false,
156
+ "severity_hint": "Medium",
157
+ "notes": "NaN injection in CLIP embedding search",
158
+ "category": "AI"
159
+ },
160
+ {
161
+ "id": "AI-ML-012",
162
+ "payload": "/api/assets?ml_metadata={\"confidence\":-1.5}",
163
+ "tags": [
164
+ "ml-poisoning",
165
+ "invalid-data",
166
+ "low"
167
+ ],
168
+ "expected_block": false,
169
+ "severity_hint": "Low",
170
+ "notes": "Negative confidence score injection",
171
+ "category": "AI"
172
+ }
173
+ ]