ncKien05/Automated-Vulnerability-Scanner-Script
GitHub: ncKien05/Automated-Vulnerability-Scanner-Script
一款用 Python 编写的模块化 Web 应用自动化漏洞扫描脚本,通过内置多个专用检测模块帮助用户快速完成侦察与常见 Web 漏洞识别。
Stars: 0 | Forks: 1
# 自动化漏洞扫描脚本
一款模块化的 Python 自动化工具,旨在简化 Web 应用程序的**侦察**和**漏洞识别**。通过内置的专用模块来扫描和检测常见的 Web 漏洞。
## 功能特性
| 模块 | 技术 | 严重性 |
|--------|-----------|----------|
| **Recon** | 子域名枚举、端口扫描、Banner 抓取、robots.txt/sitemap 抓取 | INFO |
| **SQL Injection** | 针对 URL 参数和 HTML 表单的基于错误和基于时间的盲注 SQLi | CRITICAL |
| **IDOR** | 通过启发式 ID 参数 fuzzing 实现的不安全的直接对象引用 | HIGH |
| **LDAP Injection** | 带有错误特征检测的 LDAP 元字符注入 | HIGH |
| **XSS** | 通过对参数和表单进行基于 canary 的反射测试来检测反射型 XSS | HIGH |
| **Security Headers** | 缺失/薄弱的 CSP、HSTS、X-Frame-Options、X-Content-Type-Options | LOW–MEDIUM |
## 项目结构
```
Automated-Vulnerability-Scanner-Script/
├── scanner.py # ← Entry point (CLI)
├── config.py # Global payloads, settings, wordlists
├── requirements.txt
│
├── modules/
│ ├── recon.py # Reconnaissance module
│ ├── sql_injection.py # SQL Injection (Error-based + Time-based)
│ ├── idor.py # IDOR detection
│ ├── ldap_injection.py # LDAP Injection detection
│ ├── xss.py # Reflected XSS detection
│ └── headers.py # Security headers analysis
│
├── utils/
│ ├── http_client.py # HTTP client with retry, proxy, session
│ ├── reporter.py # JSON & HTML report generator
│ └── logger.py # Colourised terminal output
│
└── reports/ # Auto-created — scan reports saved here
```
## 安装
```
# Clone 仓库
git clone https://github.com/ncKien05/Automated-Vulnerability-Scanner-Script.git
cd Automated-Vulnerability-Scanner-Script
# 创建 virtual environment(推荐)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux / macOS
# 安装 dependencies
pip install -r requirements.txt
```
## 用法
```
# 针对目标运行所有 modules
python scanner.py -u http://testphp.vulnweb.com
# 仅运行特定 modules
python scanner.py -u http://target.com?id=1 --module sqli idor
# 使用 proxy(例如 Burp Suite)
python scanner.py -u http://target.com --proxy http://127.0.0.1:8080
# 提供 session cookie(已认证扫描)
python scanner.py -u http://target.com --cookie "PHPSESSID=abc123; role=admin"
# 调整 speed / timeouts
python scanner.py -u http://target.com --delay 1 --timeout 15
# 禁用 SSL 验证(self-signed certs)
python scanner.py -u https://target.com --no-ssl-verify
```
### CLI 选项
| 标志 | 默认值 | 描述 |
|------|---------|-------------|
| `-u / --url` | **必填** | 目标 URL |
| `-m / --module` | all | 以空格分隔的列表:`recon sqli idor ldap xss headers` |
| `--proxy` | None | HTTP 代理 URL |
| `--delay` | 0.5 | 请求之间的间隔秒数 |
| `--timeout` | 10 | 请求超时时间(秒) |
| `--cookie` | None | 用于已认证扫描的 Cookie header |
| `--no-ssl-verify` | False | 禁用 SSL 证书验证 |
| `--output` | both | 报告格式:`json` \| `html` \| `both` |
## 报告
每次扫描完成后,会在 `reports/` 目录下生成两个报告文件:
- **`scan__.json`** — 机器可读的扫描结果
- **`scan__.html`** — 带有严重性颜色标识、易于阅读的仪表盘
### HTML 报告预览
HTML 报告包含:
- 汇总卡片(Critical / High / Medium / Low / Info 计数)
- 包含严重性徽章、描述、URL、payload 和证据的漏洞详情卡片
- 深色模式设计
## 法律免责声明
## 技术栈
- **Python 3.11+**
- `requests` — HTTP 客户端
- `beautifulsoup4` + `lxml` — HTML 解析
- `colorama` — 跨平台的彩色终端输出
标签:CISA项目, Python, Web安全, 主机安全, 加密, 密码管理, 无后门, 漏洞扫描器, 网络调试, 自动化, 蓝队分析, 逆向工具