Dalfox
What is the purpose of Dalfox?
Dalfox is an open-source command-line XSS scanner and automation utility. It is designed to find, verify, and report Cross-Site Scripting issues across URL parameters, request bodies, headers, discovered parameters, DOM-derived inputs, stored XSS flows, and large URL pipelines.
Dalfox is useful because it focuses deeply on XSS workflows instead of acting as a general web scanner. It supports single-target scans, file-based scans, stdin pipelines, raw HTTP request testing, stored XSS verification, payload generation, report generation, REST API server mode, and MCP server mode.
Use Dalfox only on applications you own or have explicit permission to test. XSS scanners send active payloads and can trigger application behavior, logs, alerts, state changes, and callback traffic.
Here are the primary uses of Dalfox:
-
Reflected XSS Testing: Dalfox injects payloads into parameters and analyzes responses to identify reflected and verified XSS behavior.
-
DOM-Based XSS Testing: The tool can mine DOM sources and run deeper browser-assisted checks for JavaScript-heavy applications.
-
Stored XSS Testing: Dalfox
sxssmode sends a payload to one URL and verifies execution or reflection on a separate trigger URL. -
Blind XSS Testing: The tool supports blind callback URLs so delayed or out-of-band payload execution can be detected.
-
Parameter Discovery: Dalfox can mine parameters from dictionaries, DOM analysis, remote wordlists, and explicit
-pparameter lists. -
Pipeline Scanning: The
pipeandfilemodes make it practical to scan URL lists from crawlers, archives, proxies, and bug bounty recon tools. -
Raw Request Testing: Dalfox can read raw HTTP request files exported from tools such as Burp Suite or ZAP and test the captured request structure.
-
Payload and Report Automation: The tool can generate payloads, use custom payload files, pull remote payload sources, produce JSON/JSONL output, and run as a service for automation.
Core Features
- Reflected, DOM, stored, and blind XSS testing
- URL, file, pipe, raw request, and HAR input modes
- Parameter mining from dictionaries, DOM, and remote wordlists
- Custom, remote, and generated payload support
- Headers, cookies, POST data, proxy, worker, and delay controls
- JSON, JSONL, report, HAR, request, and response output options
- REST API, MCP server, and CI automation support
Data sources
- Single URLs and URL lists
- Raw HTTP requests and HAR files
- Headers, cookies, query strings, and request bodies
- DOM-discovered and dictionary-discovered parameters
- Custom and remote XSS payload lists
- Blind XSS callback endpoints
- Dalfox JSON configuration files and API requests
Common Dalfox Commands
1. Install Dalfox with Homebrew
- This command installs Dalfox on macOS or Linux systems with Homebrew.
brew install dalfox
2. Install Dalfox from Source
- This command installs the latest Dalfox v2 module with Go.
go install github.com/hahwul/dalfox/v2@latest
3. Pull the Docker Image
- This command pulls the official Dalfox image from GitHub Container Registry.
docker pull ghcr.io/hahwul/dalfox:latest
4. Check Dalfox Version
- This command prints the installed Dalfox version.
dalfox --version
5. Show Global Help
- This command displays Dalfox modes and global flags.
dalfox help
6. Show URL Mode Help
- This command displays help for single URL scanning.
dalfox url --help
7. Scan a Single URL
- This command scans a single target URL for XSS.
dalfox url "https://example.com/search?q=test"
8. Scan a URL Without Existing Parameters
- This command lets Dalfox perform parameter discovery before XSS testing.
dalfox url "https://example.com/search"
9. Scan Only Specific Parameters
- This command tests only selected parameters.
dalfox url "https://example.com/search?q=test&page=1" -p q -p page
10. Ignore Noisy Parameters
- This command skips parameters that should not be tested.
dalfox url "https://example.com/form?csrf_token=abc&q=test" --ignore-param csrf_token
11. Ignore Specific HTTP Return Codes
- This command ignores selected status codes during scanning.
dalfox url "https://example.com/search?q=test" --ignore-return "403,404,500"
12. Add a Custom Header
- This command adds an HTTP header to each request.
dalfox url "https://example.com/search?q=test" -H "Authorization: Bearer <token>"
13. Add Cookies
- This command sends cookies with the scan requests.
dalfox url "https://example.com/account?q=test" -C "sessionid=abc123; role=user"
14. Load Cookies from a Raw Request
- This command loads cookies from a captured raw HTTP request file.
dalfox url "https://example.com/account?q=test" --cookie-from-raw request.txt
15. Use a Custom User-Agent
- This command sets the User-Agent header.
dalfox url "https://example.com/search?q=test" --user-agent "Mozilla/5.0 Dalfox-Test"
16. Send a POST Request
- This command tests a form-style POST body.
dalfox url "https://example.com/search" -X POST -d "q=test&category=docs"
17. Send a JSON Request Body
- This command tests a JSON API request body.
dalfox url "https://example.com/api/search" -X POST -H "Content-Type: application/json" -d '{"q":"test"}'
18. Follow Redirects
- This command follows HTTP redirects during scanning.
dalfox url "https://example.com/redirect?q=test" -F
19. Send Traffic Through a Proxy
- This command routes Dalfox requests through a local proxy for inspection.
dalfox url "https://example.com/search?q=test" --proxy "http://127.0.0.1:8080"
20. Set Timeout
- This command sets request timeout in seconds.
dalfox url "https://example.com/search?q=test" --timeout 20
21. Tune Worker Count
- This command controls concurrent workers.
dalfox url "https://example.com/search?q=test" -w 50
22. Add Request Delay
- This command adds delay between requests in milliseconds.
dalfox url "https://example.com/search?q=test" --delay 500
23. Limit CPU Usage
- This command limits the maximum number of CPUs Dalfox uses.
dalfox url "https://example.com/search?q=test" --max-cpu 1