chrispsk/python-web-vulnerability-scanner
GitHub: chrispsk/python-web-vulnerability-scanner
一款教育用途的 Python Web 漏洞扫描器,通过爬取目标站点并注入测试 payload 来检测基本的反射型 XSS 和 SQL 注入漏洞指示。
Stars: 0 | Forks: 0
# Python Web 漏洞扫描器
用于检测 Web 应用程序中基本**反射型 XSS**和 **SQL 注入指示**的教育性 Python Web 漏洞扫描器。
该扫描器会爬取目标网站,查找链接和 HTML 表单,发送测试 payload,并分析 HTTP 响应以寻找潜在的漏洞。
## 功能
* 爬取内部链接并构建简单的站点地图
* 检测 URL 参数中的反射型 XSS
* 检测 HTML 表单中的反射型 XSS
* 检测 URL 参数中的 SQL 注入指示
* 检测 HTML 表单中的 SQL 注入指示
* 支持基于错误的 SQL 注入检查
* 支持基于布尔的 SQL 注入检查
* 可选的 HTTP 标头 SQL 注入检查
* 可选的隐藏表单字段测试
* 打印包含易受攻击 URL 和 payload 的最终摘要
## 技术栈
* Python
* requests
* BeautifulSoup4
## 安装说明
安装所需的 Python 包:
```
pip install requests beautifulsoup4
```
## 用法
python main.py --url http://testasp.vulnweb.com/
python main.py --url http://testasp.vulnweb.com/ --max-pages 2
python main.py --url http://testasp.vulnweb.com/ --test-headers
python main.py --url http://testasp.vulnweb.com/ --test-hidden
python main.py --url http://testasp.vulnweb.com/ --test-headers --test-hidden
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-hidden
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers --test-hidden
python main.py --url http://testasp.vulnweb.com/ --ignore http://testasp.vulnweb.com/logout
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --ignore http://testasp.vulnweb.com/logout
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers --ignore http://testasp.vulnweb.com/logout
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-hidden --ignore http://testasp.vulnweb.com/logout
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers --test-hidden --ignore http://testasp.vulnweb.com/logout
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --ignore http://testasp.vulnweb.com/logout --ignore http://testasp.vulnweb.com/register
基本扫描:
```
python main.py --url http://testasp.vulnweb.com/ --max-pages 2
```
结合 HTTP 标头 SQL 注入测试的扫描:
```
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers
```
扫描隐藏表单字段:
```
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-hidden
```
启用两项可选检查的扫描:
```
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --test-headers --test-hidden
```
爬取时忽略特定 URL:
```
python main.py --url http://testasp.vulnweb.com/ --max-pages 2 --ignore http://testasp.vulnweb.com/logout
```
## 检测示例
### URL 参数中的 XSS
目标 URL 示例:
```
http://example.com/search.asp?q=test
```
扫描器将 XSS payload 注入到参数值中:
```
http://example.com/search.asp?q=
标签:CISA项目, DOE合作, Python, SQL注入检测, Web安全, XSS检测, 加密, 无后门, 漏洞扫描器, 蓝队分析, 逆向工具