rynmon/malScraper

GitHub: rynmon/malScraper

从多个公开威胁情报源自动抓取恶意域名、IOC 和 C2 IP,并导出为防火墙和 SIEM 可直接使用的黑名单格式。

Stars: 9 | Forks: 3

# malScraper v2.1.0 [![GitHub stars](https://img.shields.io/github/stars/rynmon/malScraper?style=flat-square&logo=github)](https://github.com/rynmon/malScraper/stargazers) [![GitHub forks](https://img.shields.io/github/forks/rynmon/malScraper?style=flat-square&logo=github)](https://github.com/rynmon/malScraper/network/members) [![GitHub issues](https://img.shields.io/github/issues/rynmon/malScraper?style=flat-square&logo=github)](https://github.com/rynmon/malScraper/issues) [![GitHub release](https://img.shields.io/github/v/release/rynmon/malScraper?style=flat-square&logo=github)](https://github.com/rynmon/malScraper/releases) [![GitHub license](https://img.shields.io/github/license/rynmon/malScraper?style=flat-square&logo=github)](https://github.com/rynmon/malScraper/blob/main/LICENSE) [![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) **跨平台工具,用于从各种源抓取恶意软件域名、IOCs 和 C2 IPs,以便轻松进行黑名单管理。** ## 快速开始 ### 下载预编译二进制文件 **Windows:** - 从 [Releases](https://github.com/rynmon/malScraper/releases) 下载 `malscraper-x86_64-pc-windows-msvc.exe` - 重命名为 `malscraper.exe` 并运行 **macOS:** - 从 [Releases](https://github.com/rynmon/malScraper/releases) 下载 `malscraper-x86_64-apple-darwin` 或 `malscraper-aarch64-apple-darwin` - 赋予执行权限:`chmod +x malscraper-*` - 运行:`./malscraper-*` **macOS (作为原生应用):** - 从 [Releases](https://github.com/rynmon/malScraper/releases) 下载 `malscraper-aarch64-apple-darwin.app.tar.gz` (Apple Silicon) 或 `malscraper-x86_64-apple-darwin.app.tar.gz` (Intel) - 解压:`tar xzf malscraper-*.app.tar.gz` - 将 `malScraper.app` 拖入 `/Applications` - 双击启动(将打开运行 malScraper 的终端窗口)。由于该应用未经过公证,首次启动可能会显示 Gatekeeper 警告 —— 右键点击 → 打开 即可绕过。 **Linux:** - 从 [Releases](https://github.com/rynmon/malScraper/releases) 下载 `malscraper-x86_64-unknown-linux-gnu` 或 `malscraper-aarch64-unknown-linux-gnu` - 赋予执行权限:`chmod +x malscraper-*` - 运行:`./malscraper-*` ### 从源码构建 **前置条件:** - [Rust 1.70+](https://rustup.rs/) - Visual Studio Build Tools (Windows) 或 GCC/Clang (Linux/macOS) **构建:** ``` cd rust cargo build --release ``` 编译后的二进制文件将位于 `rust/target/release/malscraper`(在 Windows 上为 `.exe`)。 **macOS — 为 Apple Silicon (ARM)、Intel 或通用架构构建:** 提供了一个辅助脚本用于明确指定目标架构: ``` cd rust ./build.sh # native build (ARM on Apple Silicon, Intel on x86_64 Macs) ./build.sh --arm # force aarch64-apple-darwin (Apple Silicon) ./build.sh --x86_64 # force x86_64-apple-darwin (Intel) ./build.sh --universal # universal binary (ARM + Intel via lipo) ``` 如果缺少指定的 rustup target,该脚本会自动安装。输出的二进制文件位于 `rust/target//release/malscraper`,而通用二进制文件位于 `rust/target/universal-apple-darwin/release/malscraper`。 你也可以直接调用 cargo: ``` rustup target add aarch64-apple-darwin cargo build --release --target aarch64-apple-darwin ``` **macOS — 构建 `.app` 包:** 要生成可双击运行的 `malScraper.app`(可通过 Finder/Launchpad/Spotlight 启动,会打开一个运行 TUI 的终端窗口): ``` cd rust ./build.sh --app # native architecture ./build.sh --app-arm # aarch64-apple-darwin ./build.sh --app-x86_64 # x86_64-apple-darwin ./build.sh --app-universal # universal (ARM + Intel) ``` 应用程序包将被写入 `rust/dist/malScraper.app`。构建脚本 会对其进行临时 (ad-hoc) 代码签名,使其可以在 Apple Silicon 上运行,但该包 **并未**经过公证 —— 首次从 Finder 启动时会显示“Apple 无法验证开发者…” 的提示,用户需要通过右键点击 → 打开 一次来解除限制。 安装方法: ``` cp -R rust/dist/malScraper.app /Applications/ ``` 要仅从已构建的二进制文件重新生成包: ``` ./scripts/bundle-macos.sh target/aarch64-apple-darwin/release/malscraper ``` 图标是根据 `rust/assets/icon.png`(rynmon.ie 品牌星号,深色圆角矩形背景,512×512 RGBA)生成的。 矢量源文件位于 `rust/assets/icon.svg`。要提升 Retina 屏幕的清晰度, 请将 1024×1024 的 RGBA PNG 格式图片放置在 `rust/assets/icon.png` 处并重新构建 — 打包工具 会优先使用 PNG,而不是旧版的 `icon.ico`。 ## 功能特性 ### 核心功能 - **高性能**:比 Python 版本快 3-5 倍 - **单一二进制文件**:无运行时依赖 - **跨平台**:支持 Windows、macOS 和 Linux - **Tab 补全**:内置命令补全(按 TAB 键) - **异步下载**:带进度条的快速并行下载 - **内存安全**:Rust 的所有权机制可防止常见 Bug - **自动更新**:通过 GitHub Releases 内置更新检查 ### v2.0.0 新特性 #### 分析与情报 - **统计仪表板** (`STATS`) - 查看所有报告的综合指标和分析数据 - **搜索与过滤** (`SEARCH`, `FILTER`) - 支持正则表达式的跨报告搜索 - **报告对比** (`COMPARE`) - 并排比较两份报告以查看差异 - **历史追踪** (`DIFF`, `CHANGES`) - 随时间追踪变化并识别新指标 #### 数据管理 - **去重** (`DEDUPE`, `UNIQUE`) - 移除所有报告中的重复项并创建统一的主列表 - **验证** (`VALIDATE`) - 验证 IP 地址和域名,检查域名是否仍然活跃 - **白名单管理** (`WHITELIST`) - 将误报加入白名单,并排除已知的良性指标 #### 导出与集成 - **导出格式** (`EXPORT`) - 导出为多种格式: - 防火墙规则:iptables、Windows Firewall、pfSense - SIEM 格式:JSON、带元数据的 CSV - 威胁情报:STIX/TAXII #### 自定义与自动化 - **自定义源** (`FEEDS`) - 添加、列出和移除你自己的自定义源 URL - **非交互模式** - 提供用于自动化和脚本编写的 CLI 参数 malscraper quick-scan --output-dir ./reports malscraper export iptables payload malscraper search malware.com - **自动更新** (`UPDATE`, `INSTALL`) - 自动下载并安装更新,支持平台检测 ## 使用方法 1. 运行工具: malscraper 2. 可用命令: **基本操作:** - `FULL` 或 `FULL-SCAN` - 扫描所有源的完整扫描 - `QUICK` 或 `QUICK-SCAN` - 快速扫描(最近的 100 个域名) - `OPEN` 或 `REOPEN` - 打开以前下载的报告 - `UPDATE` - 检查并安装更新 - `HELP` - 显示帮助菜单 - `TUTORIAL` - 显示教程 - `QUIT` 或 `EXIT` - 退出应用程序 **分析功能:** - `STATS` - 查看统计仪表板 - `SEARCH ` - 跨报告搜索特定术语 - `FILTER [feed_type] [pattern]` - 根据条件过滤报告 - `COMPARE ` - 比较两份报告 - `DIFF` 或 `CHANGES` - 将当前扫描与上次扫描进行比较 **数据管理:** - `DEDUPE` 或 `UNIQUE` - 将所有报告去重生成主列表 - `VALIDATE ` - 验证 IP 地址和域名 - `WHITELIST ADD [reason]` - 添加到白名单 - `WHITELIST LIST` - 列出所有白名单指标 - `WHITELIST REMOVE ` - 从白名单中移除 **导出与集成:** - `EXPORT ` - 导出为防火墙/SIEM 格式 - 格式:`iptables`、`windows`、`pfsense`、`json`、`csv`、`stix`、`taxii` - 报告:`payload`、`amp`、`c2`、`hex`、`haus`、`phish`、`top100` **自定义:** - `FEEDS ADD [name] [description]` - 添加自定义源 - `FEEDS LIST` - 列出所有自定义源 - `FEEDS REMOVE ` - 移除自定义源 3. 按 `TAB` 键可自动补全命令! ### 非交互模式 (CLI) 用于自动化和脚本编写,请使用 CLI 参数: ``` # 使用自定义输出目录进行快速扫描 malscraper quick-scan --output-dir ./reports # Full scan malscraper full-scan --output-dir ./reports # 导出为 iptables 格式 malscraper export iptables payload # 在报告中搜索 malscraper search malware.com # 查看统计数据 malscraper stats # 查看所有可用命令 malscraper --help ``` ## 文件存储位置 报告将保存至: - **Windows**: `%USERPROFILE%\Documents\malScraper\` - **macOS/Linux**: `~/Desktop/malScraper/` ## 杀毒软件警告 某些报告(尤其是 `PayloadReport.txt`)可能会被杀毒软件标记,因为它们包含已知的恶意软件指标。这些文件仅供研究和防御使用。 - 系统将提示您对 payload 报告进行混淆或压缩 - 建议将报告目录加入杀毒软件的排除列表 ## 从 Python/Bash 版本迁移 如果您之前使用的是 Python 或 Bash 版本: 1. 从 [Releases](https://github.com/rynmon/malScraper/releases) **下载 Rust 二进制文件** 2. **您现有的报告**仍将保存在相同的位置 3. **命令完全相同** —— 无需重新学习! 4. **性能更好** —— 下载和处理速度更快 ## 开发 ``` # Clone repository git clone https://github.com/rynmon/malScraper.git cd malScraper/rust # Build cargo build --release # 运行测试 cargo test # 格式化代码 cargo fmt # Lint cargo clippy ``` ## 性能对比 | 指标 | Python | Rust | |--------|--------|------| | 启动时间 | ~1-2s | <100ms | | 下载速度 | 基准 | 快 2-3 倍 | | 内存占用 | ~50-100MB | ~10-20MB | | 二进制体积 | N/A | ~5-10MB | | 依赖项 | Python + packages | 单一二进制文件 | ## 许可证 本项目基于 [MIT License](LICENSE) 授权。 **注意**:Python 和 Bash 版本已弃用。请使用 Rust 版本以获得最佳体验和持续支持。
标签:C2服务器, IOC指标, IP黑名单, PB级数据处理, Python开发替代, Rust, URL抓取, 二进制发布, 可视化界面, 命令与控制, 域名黑名单, 失陷标示, 威胁情报, 安全运维, 安全防护, 开发者工具, 开源工具, 恶意软件, 情报收集, 数字取证, 数据抓取, 漏洞研究, 网络安全, 网络流量审计, 自动化脚本, 通知系统, 隐私保护, 黑名单, 黑名单生成