amirfarssoo-max/ShadowScan
GitHub: amirfarssoo-max/ShadowScan
一款具备 50 余种检测器的异步 Web 漏洞扫描器,支持插件扩展并针对 Linux 和 Termux 环境进行了专门优化。
Stars: 1 | Forks: 0
# 🔍 ShadowScan Fusion
[](https://www.python.org/)
[](LICENSE)
[]()
## 📋 功能
- **50+ 漏洞检测器**:XSS、SQLi、SSTI、LFI、CMDI、SSRF 等
- **异步与高性能**:通过令牌桶速率限制优化并发
- **插件系统**:支持使用自定义检测器进行扩展
- **Termux 优化**:针对移动端渗透测试的特殊处理
- **智能爬取**:支持深度控制的递归 endpoint 发现
- **多种报告格式**:HTML、JSON、JSONL 日志记录
- **安全合规**:映射 OWASP Top 10、CWE、PCI-DSS
- **知识库**:从之前的扫描中学习
- **WAF 检测**:识别安全系统(Cloudflare、AWS WAF 等)
- **技术指纹识别**:检测框架和库
## 🚀 安装
### 环境要求
- **Python 3.8+**
- **pip** (Python 包管理器)
- **Linux/Termux 环境**
### 第一步:克隆仓库
```
git clone https://github.com/amirfarssoo-max/ShadowScan.git
cd ShadowScan
```
### 第二步:安装依赖
```
pip install -r requirements.txt
```
### 第三步:验证安装
```
python shadowscan.py --version
```
## 💻 快速开始
### 基础扫描
```
python shadowscan.py https://example.com
```
### 快速模式(Termux - 低资源消耗)
```
python shadowscan.py https://example.com -m fast --threads 2
```
### 使用自定义选项进行深度扫描
```
python shadowscan.py https://example.com \
-m deep \
--threads 6 \
--max-pages 500 \
--max-depth 3 \
-o my_scan
```
### 带身份验证的扫描
```
python shadowscan.py https://example.com \
--login-url https://example.com/login \
-u username \
-p password
```
### 使用代理
```
python shadowscan.py https://example.com \
--proxy http://127.0.0.1:8080 \
--no-verify-ssl
```
## 📚 使用指南
### 命令行参数
```
Positional:
target Target URL to scan
Scan Modes:
-m, --mode {fast|standard|deep|full}
Scan depth (default: standard)
--max-pages INT Maximum pages to crawl (default: 100)
--max-depth INT Maximum crawl depth (default: 2)
--no-crawl Disable crawling, scan target only
Performance:
-t, --threads INT Number of threads (default: auto)
--timeout INT Request timeout in seconds (default: 12/15)
--delay FLOAT Delay between requests (default: 0.05)
--rate-limit INT Requests per second (default: 100)
Authentication:
--login-url URL Login page URL
-u, --username USER Username for login
-p, --password PASS Password for login
--auth-token TOKEN Bearer/API token
--auth-type {bearer|basic|digest}
Network:
--proxy URL HTTP/HTTPS proxy URL
--cookies STR Cookies (format: name=value;name2=value2)
--custom-headers JSON Custom headers as JSON
--no-verify-ssl Disable SSL verification
--no-follow-redirects Don't follow redirects
Scope & Filtering:
--scope-domains DOMAIN [DOMAIN ...]
Domains to include in scope
--exclude-paths PATH [PATH ...]
URL patterns to exclude
--include-paths PATH [PATH ...]
URL patterns to include
Output:
-o, --output NAME Report name (default: scan_TIMESTAMP)
--format {html|json|both}
Report format (default: both)
--silent Suppress console output
-v, --verbose Verbose debug output
Configuration:
-c, --config FILE Load config from YAML/JSON file
--version Show version
```
### 配置文件
创建 `config.yaml`:
```
mode: deep
threads: 8
max_pages: 500
max_depth: 3
rate_limit: 50
safe_mode: true
exclude_paths:
- /logout
- /admin
- /*.pdf
```
使用配置运行:
```
python shadowscan.py https://example.com -c config.yaml
```
## 🎯 检测器类别
### 注入攻击
- **XSS** (跨站脚本攻击) - 反射型、存储型、基于 DOM
- **SQLi** (SQL 注入) - 报错型、布尔型、时间型
- **NoSQL 注入** - MongoDB、CouchDB 技术
- **SSTI** (服务器端模板注入) - Jinja2、Freemarker 等
- **命令注入** - 操作系统命令执行
- **LDAP 注入** - LDAP 过滤器攻击
- **XPath 注入** - XML 路径攻击
### 路径/文件遍历
- **LFI** (本地文件包含)
- **路径遍历** - ../../../ 攻击
- **文件包含** - PHP wrappers、过滤器链
### 服务器端漏洞
- **SSRF** (服务器端请求伪造)
- **XXE** (XML 外部实体) - XXE 注入
- **反序列化** - 不安全的对象反序列化
- **批量赋值** - 过度提交漏洞
### 访问控制
- **IDOR** (不安全的直接对象引用)
- **CORS 配置错误** - 通配符来源、凭据
- **点击劫持** - X-Frame-Options 绕过
- **开放重定向** - 任意重定向
### 身份验证与会话
- **JWT 问题** - 弱签名、缺少验证
- **会话固定** - Session ID 重用
- **Cookie 安全** - 缺少 Secure、HttpOnly 标志
- **密码重置缺陷** - token 预测
### 信息泄露
- **敏感文件** - .env、.git、配置文件
- **机密检测** - 响应中的 API key、token
- **技术指纹识别** - 框架检测
- **WAF 检测** - 安全系统识别
- **安全响应头** - 缺少 HSTS、CSP、X-Frame-Options
### 其他漏洞
- **原型链污染** - JavaScript 对象污染
- **HTTP 走私** - 请求走私攻击
- **CRLF 注入** - 响应头注入
- **Host 头注入** - Web 缓存中毒
- **缓存欺骗** - 基于缓存的攻击
- **竞态条件** - 基于时序的漏洞
## 📊 报告
报告保存在 `reports/` 目录下:
### HTML 报告
美观的深色主题 HTML 报告包含:
- 风险评分和评级 (A-F)
- 严重性细分 (严重、高、中、低)
- 包含证据和修复方案的详细发现
- 带有参数的 endpoint 列表
- OWASP Top 10 和 CWE 映射
```
# 生成 HTML 报告
python shadowscan.py https://example.com -o my_scan --format html
# 打开:reports/my_scan.html
```
### JSON 报告
用于自动化和解析的结构化 JSON 格式:
```
python shadowscan.py https://example.com --format json
```
### JSONL 日志
用于实时监控的事件流:
```
tail -f logs/scan_*.jsonl
```
## 🌍 Termux 专属设置
### 在 Termux 上安装 Python
```
pkg update && pkg upgrade
pkg install python python-pip
pkg install git
```
### 克隆与设置
```
cd ~
git clone https://github.com/amirfarssoo-max/ShadowScan.git
cd ShadowScan
pip install -r requirements.txt
```
### 在 Termux 上运行
```
# 快速扫描以节省资源
python shadowscan.py https://example.com -m fast -t 2
# 显示详细信息
python shadowscan.py https://example.com -v
```
**注意**:Termux 会自动启用 `termux-wake-lock` 以防止在扫描期间休眠。
## 🔌 插件系统
在 `detectors/` 目录中创建自定义检测器:
```
# detectors/my_detector.py
from shadowscan import BaseDetector, Severity, Finding
class MyCustomDetector(BaseDetector):
def __init__(self):
super().__init__(
name="My Custom Detector",
description="Detects custom vulnerability",
category="custom",
severity=Severity.HIGH
)
async def detect(self, client, endpoint, options):
findings = []
# Your detection logic here
for param in endpoint.parameters:
resp = await self.test_payload(client, endpoint.url, param, "test_payload")
if resp and "vulnerable_indicator" in resp.text:
self.add_finding(
title="Custom Vulnerability Found",
description="Details about the vulnerability",
url=endpoint.url,
parameter=param,
confidence=0.9,
verified=True
)
return self.findings
```
将 `my_detector.py` 放入 `detectors/` 目录,它将被自动加载!
## 📈 性能提示
### 对于 Termux/低资源设备
```
python shadowscan.py https://example.com \
-m fast \
--threads 2 \
--rate-limit 50 \
--delay 0.1 \
--max-pages 50 \
--max-depth 1
```
### 对于高性能服务器
```
python shadowscan.py https://example.com \
-m full \
--threads 16 \
--rate-limit 500 \
--delay 0.01 \
--max-pages 1000 \
--max-depth 5
```
### 爬取模式设置
- **fast**:快速的 endpoint 发现
- **normal**:均衡的发现
- **thorough**:完整的枚举
## ⚠️ 免责声明
**ShadowScan 仅用于授权的安全测试。**
- 仅扫描您拥有或获得明确书面测试许可的系统
- 未经授权的扫描是非法且不道德的
- 作者不对滥用此工具或由此造成的损害负责
- 请负责任地使用并遵守所有适用的法律
## 🐛 故障排除
### 问题:`ModuleNotFoundError: No module named 'httpx'`
```
pip install httpx
```
### 问题:SSL/TLS 证书错误
```
# 禁用验证(不建议用于生产环境)
python shadowscan.py https://example.com --no-verify-ssl
```
### 问题:超时错误
```
# 增加超时时间
python shadowscan.py https://example.com --timeout 30
```
### 问题:请求过多被阻止
```
# 降低 rate limit
python shadowscan.py https://example.com --rate-limit 30 --delay 0.2
```
## 🤝 贡献
欢迎贡献!请:
1. Fork 该仓库
2. 创建功能分支 (`git checkout -b feature/amazing-feature`)
3. 提交更改 (`git commit -m 'Add amazing feature'`)
4. 推送到分支 (`git push origin feature/amazing-feature`)
5. 发起 Pull Request
## 📄 许可证
该项目基于 **MIT License** 授权 - 详情请参阅 [LICENSE](LICENSE) 文件。
## 🔗 链接
- **GitHub**:[amirfarssoo-max/ShadowScan](https://github.com/amirfarssoo-max/ShadowScan)
- **问题**:[报告 Bug](https://github.com/amirfarssoo-max/ShadowScan/issues)
- **讨论**:[提问](https://github.com/amirfarssoo-max/ShadowScan/discussions)
## ⭐ 显示您的支持
如果 ShadowScan 对您有帮助,请考虑:
- ⭐ 为仓库加星
- 🐛 报告 Bug 并建议功能
- 📢 与您的安全社区分享
- 🤝 贡献改进
## 📧 联系方式
**作者**:amirfarssoo-max
**最后更新**:2026-07-15
**版本**:31.2.0-FUSION-FIXED
标签:CISA项目, Python, Termux, Web安全, 加密, 无后门, 漏洞扫描器, 蓝队分析, 运行时操纵, 逆向工具