Ananyacodes/Security-Operations-Network-Analysis-Response

GitHub: Ananyacodes/Security-Operations-Network-Analysis-Response

SONAR 是一款结合 Python 与 Rust 的开源数字取证工具包,为安全调查人员提供隐写检测、Deepfake 分析、密码学检查和恶意软件沙箱测试等一站式取证分析能力。

Stars: 0 | Forks: 0

# SONAR - Digital Forensics & Security Analysis Toolkit
![SONAR Logo](https://img.shields.io/badge/SONAR-Forensics-2563eb?style=for-the-badge&logo=shield&logoColor=white) [![Python](https://img.shields.io/badge/Python-3.8+-3776AB?logo=python&logoColor=white)](https://python.org) [![Rust](https://img.shields.io/badge/Rust-1.70+-orange?logo=rust&logoColor=white)](https://rust-lang.org) [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker&logoColor=white)](https://docker.com) [![License](https://img.shields.io/badge/License-MIT-green)](LICENSE) [![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen)](tests/) **面向网络安全专业人员、调查人员和研究员的专业级数字取证工具包** [快速开始](#quick-start) • [文档](#documentation) • [功能](#features) • [Docker](#docker-deployment) • [示例](#examples)
## 概述 **SONAR**(Security Operations Network Analysis & Response)是一款功能强大的开源数字取证工具包,结合了 Python 的易用性与 Rust 的高性能。SONAR 专为真实的网络安全调查而设计,提供企业级的分析能力,用于检测隐藏威胁、分析可疑文件以及挖掘数字证据。 ### 为什么选择 SONAR? - **经过实战检验的算法** - 实现了源自学术研究的成熟取证技术 - **混合性能** - Python 的易用性 + Rust 的速度(快 10-100 倍) - **Docker 支持** - 通过容器化实现零烦恼部署 - **生产就绪** - 内存安全、可靠,可处理 TB 级规模的文件 - **多格式报告** - 支持 JSON、HTML 和 PDF 输出,适配任何工作流 - **开源** - MIT 许可证,社区驱动开发 # 演示 https://github.com/user-attachments/assets/33c86d0e-e7f0-4e7b-9eb5-997cd81cb970 # 创建虚拟环境 # 安装 ### 目录结构 docker-compose run -e SONAR_LOG_LEVEL=DEBUG sonar analyze /evidence/file.jpg sonar-forensics:latest analyze /evidence/file.jpg ## 命令行界面 sonar analyze ./evidence_folder/ --output ./my_reports/ ### 高级选项 # 详细调试输出 ### 代码质量工具 # SONAR — 数字取证与安全分析工具包 ![SONAR](https://img.shields.io/badge/SONAR-Forensics-2563eb?style=for-the-badge&logo=shield&logoColor=white) SONAR (Security Operations Network Analysis & Response) 是一款开源数字取证工具包,结合了 Python 的易用性与 Rust 的高性能。SONAR 可帮助调查人员检测隐藏威胁、分析可疑文件,并生成用于自动化流程或人工审查的专业报告。 -- 目录 - 概述 - 为什么开发 SONAR? - 功能 - 快速开始 - Docker 部署 - CLI 与 API - 架构 - 测试 - 开发与贡献 - 许可证与法律声明 -- ## 概述 SONAR 为隐写术检测、deepfake 分析、网络取证和密码学检查提供了统一的接口。该项目专为真实的调查场景以及 SOC(安全运营中心)和事件响应工作流中的自动化而设计。 ## 为什么开发 SONAR? - **问题所在**:取证工具通常是碎片化的、昂贵的,或者难以自动化。 - **解决方案**:SONAR 提供了一个单一、可扩展的工具包,包含 Python CLI/API,以及用于性能关键模块的可选 Rust 引擎。 优势: - 统一的 CLI 和 Python API,便于集成与自动化。 - 由 Rust 驱动的引擎,用于 DSP、crypto 和大文件处理。 - 面向 CI/CD 的 JSON 输出;面向调查人员和报告的 HTML/PDF 输出。 - 模块化架构 —— 按需安装。 ## 目标用户 - 事件响应人员和 SOC 团队 - 数字取证调查员 - 安全研究员和教育工作者 - 将取证集成到 pipeline 中的自动化工程师 ## 功能 - 隐写术检测:LSB 分析、直方图异常、熵检查、多格式支持。 - Deepfake 检测:多模型集成、面部/时间不一致性检查、置信度评分。 - 数字取证:文件 artifact 提取、时间线重建、magic-byte 识别、哈希计算。 - 密码学分析:算法检测、熵/密钥强度估计、漏洞提示。 - 元数据提取:EXIF、文档属性、音频/视频元数据、隐藏数据发现。 - 信号处理:频域分析、统计异常检测、Rust 中的 SIMD 优化。 ## 快速开始(摘要) 前置条件:Docker(推荐)或 Python 3.8+ 和 Rust 1.70+(用于源码构建)。 1. Docker(推荐 —— 最快) ``` git clone https://github.com/Ananyacodes/Security-Operations-Network-Analysis-Response.git cd Security-Operations-Network-Analysis-Response docker-compose build docker-compose run --rm sonar analyze /evidence/suspicious_file.jpg --format json ``` 2. pip install(简单) ``` git clone https://github.com/Ananyacodes/Security-Operations-Network-Analysis-Response.git cd Security-Operations-Network-Analysis-Response pip install -e . sonar analyze suspicious_file.jpg --format html ``` 3. 完整构建(开发 + 最高性能) ``` python -m venv venv venv\Scripts\activate pip install -r requirements.txt cd engine_rust && cargo build --release && cd .. pip install -e . ``` ## Docker 部署(摘要) - 构建并分析: ``` docker-compose build docker-compose run --rm sonar analyze /evidence/ --output /app/reports --format json ``` - 进阶:在 `docker-compose` 中设置 `--memory` / `--cpus`,或传入 `-e SONAR_LOG_LEVEL=DEBUG` 以调试模式运行。 ## 命令行界面(摘要) - 分析文件或目录:`sonar analyze ` - 模式:`--mode stego|deepfake|full` - 输出格式:`--format json|html|pdf` - 批量处理:提供目录路径并配合 `--output` 来收集报告。 - 常用标志:`--verbose`、`--threshold `、`--output ` 示例: ``` sonar analyze evidence/image.png --mode stego --format html sonar analyze evidence/ --mode full --format json --output reports/ ``` ## Python API(摘要) 示例:隐写术检测 ``` from core_python import SteganographyDetector det = SteganographyDetector() res = det.analyze('image.png') print(res['confidence_score']) ``` Rust 引擎使用(如果可用): ``` from bindings import rust_engine if rust_engine.initialized: # high-performance analysis pass ``` ## 架构 - Python 核心:CLI、编排、报告模板 - Rust 引擎:DSP、crypto、取证原语(通过 bindings 暴露) - Bindings:连接 Python 与 Rust 实现的 PyO3 桥 - 输出:JSON(自动化)、HTML(交互式)、PDF(打印/法律用途) 项目结构(高层概览): ``` core_python/ # CLI and Python detectors bindings/ # PyO3 bindings and stubs engine_rust/ # Rust modules (crypto, dsp, forensics) tests/ # unit and integration tests ``` ## 置信度评分 — 解释 - 0.0–0.3:低可疑度 —— 文件可能是干净的 - 0.3–0.6:中等可疑度 —— 需进一步调查 - 0.6–0.85:高可疑度 —— 很可能包含隐藏数据 - 0.85–1.0:极高可疑度 —— 极可能已被篡改/感染 常见指标:高熵、LSB 变化、元数据异常、统计或直方图不规则。 ## 报告格式 - JSON:机器可读,适配 CI/CD - HTML:人类可读,包含图表和可视化 - PDF:适合打印,适用于文档记录和法律用途 ## 测试 在本地或 Docker 内运行测试: ``` pytest pytest --cov=core_python --cov=bindings --cov-report=html docker-compose run --rm sonar pytest ``` ## 开发 1. 创建 virtualenv 并安装开发依赖:`pip install -e .[dev]` 2. 构建 Rust:`cd engine_rust && cargo build --release` 3. 格式化与 lint:`black . && cargo fmt && flake8 && cargo clippy` 4. 为新功能添加测试并运行 `pytest`。 贡献:请参阅 `CONTRIBUTING.md` —— fork、创建功能分支、添加测试、提交 PR。 ## 示例 - 检测图像中的隐藏数据:`sonar analyze photo.png --mode stego --format html` - 验证视频真实性:`sonar analyze interview.mp4 --mode deepfake --format json` - 批量处理证据:`sonar analyze /evidence/ --output reports/ --format json` ## 许可证 MIT。详情请参阅 `LICENSE`。 ## 法律与安全 法律声明:仅供合法的取证、研究和教育使用。用户必须遵守适用法律。 安全:请按照 `SECURITY.md` 报告漏洞。 由 SONAR 团队构建 —— 用分析工具赋能数字取证专业人员。
标签:Python, Rust, 可视化界面, 域环境安全, 密码分析, 恶意软件沙箱, 数字取证, 无后门, 网络流量审计, 自动化脚本, 请求拦截, 逆向工具, 隐写术检测