PCAP分析MCP
POC项目 -用于网络取证的概念验证MCP服务器。为解决我需要的问题而构建,如果有用,可以分享。无需主动支持或维护-随意使用。
 
网络取证MCP(模型上下文协议)服务器为AI代理提供数据包捕获分析功能。
它做什么
- 50+分析工具 跨越8个类别
- 攻击检测 -CVE模式、端口扫描、网络漏洞利用
- 时间线重建 -网络杀伤链和MITRE ATT&CK映射
- IoC提取 -IP,具有可选丰富功能的域名
- 协议分析 -HTTP、DNS、SMB、FTP、SSH、RDP、SMTP、TLS
- C2检测 -反向炮弹、信标、数据泄露
- HTML报告 -调查报告
安装
git clone https://github.com/0xhackerfren/Pcap-Analysis-MCP.git
cd pcap-analysis-mcp
pip install -e .
# With all optional deps
pip install -e ".[full]"需求
- Python 3.9+
- scapy>=2.5.0(必填)
- pandas,jinja2,请求(可选)
用法
作为MCP服务器
添加到MCP配置中:
{
"mcpServers": {
"pcap-analysis": {
"command": "python",
"args": ["-m", "pcap_analysis_mcp"],
"transport": "stdio"
}
}
}命令行
# Run as MCP server
python -m pcap_analysis_mcp --server
# Analyze a PCAP file directly
python -m pcap_analysis_mcp --analyze capture.pcap --output report.html
# Check installation
python -m pcap_analysis_mcp --checkPython API
from pcap_analysis_mcp import PCAPAnalysisMCP
mcp = PCAPAnalysisMCP()
mcp.load_pcap("capture.pcap")
# Get summary
print(mcp.get_summary())
# Detect attacks
exploits = mcp.detect_web_exploits()
scans = mcp.detect_port_scan()
# Build timeline
timeline = mcp.build_attack_timeline()
# Generate report
mcp.generate_html_report("report.html")工具
核心分析(10个工具)
load_pcap, get_summary, get_conversations, get_protocols, get_statistics, filter_packets, export_packets, get_packet_details, search_payload, get_unique_values
侦察(8个工具)
detect_port_scan, get_open_ports, detect_host_discovery, detect_service_scan, get_first_responder, analyze_scan_pattern, identify_scanner, get_scan_summary
HTTP/Web(10个工具)
extract_http_requests, extract_http_responses, get_http_sessions, detect_web_exploits, extract_post_payloads, extract_server_info, find_file_transfers, detect_webshells, get_user_agents, analyze_http_timeline
攻击时间线(6个工具)
build_attack_timeline, identify_attack_phases, find_initial_access, find_initial_foothold, detect_lateral_movement, map_to_mitre
C2检测(6个工具)
detect_reverse_shells, analyze_shell_traffic, detect_c2_beacons, detect_data_exfil, identify_c2_channels, extract_shell_commands
IoC扩展(8个工具)
extract_all_iocs, enrich_ip, check_virustotal, check_abuseipdb, check_otx, defang_iocs, export_iocs_stix, get_threat_context
协议分析(7个工具)
analyze_dns, analyze_smb, analyze_ftp, analyze_ssh, analyze_rdp, analyze_smtp, analyze_tls
报告(5个工具)
generate_html_report, generate_executive_summary, generate_timeline_html, generate_ioc_report, export_findings_json
检测模式
包括以下模式:
- CVE-2024-4577(PHP CGI)、CVE-2021-44228(Log4Shell)、CVE-20214-1773(Apache)
- SQL注入、XSS、命令注入、路径遍历
- Webshells、SSRF、XXE、LFI、反序列化
- 反向shell(bash、netcat、python、powershell)
- C2信标和隧道
项目结构
pcap-analysis-mcp/
src/pcap_analysis_mcp/ # Main package
data/ # Detection patterns (JSON)
templates/ # HTML report templates
examples/ # Usage examples许可证
麻省理工学院-随心所欲。
免责声明
这是一个POC项目。没有担保,没有支持,没有保证。适用于我的用例,也可能适用于你的用例。
