dalfox-rs
Available on Crates.io: https://crates.io/crates/dalfox-rs
A strictly-typed, asynchronous Rust binding for the Dalfox XSS Scanner.
dalfox-rs wraps the Dalfox binary with full coverage of its CLI flags, streaming JSON output into typed Rust structs, making XSS scanning composable and panic-free inside fuzzers, proxies, or CI/CD pipelines.
Features
- Full CLI coverage — every Dalfox flag exposed as a typed builder method
- Streaming output — real-time callbacks as findings are discovered
- Stored XSS — first-class
sxssmode for persistent XSS detection - Multi-format output — JSON, CSV, Markdown, and plain text
- Diagnostic capture — stderr, parse errors, exit codes all preserved
- Result filtering — query by severity, event type, or verified status
Installation
[]
= "0.2.0"
= { = "1", = ["full"] }
Prerequisite: The dalfox binary must be in your system $PATH or specified via .binary_path().
Setup (one-command)
Option A: Setup script (auto-detects Go/Homebrew or downloads binary)
Option B: Go install
Option C: Homebrew
Option D: Pre-built binary
# installs to ~/.local/bin/dalfox
Quick Start
use ;
async
Streaming Output
Process findings in real-time as they're discovered:
let result = runner.scan_url_streaming.await?;
Stored XSS (sxss mode)
Detect persistent XSS via separate injection and trigger URLs:
let result = runner.scan_sxss.await?;
Advanced Configuration
let runner = builder
.waf_evasion
.cookie
.header
.delay
.param
.blind_callback
.follow_redirects
.deep_domxss
.ignore_return
.tamper
.found_action
.binary_path
.build;
Result Filtering
let verified = result.verified_findings;
let critical = result.high_severity_findings;
if result.has_parse_errors
Execution Modes
| Mode | Method | Description |
|---|---|---|
| URL | scan_url() |
Scan a single target URL |
| File | scan_file_raw() |
Analyze a raw HTTP request file |
| Pipe | scan_pipe() |
Pipeline multiple URLs via stdin |
| Stored XSS | scan_sxss() |
Detect persistent XSS |
All modes have _streaming variants for real-time callbacks.
License
MIT License