ul0gic/corrode
GitHub: ul0gic/corrode
基于 Rust 和无头 Chromium 的被动式 Web 安全扫描器,通过深度分析前端代码和浏览器运行时来发现暴露的凭据、敏感信息及已知框架漏洞。
Stars: 4 | Forks: 1
# Corrode
**用于从 Web 应用程序中提取敏感信息、凭据和安全相关数据的被动侦察工具**
基于 Rust 和 chromiumoxide 构建,可实现快速的无头扫描。Corrode 仅执行被动分析——不进行任何主动利用或模糊测试。利用其输出结果来指导手动渗透测试和安全评估。
[](https://github.com/ul0gic/corrode/actions/workflows/ci.yml)
[](https://crates.io/crates/corrode-scanner)
[](https://crates.io/crates/corrode-scanner)
[](https://www.rust-lang.org/)
[](LICENSE)
## 项目结构
```
src/
├── api/ # API endpoint discovery (passive extraction from JS)
├── cli.rs # CLI definitions
├── config.rs # Config normalization and config file loading
├── detectors/
│ ├── collectors/ # Page data extraction
│ │ ├── ast.rs # SWC-based JavaScript AST analysis
│ │ ├── dom.rs # DOM analysis: forms, hidden inputs, cookies, storage
│ │ └── javascript.rs # Script extraction, window objects, version extraction
│ ├── secrets/ # Credential detection engine
│ │ ├── jwt.rs # JWT decoding and role classification
│ │ └── patterns/ # 45+ categorized regex patterns (auth, cloud, ai,
│ │ # payment, communication, monitoring, collaboration,
│ │ # vcs, database, infrastructure)
│ ├── security/ # Security analysis
│ │ └── mod.rs # Cookie, header, CORS, mixed content checks
│ ├── technologies/ # Technology fingerprinting (4 signal sources)
│ │ ├── headers.rs # HTTP response header signatures
│ │ ├── meta.rs # HTML meta tag generators
│ │ ├── runtime.rs # Window object detection
│ │ └── scripts.rs # Script URLs + network request patterns
│ └── vulnerabilities/ # Per-framework CVE detection
│ ├── nextjs.rs # 5 Next.js CVEs
│ └── react.rs # 4 React Server Components CVEs
├── network/ # Network monitor
├── reporting/
│ └── markdown/ # Section-based Markdown report: summary, findings,
│ # security, network, technologies, appendix
├── scanner/
│ ├── chrome.rs # Chrome binary resolution
│ └── workflow.rs # Browser orchestration and scan workflow
├── types.rs # Shared data structures
└── main.rs # Entry point
fixtures/ # Static fixture pages for local testing
corrode-output/ # Default output directory (per scan)
examples/ # Example configuration files
```
## 架构
```
graph TD
A[URL / URL File] --> B[Headless Chrome/Chromium]
B --> C[Network Monitor]
B --> D[DOM/Storage Extractor]
B --> E[Script + AST Scanner]
E --> G[Secret Scanner]
D --> H[Tech Fingerprinter]
C --> I[Security Analysis]
E --> J[CVE Detector]
G --> Results[Reporting JSON + MD]
C --> Results
D --> Results
H --> Results
I --> Results
J --> Results
classDef purple fill:#e9d5ff,stroke:#7c3aed,stroke-width:2px,color:#000
class A,B,C,D,E,F,G,H,I,J,Results purple
```
## 功能特性
### 核心扫描能力
- **快速无头扫描** - 优化的 Chromium 工作流,实现低延迟扫描
- **深度分析** - 提取并扫描 HTML、JavaScript 打包文件、内联脚本和外部资源
- **网络监控** - 跟踪所有 HTTP 请求、API 调用和第三方域
- **模式匹配** - 跨 10 个服务类别检测 45 种以上类型的敏感信息和凭据
- **全面报告** - 为每个站点生成 JSON 结果和详细的 Markdown 报告
- **多 URL 批量扫描** - 使用 `--file targets.txt` 从文件中扫描一系列目标
- **配置文件支持** - 通过 `.corrode.toml` 进行持久化设置和自定义模式
### 高级分析
- **API Endpoint 发现** - 从 JavaScript 中提取 API endpoint 用于手动测试
- **CVE 检测** - 通过版本指纹检测 React 和 Next.js 漏洞(9 个 CVE)
- **技术栈检测** - 跨运行时、标头、meta 标签和网络 URL 识别 60 多种框架、服务器和服务
- **版本提取** - 提取 React 和 Next.js 版本以进行 CVE 关联
- **DOM 分析** - 分析表单、隐藏输入、iframe、meta 标签和数据属性
- **Cookie 安全分析** - 检查不安全的 Cookie 配置
- **Window 对象检查** - 从 17 个 window 全局变量中提取敏感数据(`__NEXT_DATA__`、`__APOLLO_STATE__`、`__remixContext` 等)
- **环境变量检测** - 标记暴露的 `REACT_APP_*`、`NEXT_PUBLIC_*` 和 `VITE_*` 变量
- **Debug 模式检测** - 识别生产环境中的 React 开发构建、Vue devtools 和 HMR 信号
- **Source Map 检测** - 通过标头、注释和 CSS 识别暴露的 source map
## 安装
### 通过 Cargo 安装
```
cargo install corrode-scanner
```
本地开发(从源码):
```
git clone https://github.com/ul0gic/corrode.git
cd corrode
cargo build --release
./target/release/corrode-scanner --url https://example.com
```
### 系统要求
| 要求 | 详情 |
| -------------------- | ------------------------------------------ |
| Rust | 1.70+(通过 [rustup.rs](https://rustup.rs) 安装)|
| Chrome/Chromium | 无头扫描所需(见下文) |
| 操作系统 | Linux/macOS |
#### 安装 Chrome/Chromium
**Linux (Debian/Ubuntu):**
```
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt update && sudo apt install -y google-chrome-stable
```
**macOS:**
```
brew install --cask google-chrome
```
Chrome 会通过 PATH 和常见安装位置自动检测。如有需要,可使用 `--chrome-bin ` 或 `CHROME_BIN` 环境变量进行覆盖。
## 使用方法
### 命令行选项
| 标志 / 选项 | 描述 | 默认值 | 必选 |
| ---------------------- | ---------------------------------------------------------------- | ---------------- | -------- |
| `--url ` | 要扫描的目标 URL | – | --url 或 --file 二选一 |
| `--file ` | 包含要扫描的 URL 的文件(每行一个,允许 `#` 注释) | – | --url 或 --file 二选一 |
| `-o, --output ` | 输出目录(`
标签:chromiumoxide, GraphQL安全矩阵, JWT解码, Rust, StruQ, Web安全, 凭证提取, 反取证, 可视化界面, 安全工具库, 安全扫描器, 安全评估, 实时处理, 开源安全工具, 数据泄露, 无头浏览器, 网络安全, 网络流量审计, 蓝队分析, 被动侦察, 逆向工程平台, 通知系统, 隐私保护