vtino17/pcap-forensics

GitHub: vtino17/pcap-forensics

命令行 PCAP 网络流量取证工具,帮助安全人员在无 SIEM 环境下从抓包文件中快速提取关键指标并检测可疑行为。

Stars: 0 | Forks: 0

# PCAP 取证 [![License](https://img.shields.io/badge/License-MIT-22AA55?style=flat-square)](LICENSE) [![Stars](https://img.shields.io/github/stars/vtino17/pcap-forensics?style=flat-square)](https://github.com/vtino17/pcap-forensics/stargazers) [![Python](https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square)](https://python.org) [![Last Commit](https://img.shields.io/github/last-commit/vtino17/pcap-forensics?style=flat-square)](https://github.com/vtino17/pcap-forensics/commits) 用于网络数据包抓取的命令行取证分析工具。专为需要在没有完整 SIEM pipeline 的情况下,快速从 PCAP 文件中提取指标的应急响应人员和安全分析师设计。 ## 功能 带有源/目标归属的 DNS 查询提取 HTTP 请求重建,包括方法、URI 和 Host 头 带有 Server Name Indication (SNI) 提取的 TLS 握手检测 基于出站流量和端口多样性的 Beaconing 检测 多格式报告(JSON、CSV) ## 安装 ``` pip install scapy git clone https://github.com/vtino17/pcap-forensics.git cd pcap-forensics pip install . ``` ## 用法 ``` # 基础分析 pcap-forensics capture.pcap # 包含详细输出的 JSON 报告 pcap-forensics capture.pcap --report json --output report.json --verbose # CSV 报告 pcap-forensics capture.pcap --report csv --output report.csv ``` ## 输出 JSON 报告结构: ``` { "summary": { "total_packets": 15000, "protocols": { "TCP": 12000, "UDP": 2500, "OTHER": 500 }, "dns_queries": 340, "http_requests": 89, "tls_handshakes": 45, "beacon_candidates": 2 }, "dns_queries": [ { "query": "evil.example.com", "type": 1, "src": "10.0.0.5", "dst": "8.8.8.8" } ], "http_requests": [ { "request": "GET /admin", "host": "target.com", "src": "10.0.0.5", "dst": "203.0.113.10" } ], "beacon_candidates": [ { "ip": "10.0.0.5", "total_tx_bytes": 450000, "unique_ports": [80, 443, 8080], "reason": "High outbound volume on multiple ports" } ] } ``` ## 测试 ``` pip install pytest pytest tests/ ``` ## 许可证 MIT
标签:IP 地址批量处理, Python, Scapy, 安全规则引擎, 库, 应急响应, 无后门, 逆向工具