Calimeg/XSSweep

GitHub: Calimeg/XSSweep

XSSweep 是一款现代 XSS 漏洞扫描器,支持反射型和存储型 XSS 自动化检测及 WAF 绕过。

Stars: 0 | Forks: 0

# XSSweep **现代反射型和存储型 XSS 扫描器,支持自动绕过 WAF** [![Python](https://img.shields.io/badge/python-3.8+-blue?style=for-the-badge&logo=python)](https://python.org) [![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)](LICENSE) [![Updated](https://img.shields.io/badge/updated-2026-blue?style=for-the-badge)]() XSSweep 是由 Andripwn / Pwn0sec 团队开发的 [**PwnXSS**](https://github.com/pwn0sec/PwnXSS) 的一个**分支**。原项目自**2019年起已被放弃**(v0.5 Final 版本,此后无任何更新)。XSSweep 对其进行了重写并大幅扩展,新增了以下功能:
- 存储型 XSS 检测 - 自动 WAF/过滤器探测与绕过 - 上下文感知检测(script、attribute、URL、HTML body) - 突变型 XSS (mXSS) payload - 并发爬虫 - 整洁的代码库 — 无冗余代码 ## 功能 | 功能 | 详情 | |------------|---------| | **反射型 XSS** | URL 参数、表单输入(GET/POST)、链接查询 | | **存储型 XSS** | POST → 跨同域链接页面重新 GET 验证 | | **自动 WAF 检测** | 探测 `<>` `"'` `()` `/` — 在返回 `entity` 或 `blocked` 时自动启用绕过 | | **WAF 绕过** | 5 层编码(URL、双重 URL、HTML 实体、十六进制实体、unicode JS、base64)+ `auto` 模式 | | **上下文检测** | 识别注入上下文:`html_body`、`attribute`、`script_js`、`url` | | **多 payload 模糊测试** | 60+ 标签 × 100+ 事件处理器 — 上下文感知组合 | | **mXSS** | 专门针对解析器差异的 payload | | **爬虫** | BFS 同源爬取,支持自定义深度 | | **JSON 输出** | 包含完整细节的结构化漏洞报告 | | **无需浏览器** | 纯 HTTP 检测 — 无需 Playwright/Puppeteer | | **随机 User-Agent** | 每次扫描从包含 5 款主流浏览器(Chrome、Firefox、Safari、Edge)的池中随机选择 UA,以减少 WAF 指纹识别 | ## 快速开始 ``` # Dependencies pip install -r requirements.txt # Crawl + 扫描目标 python pwnxss.py -u "https://public-firing-range.appspot.com/reflected/index.html" --depth 1 # 单个 URL(不进行 crawl) python pwnxss.py --single "http://labs.cai.do/xss.php?name=test" ``` ### 输出示例 ``` ************************************************** [11:43:55] [INFO] Checking connection to: http://labs.cai.do/xss.php?name=test [11:43:55] [INFO] Connection established 200 [11:43:55] [INFO] Filter probe: {'angle': 'raw', 'quote': 'raw', 'paren': 'raw', 'slash': 'raw'} [11:43:55] [INFO] Detected reflection context: html_body [11:43:55] [CRITICAL] Detected XSS (GET) at https://labs.cai.do/xss.php?name= [11:43:56] [CRITICAL] Detected XSS (GET) at https://labs.cai.do/xss.php?name= ====================== RÉCAPITULATIF DU SCAN ====================== Cible : http://labs.cai.do/xss.php?name=test Type Trouvés Exemple ───────────────────────────────────────────── URL paramètre 1 https://labs.cai.do/xss.php?name=... Mutation XSS 5 https://labs.cai.do/xss.php?name=... Multi-payload 1 https://labs.cai.do/xss.php?name=... TOTAL 8 ================================================================== ``` ## 用法 ``` usage: pwnxss -u [options] ``` ### 选项 | 参数 | 描述 | |----------|-------------| | `-u` | 目标 URL(爬虫模式) | | `--depth` | 爬取深度(默认:2) | | `--single` | 单个 URL 扫描,不进行爬取 | | `--method` | `0` = GET,`1` = POST,`2` = GET+POST(默认:2) | | `--payload` | 自定义 payload 字符串 | | `--proxy` | JSON 格式的代理:`{"https":"https://10.10.1.10:1080"}` | | `--cookie` | JSON 格式的 Cookies(默认:`{"ID":"1094200543"}`) | | `-o, --output` | 将扫描结果导出为 JSON 文件 | ### WAF 绕过 | 参数 | 描述 | |----------|-------------| | `--waf` | 强制 WAF 绕过模式(如果存在 WAF 则自动检测) | | `--bypass` | 绕过级别:`1` = 基础,`2` = 激进,`3` = 极限(默认:1) | | `--encoding` | 强制编码:`none`、`url`、`double_url`、`html_entity`、`hex_entity`、`auto`(当过滤器拦截尖括号时,`auto` 会选择 `html_entity`) | | `--no-verify` | 禁用 TLS 证书验证(适用于自签名证书) | ### 信息 | 参数 | 描述 | |----------|-------------| | `--list-payloads` | 显示示例 payload 并退出 | | `--list-tags` | 显示可用的 HTML 标签 | | `--list-events` | 显示可用的事件处理器 | | `--about` | 显示项目信息 | ## 工作原理 ``` Target URL | +-- 1. Fetch page | +-- 2. Combined probe -- a single request injects the filter-chars | (<> " ' () /) + a context marker, detecting entity / | blocked / raw AND the injection context (script, attribute, | URL, HTML body) in one round-trip | +-- 3. WAF detection -- benign payload -> | +-- if blocked -> auto-enable bypass | +-- 4. Scan phases: | +-- URL parameters (GET) | +-- Forms (GET + POST) | +-- Link parameters | +-- Multi-payload fuzzing (context-adaptive) | +-- mXSS (mutation XSS) | +-- Stored XSS (re-fetch after POST) | +-- 5. Summary + JSON export ``` ## 准确性与性能说明 - **正确检测 Style / mXSS 反射。** 当携带有自身活动标签的 payload 反射在外部包含的 `