Coucoudb/OctoScan
GitHub: Coucoudb/OctoScan
OctoScan 是一款基于 Rust 的安全编排工具,通过集成和编排 Nmap、Nuclei 等主流扫描器,利用交互式 TUI 界面实现自动化的漏洞发现与渗透测试流程。
Stars: 34 | Forks: 4
```
██████╗ ██████╗████████╗ ██████╗ ███████╗ ██████╗ █████╗ ███╗ ██╗
██╔═══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔════╝██╔════╝██╔══██╗████╗ ██║
██║ ██║██║ ██║ ██║ ██║███████╗██║ ███████║██╔██╗ ██║
██║ ██║██║ ██║ ██║ ██║╚════██║██║ ██╔══██║██║╚██╗██║
╚██████╔╝╚██████╗ ██║ ╚██████╔╝███████║╚██████╗██║ ██║██║ ╚████║
╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝
```





OctoScan 是一个 CLI 包装器,用于编排流行的安全工具(Nmap、Nuclei、ZAP、Feroxbuster、SQLMap、Subfinder、httpx、WPScan、Hydra),以实现快速和自动化的 Web 信息收集与审计。它具有交互式终端 UI,用于导航扫描和查看结果。
## 功能
- **交互式 TUI** — 通过键盘快捷键导航菜单、选择扫描器并浏览结果
- **扫描配置** — 内置配置(quick、web、recon、full)以及通过配置文件定义的用户配置
- **多扫描器编排** — 在单一界面中运行 Nmap、Nuclei、ZAP、Feroxbuster、SQLMap、Subfinder、httpx、WPScan 和 Hydra
- **并行执行** — 所有选定的扫描器同时运行,并带有实时状态指示器
- **智能管道** — 扫描器之间的自动链式调用:
- **Subfinder → httpx** — 自动探测发现的子域名
- **httpx/Nuclei/Nmap → WPScan** — 如果检测到 WordPress 则运行 WPScan
- **ZAP/Nuclei → SQLMap** — 在检测到 SQL 注入的端点上运行 SQLMap
- **Nmap → Hydra** — 对 Nmap 发现的服务(SSH、FTP、MySQL 等)进行凭据暴力破解
- **自动安装** — 在 Windows、macOS 和 Linux 上自动检测并安装缺失的工具
- **结构化发现** — 解析结果并按严重性分级(Critical、High、Medium、Low、Info)
- **导出** — 将报告保存为 JSON 或 TXT 格式
- **CLI 模式** — 直接从命令行运行扫描,无需交互模式
- **日志记录** — 调试日志写入 `%LOCALAPPDATA%\octoscan\logs\`(Windows),用于故障排除
## 前置条件
OctoScan 编排以下安全工具:
| Scanner | Install |
|---------|---------|
| [Nmap](https://nmap.org/) | `apt install nmap` / `brew install nmap` / [nmap.org/download](https://nmap.org/download) |
| [Nuclei](https://github.com/projectdiscovery/nuclei) | `go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest` |
| [ZAP](https://www.zaproxy.org/) | `apt install zaproxy` / `brew install --cask zap` / [zaproxy.org/download](https://www.zaproxy.org/download/) |
| [Feroxbuster](https://github.com/epi052/feroxbuster) | `apt install feroxbuster` / `brew install feroxbuster` / [GitHub Releases](https://github.com/epi052/feroxbuster/releases) |
| [SQLMap](https://sqlmap.org/) | `apt install sqlmap` / `brew install sqlmap` / `pip install sqlmap` |
| [Subfinder](https://github.com/projectdiscovery/subfinder) | `apt install subfinder` / `brew install subfinder` / [GitHub Releases](https://github.com/projectdiscovery/subfinder/releases) |
| [httpx](https://github.com/projectdiscovery/httpx) | `apt install httpx` / `brew install httpx` / [GitHub Releases](https://github.com/projectdiscovery/httpx/releases) |
| [WPScan](https://wpscan.com/) | `apt install wpscan` / `brew install wpscan` / `gem install wpscan` (requires Ruby) |
| [Hydra](https://github.com/vanhauser-thc/thc-hydra) | `apt install hydra` / `brew install hydra` / [GitHub Releases](https://github.com/maaaaz/thc-hydra-windows/releases) |
## 安装
```
# 克隆仓库
git clone https://github.com/Coucoudb/OctoScan.git
cd OctoScan
# 构建
cargo build --release
# 二进制文件位于 target/release/octoscan
```
## 用法
### 交互式模式
```
octoscan
```
启动 TUI 并使用键盘快捷键进行导航:
| Key | Action |
|-----|--------|
| `s` | 开始新的扫描 |
| `↑`/`↓` | 导航 / 滚动 |
| `Space` | 切换扫描器选择 |
| `Enter` | 确认 |
| `Tab` / `Shift+Tab` | 在扫描器结果标签页之间切换 |
| `e` | 导出结果 |
| `n` | 新建扫描(从结果界面) |
| `h` | 切换帮助 |
| `i` | 安装缺失的工具(从工具检查界面) |
| `q` / `Ctrl+C` | 退出 |
### CLI 模式
```
# 使用特定扫描器进行扫描
octoscan scan -t https://example.com -s nmap,nuclei
# 改为使用扫描配置文件
octoscan scan -t https://example.com --profile quick # Nmap only
octoscan scan -t https://example.com --profile web # Nmap, Nuclei, Feroxbuster, ZAP
octoscan scan -t https://example.com --profile recon # Subfinder, httpx, Nmap
octoscan scan -t https://example.com --profile full # All scanners
# 子域名枚举 + HTTP 探测
octoscan scan -t example.com -s subfinder,httpx
# WordPress 漏洞扫描
octoscan scan -t https://example.com -s wpscan
# Nmap + 凭证暴力破解
octoscan scan -t 192.168.1.1 -s nmap,hydra
# 使用所有扫描器进行完整扫描
octoscan scan -t https://example.com -s nmap,nuclei,zap,feroxbuster,sqlmap,hydra -o report.json
# 自定义扫描器参数
octoscan scan -t https://example.com -s nmap,nuclei \
--scanner-args "nmap=--script vuln --top-ports 100" \
--scanner-args "nuclei=-tags cve -severity critical"
```
### 自定义扫描器参数
使用 `--scanner-args` 将额外标志传递给各个扫描器。格式为 `scanner=args`,并可重复使用:
```
--scanner-args "nmap=-sV --script=http-enum"
--scanner-args "nuclei=-tags cve,xss -t /path/to/templates"
--scanner-args "feroxbuster=-w /path/to/wordlist.txt -d 3"
--scanner-args "zap=-quickprogress"
```
自定义参数会**追加**到扫描器的默认标志之后。Shell 元字符(`;`、`|`、`&`、`` ` ``、`$` 等)会被拒绝,以防止命令注入。
在 **TUI 模式**下,选择扫描器后会出现扫描器参数输入界面。以 `scanner=args, scanner=args` 格式输入参数,或按 Enter 跳过。
### 扫描配置
内置配置允许您快速选择常见的扫描器组合:
| Profile | Scanners | Use case |
|---------|----------|----------|
| `quick` | Nmap | 快速端口扫描 |
| `web` | Nmap, Nuclei, Feroxbuster, ZAP | Web 应用审计 |
| `recon` | Subfinder, httpx, Nmap | 信息收集 |
| `full` | 所有 9 个扫描器 | 全面扫描 |
**CLI:** 使用 `--profile` 代替 `--scanners`:
```
octoscan scan -t https://example.com --profile web
```
**TUI:** 输入目标后,配置选择界面允许您选择内置配置,或选择“Custom”(自定义)来手动切换各个扫描器。
#### 用户自定义配置
在 `~/.config/octoscan/config.toml`(Linux/macOS)或 `%APPDATA%\octoscan\config.toml`(Windows)下创建配置文件:
```
[profiles.stealthy]
description = "Low-noise scan"
scanners = ["nmap", "subfinder"]
[profiles.wordpress]
description = "WordPress-focused audit"
scanners = ["nmap", "nuclei", "wpscan", "feroxbuster"]
```
用户配置会出现在内置配置旁,CLI(`--profile stealthy`)和 TUI 中均可用。如果用户配置与内置配置同名,则会覆盖内置配置。
## 项目结构
```
src/
├── main.rs # Entry point, CLI dispatch
├── cli.rs # Clap argument definitions
├── app.rs # Application state
├── profiles.rs # Scan profiles (built-in + user config)
├── tui.rs # Terminal event loop
├── ui.rs # Ratatui UI rendering
├── export.rs # JSON/TXT export
├── installer.rs # Auto-installation of missing tools
├── logger.rs # File-based logging
└── scanners/
├── mod.rs # Scanner trait & types
├── nmap.rs # Nmap integration
├── nuclei.rs # Nuclei integration
├── zap.rs # ZAP integration
├── feroxbuster.rs # Feroxbuster integration
├── subfinder.rs # Subfinder subdomain enumeration
├── httpx.rs # httpx HTTP probing & tech detection
├── wpscan.rs # WPScan WordPress vulnerability scanning
├── sqlmap.rs # SQLMap integration (conditional, post-scan)
└── hydra.rs # Hydra credential brute-force (conditional, post-Nmap)
```
## CI
GitHub Actions 在每次推送到 `main` 或提交 PR 时运行:
- **Lint** — `cargo fmt --check` + `cargo clippy -D warnings`
- **Audit** — `cargo audit` 用于检查依赖项漏洞
- **SAST** — Semgrep 静态分析并上传 SARIF
- **Test** — `cargo test` 以验证所有扫描器解析器和边缘情况
- **Build** — 在 Linux、Windows 和 macOS 上进行 Release 构建
## ⚠️ 法律免责声明
在未事先获得相互同意的情况下,使用 OctoScan 攻击目标是非法的。最终用户有责任遵守所有适用的地方法律、州法律和联邦法律。开发人员不承担任何责任,也不对本程序造成的任何滥用或损害负责。仅对您获得审计许可的目标使用它。
标签:CISA项目, Feroxbuster, GitHub, Google, GraphQL安全矩阵, httpx, Hydra, Nmap, Nuclei, OWASP ZAP, Rust, SQLMap, Web安全, WPScan, 交互式界面, 可视化界面, 子域名枚举, 安全扫描器, 密码管理, 对称加密, 数据统计, 用户模式钩子绕过, 端口扫描, 系统安全, 系统独立性, 网络流量审计, 自动化审计, 蓝队分析, 虚拟驱动器, 通知系统