benjaminbencsik/wascan

GitHub: benjaminbencsik/wascan

一款基于 Python 异步架构的综合 Web 应用漏洞扫描器,内置 40+ 安全检查项并集成爬虫、子域名枚举与内容发现能力。

Stars: 0 | Forks: 0

# wascan - Web 应用程序漏洞扫描器 一款全面、异步的 Web 应用程序安全扫描器,可检测 OWASP Top 10 漏洞、配置错误和安全弱点。 ## 功能 - **40+ 项安全检查**:XSS、SQL 注入、路径遍历、SSRF、命令注入、XXE、JWT 漏洞等 - **Web 爬虫**:集成式 Spider,用于发现页面和表单 - **子域名枚举**:DNS + 证书透明度发现 - **内容发现**:通过暴力破解发现常见路径和文件 - **技术指纹识别**:检测框架和服务器 - **WAF 检测**:自动进行 WAF 检测及绕过编码 - **插件系统**:可通过自定义 Python 插件进行扩展 - **多种输出格式**:Text、HTML、JSON、CSV - **SQLite 存储**:跟踪扫描历史并对比差异结果 ## 安装 ``` # Clone 或下载扫描器 git clone https://github.com/yourrepo/vulnscan.git cd vulnscan # 安装依赖 pip install -r requirements.txt # 可选:安装 Playwright 用于截图 pip install playwright playwright install chromium ``` ### 依赖项 - Python 3.8+ - aiohttp - beautifulsoup4 - lxml - playwright (可选,用于截图) ## 快速开始 ``` # 基础扫描 python3 wascan.py https://example.com # Quick 配置文件(快速检查) python3 wascan.py https://example.com --profile quick # 包含所有检查的 Full 扫描 python3 wascan.py https://example.com --profile full ``` ## 使用示例 ### 扫描配置文件 ``` # Quick - 用于主动扫描的 10 项快速检查 python3 wascan.py https://example.com --profile quick # Stealth - 较慢、隐蔽,规避 WAF python3 wascan.py https://example.com --profile stealth # Full - 启用所有检查 python3 wascan.py https://example.com --profile full ``` ### 输出格式 ``` # HTML 报告 python3 wascan.py https://example.com --output html --report-file report.html # JSON 输出 python3 wascan.py https://example.com --output json # 用于电子表格的 CSV python3 wascan.py https://example.com --output csv # 纯文本(默认) python3 wascan.py https://example.com --output text --no-color ``` ### 身份验证 ``` # 扫描前登录(提取 session cookies) python3 wascan.py https://example.com \ --login-url https://example.com/login \ --login-data "username=admin&password=secret123" \ --login-success "Dashboard" # 使用现有 cookies python3 wascan.py https://example.com --cookie "session=abc123; role=admin" ``` ### 代理支持 ``` # 通过代理路由(Burp、ZAP 等) python3 wascan.py https://example.com --proxy http://127.0.0.1:8080 ``` ### 自定义检查 ``` # 仅运行特定检查 python3 wascan.py https://example.com --checks xss sqli headers # 使用自定义 wordlist 进行内容发现 python3 wascan.py https://example.com --checks content --content-wordlist paths.txt ``` ### Spider 配置 ``` # 配置爬虫深度和页面限制 python3 wascan.py https://example.com --spider-depth 3 --spider-pages 100 ``` ### 数据库与历史记录 ``` # 将结果保存到 SQLite python3 wascan.py https://example.com --db wascan.db # 列出所有存储的扫描 python3 wascan.py --db wascan.db --list-scans # Diff 两次扫描(查看变更) python3 wascan.py --db wascan.db --diff-scans 1:2 # 将 finding 标记为误报 python3 wascan.py --db wascan.db --mark-fp 42 ``` ### 通知 ``` # Slack/Discord webhook(发送 critical/high 级别的 findings) python3 wascan.py https://example.com --notify https://hooks.slack.com/services/XXX # 邮件报告 python3 wascan.py https://example.com \ --smtp-host smtp.gmail.com \ --smtp-user user@gmail.com \ --smtp-pass apppassword \ --email-to target@example.com ``` ### 截图 ``` # 对发现的页面进行截图截图 python3 wascan.py https://example.com --screenshots ./screenshots ``` ### CI/CD 集成 ``` # 如果发现 high+ severity 则以代码 1 退出 python3 wascan.py https://example.com --fail-on high ``` ## 可用检查项 | 类别 | 检查项 | |----------|--------| | 注入 | xss, sqli, traversal, ssrf, cmdi, xxe, ssti, crlf | | 身份验证/会话 | jwt, defaultcreds, cookies, hostheader, idor | | 配置/Headers | headers, files, methods, ssl, clickjack, dirlist, cors | | 发现 | secrets, jslibs, jsendpoints, techfingerprint, waf, graphql | | 高级 | fileupload, protopollution, smuggling, parampollution, deserial | | DNS/侦察 | subdomains, zonetransfer, certtransparency | | 主动 | spider, ratelimit | | TLS | tls, depcve, oauth | ## Docker ``` # 构建镜像 docker build -t wascan . # 运行扫描 docker run wascan https://example.com --profile quick # 使用 output volume 运行 docker run -v $(pwd)/reports:/app/reports wascan https://example.com --output html --report-file /app/reports/report.html ``` ## REST API 启动 API 服务器: ``` pip install fastapi uvicorn python3 api.py ``` API 运行在 `http://localhost:8000`。Swagger 文档可在 `/docs` 获取。 ### 端点 | 方法 | 端点 | 描述 | |--------|----------|-------------| | GET | `/api/scans` | 列出所有扫描 | | GET | `/api/scans/{id}` | 获取扫描详情 | | POST | `/api/scans` | 启动新的扫描 | | DELETE | `/api/scans/{id}` | 删除扫描 | ## Web 仪表板 启动仪表板: ``` pip install jinja2 python3 dashboard_server.py ``` 在浏览器中打开 `http://localhost:8000`。 ## 运行测试 ``` pip install pytest pytest-asyncio pytest tests/ ``` ## 插件开发 在 Python 文件中创建自定义检查: ``` # myplugin.py async def check(session, url, result): # Your check logic here resp = await session.get(url) # Add findings using result.add(Finding(...)) ``` 加载插件: ``` python3 wascan.py https://example.com --plugin-dir ./plugins ``` ## 许可证 MIT
标签:aiohttp, JWT漏洞, LNA, OWASP Top 10, Playwright, Python, SQL注入检测, SSRF检测, WAF检测与绕过, Web应用扫描器, XSS检测, XXE漏洞, 命令注入, 大数据, 子域名枚举, 安全报告, 安全检测工具, 密码管理, 异步扫描, 数据泄露, 无后门, 特征检测, 目录扫描, 系统安全, 网络安全, 网络测绘, 证书透明度, 请求拦截, 调试插件, 路径遍历, 逆向工具, 隐私保护, 黑盒测试