iflow-mcp_developermode-korea_reversecore-mcp 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/LICENSE +21 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/PKG-INFO +543 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/README.md +503 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/PKG-INFO +543 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/SOURCES.txt +82 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/dependency_links.txt +1 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/entry_points.txt +2 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/requires.txt +35 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/iflow_mcp_developermode_korea_reversecore_mcp.egg-info/top_level.txt +1 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/pyproject.toml +136 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/__init__.py +9 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/__init__.py +78 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/audit.py +101 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/binary_cache.py +138 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/command_spec.py +357 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/config.py +432 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/container.py +288 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/decorators.py +152 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/error_formatting.py +93 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/error_handling.py +142 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/evidence.py +229 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/exceptions.py +296 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/execution.py +240 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/ghidra.py +642 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/ghidra_helper.py +481 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/ghidra_manager.py +234 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/json_utils.py +131 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/loader.py +73 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/logging_config.py +206 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/memory.py +721 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/metrics.py +198 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/mitre_mapper.py +365 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/plugin.py +45 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/r2_helpers.py +404 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/r2_pool.py +403 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/report_generator.py +268 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/resilience.py +252 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/resource_manager.py +169 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/result.py +132 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/security.py +213 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/core/validators.py +238 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/dashboard/__init__.py +221 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/__init__.py +56 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/common.py +24 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/game.py +280 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/malware.py +1219 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/report.py +150 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/prompts/security.py +136 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/resources.py +329 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/server.py +727 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/__init__.py +49 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/__init__.py +74 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/capa_tools.py +215 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/die_tools.py +180 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/diff_tools.py +643 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/lief_tools.py +272 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/signature_tools.py +591 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/analysis/static_analysis.py +479 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/common/__init__.py +58 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/common/file_operations.py +352 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/common/memory_tools.py +516 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/common/patch_explainer.py +230 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/common/server_tools.py +115 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/ghidra/__init__.py +19 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/ghidra/decompilation.py +975 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/ghidra/ghidra_tools.py +1052 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/__init__.py +61 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/adaptive_vaccine.py +579 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/dormant_detector.py +756 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/ioc_tools.py +228 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/vulnerability_hunter.py +519 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/malware/yara_tools.py +214 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/patch_explainer.py +19 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/radare2/__init__.py +13 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/radare2/r2_analysis.py +972 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/radare2/r2_session.py +376 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/radare2/radare2_mcp_tools.py +1183 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report/__init__.py +4 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report/email.py +82 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report/report_mcp_tools.py +344 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report/report_tools.py +1076 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report/session.py +194 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/reversecore_mcp/tools/report_tools.py +11 -0
- iflow_mcp_developermode_korea_reversecore_mcp-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 sjkim1127
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp_developermode-korea_reversecore-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP Server for Reverse Engineering with Binary Analysis Tools
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: mcp[cli]>=1.0.0
|
|
10
|
+
Requires-Dist: fastmcp
|
|
11
|
+
Requires-Dist: fastapi
|
|
12
|
+
Requires-Dist: uvicorn
|
|
13
|
+
Requires-Dist: python-multipart
|
|
14
|
+
Requires-Dist: aiofiles
|
|
15
|
+
Requires-Dist: pydantic>=2.0
|
|
16
|
+
Requires-Dist: loguru
|
|
17
|
+
Requires-Dist: orjson
|
|
18
|
+
Provides-Extra: analysis
|
|
19
|
+
Requires-Dist: pefile; extra == "analysis"
|
|
20
|
+
Requires-Dist: lief; extra == "analysis"
|
|
21
|
+
Requires-Dist: capstone; extra == "analysis"
|
|
22
|
+
Requires-Dist: keystone-engine; extra == "analysis"
|
|
23
|
+
Requires-Dist: yara-python; extra == "analysis"
|
|
24
|
+
Requires-Dist: r2pipe>=1.7.0; extra == "analysis"
|
|
25
|
+
Provides-Extra: viz
|
|
26
|
+
Requires-Dist: graphviz; extra == "viz"
|
|
27
|
+
Requires-Dist: networkx; extra == "viz"
|
|
28
|
+
Requires-Dist: matplotlib; extra == "viz"
|
|
29
|
+
Provides-Extra: ghidra
|
|
30
|
+
Requires-Dist: pyghidra<4.0.0,>=2.0.0; extra == "ghidra"
|
|
31
|
+
Requires-Dist: jpype1>=1.4.0; extra == "ghidra"
|
|
32
|
+
Provides-Extra: cli
|
|
33
|
+
Requires-Dist: psutil; extra == "cli"
|
|
34
|
+
Requires-Dist: requests; extra == "cli"
|
|
35
|
+
Requires-Dist: typer; extra == "cli"
|
|
36
|
+
Requires-Dist: rich; extra == "cli"
|
|
37
|
+
Provides-Extra: full
|
|
38
|
+
Requires-Dist: iflow-mcp_developermode-korea_reversecore-mcp[analysis,cli,ghidra,viz]; extra == "full"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# Reversecore_MCP
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
[](https://opensource.org/licenses/MIT)
|
|
46
|
+
[](https://www.python.org/downloads/)
|
|
47
|
+
[](https://github.com/jlowin/fastmcp)
|
|
48
|
+
[](https://www.docker.com/)
|
|
49
|
+
[](tests/)
|
|
50
|
+
[](htmlcov/)
|
|
51
|
+
|
|
52
|
+
[](https://youtu.be/wJGW2bp3c5A)
|
|
53
|
+
|
|
54
|
+
[🇰🇷 한국어 (Korean)](README_KR.md)
|
|
55
|
+
|
|
56
|
+
An enterprise-grade MCP (Model Context Protocol) server for AI-powered reverse engineering. Enables AI agents to perform comprehensive binary analysis through natural language commands.
|
|
57
|
+
|
|
58
|
+
## 📋 Prerequisites
|
|
59
|
+
|
|
60
|
+
### Ghidra (Required for Decompilation)
|
|
61
|
+
|
|
62
|
+
Ghidra is required for advanced decompilation features. The installation scripts automatically install Ghidra to `<project>/Tools` directory.
|
|
63
|
+
|
|
64
|
+
**Option 1: Automatic Installation (Recommended)**
|
|
65
|
+
|
|
66
|
+
```powershell
|
|
67
|
+
# Windows (PowerShell)
|
|
68
|
+
.\scripts\install-ghidra.ps1
|
|
69
|
+
|
|
70
|
+
# With custom version/path (optional)
|
|
71
|
+
.\scripts\install-ghidra.ps1 -Version "11.4.3" -InstallDir "C:\CustomPath"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Linux/macOS
|
|
76
|
+
chmod +x ./scripts/install-ghidra.sh
|
|
77
|
+
./scripts/install-ghidra.sh
|
|
78
|
+
|
|
79
|
+
# With custom version/path (optional)
|
|
80
|
+
./scripts/install-ghidra.sh -v 11.4.3 -d /custom/path
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**What the scripts do:**
|
|
84
|
+
- Downloads Ghidra 11.4.3 from GitHub (~400MB)
|
|
85
|
+
- Extracts to `<project>/Tools/ghidra_11.4.3_PUBLIC_YYYYMMDD`
|
|
86
|
+
- Sets `GHIDRA_INSTALL_DIR` environment variable
|
|
87
|
+
- Updates project `.env` file
|
|
88
|
+
|
|
89
|
+
**Option 2: Manual Installation**
|
|
90
|
+
|
|
91
|
+
1. **Download**: [Ghidra 11.4.3](https://github.com/NationalSecurityAgency/ghidra/releases/tag/Ghidra_11.4.3_build)
|
|
92
|
+
2. **Extract** to `<project>/Tools/` or any directory
|
|
93
|
+
3. **Set environment variable**:
|
|
94
|
+
```bash
|
|
95
|
+
# Linux/macOS (~/.bashrc or ~/.zshrc)
|
|
96
|
+
export GHIDRA_INSTALL_DIR=/path/to/ghidra_11.4.3_PUBLIC_YYYYMMDD
|
|
97
|
+
|
|
98
|
+
# Windows (PowerShell - permanent)
|
|
99
|
+
[Environment]::SetEnvironmentVariable("GHIDRA_INSTALL_DIR", "C:\path\to\ghidra", "User")
|
|
100
|
+
```
|
|
101
|
+
Or add to `.env` file (copy from `.env.example`)
|
|
102
|
+
|
|
103
|
+
> ⚠️ **Note**: JDK 17+ is required for Ghidra. Download from [Adoptium](https://adoptium.net/) if needed.
|
|
104
|
+
|
|
105
|
+
## 🚀 Quick Start
|
|
106
|
+
|
|
107
|
+
### Docker (Recommended)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Auto-detect architecture (Intel/AMD or Apple Silicon)
|
|
111
|
+
./scripts/run-docker.sh
|
|
112
|
+
|
|
113
|
+
# Or manually:
|
|
114
|
+
# Intel/AMD
|
|
115
|
+
docker compose --profile x86 up -d
|
|
116
|
+
|
|
117
|
+
# Apple Silicon (M1/M2/M3/M4)
|
|
118
|
+
docker compose --profile arm64 up -d
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### MCP Client Configuration (Cursor AI)
|
|
122
|
+
|
|
123
|
+
**Step 1: Build Docker Image**
|
|
124
|
+
|
|
125
|
+
The unified Dockerfile automatically detects your system architecture:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Automatic architecture detection (works for all platforms)
|
|
129
|
+
docker build -t reversecore-mcp:latest .
|
|
130
|
+
|
|
131
|
+
# Or use the convenience script
|
|
132
|
+
./scripts/run-docker.sh
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Step 2: Configure MCP Client**
|
|
136
|
+
|
|
137
|
+
Add to `~/.cursor/mcp.json`:
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary>🍎 <b>macOS (All Processors)</b></summary>
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"reversecore": {
|
|
146
|
+
"command": "docker",
|
|
147
|
+
"args": [
|
|
148
|
+
"run", "-i", "--rm",
|
|
149
|
+
"-v", "/Users/YOUR_USERNAME/Reversecore_Workspace:/app/workspace",
|
|
150
|
+
"-e", "REVERSECORE_WORKSPACE=/app/workspace",
|
|
151
|
+
"-e", "MCP_TRANSPORT=stdio",
|
|
152
|
+
"reversecore-mcp:latest"
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
<details>
|
|
161
|
+
<summary>🐧 <b>Linux</b></summary>
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"reversecore": {
|
|
167
|
+
"command": "docker",
|
|
168
|
+
"args": [
|
|
169
|
+
"run", "-i", "--rm",
|
|
170
|
+
"-v", "/path/to/workspace:/app/workspace",
|
|
171
|
+
"-e", "REVERSECORE_WORKSPACE=/app/workspace",
|
|
172
|
+
"-e", "MCP_TRANSPORT=stdio",
|
|
173
|
+
"reversecore-mcp:latest"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary>🪟 <b>Windows</b></summary>
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"mcpServers": {
|
|
187
|
+
"reversecore": {
|
|
188
|
+
"command": "docker",
|
|
189
|
+
"args": [
|
|
190
|
+
"run", "-i", "--rm",
|
|
191
|
+
"-v", "C:/Reversecore_Workspace:/app/workspace",
|
|
192
|
+
"-e", "REVERSECORE_WORKSPACE=/app/workspace",
|
|
193
|
+
"-e", "MCP_TRANSPORT=stdio",
|
|
194
|
+
"reversecore-mcp:latest"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
</details>
|
|
201
|
+
|
|
202
|
+
> ⚠️ **IMPORTANT: File Path Usage in Docker**
|
|
203
|
+
>
|
|
204
|
+
> The MCP server runs inside a Docker container. When using analysis tools, **use only the filename, not the full local path**.
|
|
205
|
+
>
|
|
206
|
+
> | ❌ Wrong | ✅ Correct |
|
|
207
|
+
> |----------|-----------|
|
|
208
|
+
> | `run_file("/Users/john/Reversecore_Workspace/sample.exe")` | `run_file("sample.exe")` |
|
|
209
|
+
>
|
|
210
|
+
> **Why?** Your local path (e.g., `/Users/.../Reversecore_Workspace/`) is mounted to `/app/workspace/` inside the container. Tools automatically look for files in the workspace directory.
|
|
211
|
+
>
|
|
212
|
+
> **Tip:** Use `list_workspace()` to see all available files in your workspace.
|
|
213
|
+
|
|
214
|
+
## ✨ Key Features
|
|
215
|
+
|
|
216
|
+
### 🔍 Static Analysis
|
|
217
|
+
|
|
218
|
+
Comprehensive file analysis and metadata extraction:
|
|
219
|
+
|
|
220
|
+
- **File Type Detection**: Identify binary format, architecture, and compiler information (`run_file`)
|
|
221
|
+
- **String Extraction**: Extract ASCII/Unicode strings with configurable limits (`run_strings`)
|
|
222
|
+
- **Firmware Analysis**: Deep scan for embedded files and signatures (`run_binwalk`)
|
|
223
|
+
- **Binary Parsing**: Parse PE/ELF/Mach-O headers and sections with LIEF (`parse_binary_with_lief`)
|
|
224
|
+
|
|
225
|
+
### ⚙️ Disassembly & Decompilation
|
|
226
|
+
|
|
227
|
+
Multi-architecture binary analysis with intelligent tooling:
|
|
228
|
+
|
|
229
|
+
- **Radare2 Integration**: Full r2 command access with connection pooling (`run_radare2`, `Radare2_disassemble`)
|
|
230
|
+
- **Ghidra Decompilation**: Enterprise-grade decompilation with 16GB JVM heap (`smart_decompile`, `get_pseudo_code`)
|
|
231
|
+
- **Multi-Architecture Support**: x86, x86-64, ARM, ARM64, MIPS, PowerPC via Capstone (`disassemble_with_capstone`)
|
|
232
|
+
- **Smart Fallback**: Automatic Ghidra-first, r2-fallback strategy for best results
|
|
233
|
+
|
|
234
|
+
### 🧬 Advanced Analysis
|
|
235
|
+
|
|
236
|
+
Deep code analysis and behavior understanding:
|
|
237
|
+
|
|
238
|
+
- **Cross-Reference Analysis**: Track function calls, data references, and control flow (`analyze_xrefs`)
|
|
239
|
+
- **Structure Recovery**: Infer data structures from pointer arithmetic and memory access patterns (`recover_structures`)
|
|
240
|
+
- **Emulation**: ESIL-based code emulation for dynamic behavior analysis (`emulate_machine_code`)
|
|
241
|
+
- **Binary Comparison**: Diff binaries and match library functions (`diff_binaries`, `match_libraries`)
|
|
242
|
+
|
|
243
|
+
### 🦠 Malware Analysis & Defense
|
|
244
|
+
|
|
245
|
+
Specialized tools for threat detection and mitigation:
|
|
246
|
+
|
|
247
|
+
- **Dormant Threat Detection**: Find hidden backdoors, orphan functions, and logic bombs (`dormant_detector`)
|
|
248
|
+
- **IOC Extraction**: Automatically extract IPs, URLs, domains, emails, hashes, and crypto addresses (`extract_iocs`)
|
|
249
|
+
- **YARA Scanning**: Pattern-based malware detection with custom rules (`run_yara`)
|
|
250
|
+
- **Adaptive Vaccine**: Generate defensive measures (YARA rules, binary patches, NOP injection) (`adaptive_vaccine`)
|
|
251
|
+
- **Vulnerability Hunter**: Detect dangerous API patterns and exploit paths (`vulnerability_hunter`)
|
|
252
|
+
|
|
253
|
+
### 📊 Server Health & Monitoring
|
|
254
|
+
|
|
255
|
+
Built-in observability tools for enterprise environments:
|
|
256
|
+
|
|
257
|
+
- **Health Check**: Monitor uptime, memory usage, and operational status (`get_server_health`)
|
|
258
|
+
- **Performance Metrics**: Track tool execution times, error rates, and call counts (`get_tool_metrics`)
|
|
259
|
+
- **Auto-Recovery**: Automatic retry mechanism with exponential backoff for transient failures
|
|
260
|
+
|
|
261
|
+
### 🖥️ Web Dashboard (NEW)
|
|
262
|
+
|
|
263
|
+
Visual interface for binary analysis without LLM:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Start server in HTTP mode
|
|
267
|
+
MCP_TRANSPORT=http MCP_API_KEY=your-secret-key python server.py
|
|
268
|
+
|
|
269
|
+
# Access dashboard
|
|
270
|
+
open http://localhost:8000/dashboard/
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**Features:**
|
|
274
|
+
- **Overview**: File list with upload stats
|
|
275
|
+
- **Analysis**: Functions list, disassembly viewer
|
|
276
|
+
- **IOCs**: Extracted URLs, IPs, emails, strings
|
|
277
|
+
|
|
278
|
+
**Security:**
|
|
279
|
+
- XSS protection with HTML sanitization
|
|
280
|
+
- Path traversal prevention
|
|
281
|
+
- API key authentication (optional)
|
|
282
|
+
|
|
283
|
+
### 📝 Report Generation (v3.1)
|
|
284
|
+
|
|
285
|
+
Professional malware analysis report generation with accurate timestamps:
|
|
286
|
+
|
|
287
|
+
- **One-Shot Submission**: Generate standardized JSON reports with a single command (`generate_malware_submission`)
|
|
288
|
+
- **Session Tracking**: Start/end analysis sessions with automatic duration calculation (`start_analysis_session`, `end_analysis_session`)
|
|
289
|
+
- **IOC Collection**: Collect and organize indicators during analysis (`add_session_ioc`)
|
|
290
|
+
- **MITRE ATT&CK Mapping**: Document techniques with proper framework references (`add_session_mitre`)
|
|
291
|
+
- **Email Delivery**: Send reports directly to security teams with SMTP support (`send_report_email`)
|
|
292
|
+
- **Multiple Templates**: Full analysis, quick triage, IOC summary, executive brief
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
# Example 1: One-Shot JSON Submission
|
|
296
|
+
generate_malware_submission(
|
|
297
|
+
file_path="wannacry.exe",
|
|
298
|
+
analyst_name="Hunter",
|
|
299
|
+
tags="ransomware,critical"
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
# Example 2: Interactive Session Workflow
|
|
303
|
+
get_system_time()
|
|
304
|
+
start_analysis_session(sample_path="malware.exe")
|
|
305
|
+
add_session_ioc("ips", "192.168.1.100")
|
|
306
|
+
add_session_mitre("T1059.001", "PowerShell", "Execution")
|
|
307
|
+
end_analysis_session(summary="Ransomware detected")
|
|
308
|
+
create_analysis_report(template_type="full_analysis")
|
|
309
|
+
send_report_email(to="security-team@company.com")
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### ⚡ Performance & Reliability (v3.1)
|
|
313
|
+
|
|
314
|
+
- **Resource Management**:
|
|
315
|
+
- **Zombie Killer**: Guaranteed subprocess termination with `try...finally` blocks
|
|
316
|
+
- **Memory Guard**: Strict 2MB limit on `strings` output to prevent OOM
|
|
317
|
+
- **Crash Isolation**: LIEF parser runs in isolated process to handle segfaults safely
|
|
318
|
+
- **Optimizations**:
|
|
319
|
+
- **Dynamic Timeout**: Auto-scales with file size (base + 2s/MB, max +600s)
|
|
320
|
+
- **Ghidra JVM**: 16GB heap for modern systems (24-32GB RAM)
|
|
321
|
+
- **Sink-Aware Pruning**: 39 dangerous sink APIs for intelligent path prioritization
|
|
322
|
+
- **Trace Depth Optimization**: Reduced from 3 to 2 for faster execution path analysis
|
|
323
|
+
- **Infrastructure**:
|
|
324
|
+
- **Stateless Reports**: Timezone-aware reporting without global state mutation
|
|
325
|
+
- **Robust Retries**: Decorators now correctly propagate exceptions for auto-recovery
|
|
326
|
+
- **Config-Driven**: Validation limits synchronized with central configuration
|
|
327
|
+
|
|
328
|
+
### 🛠️ Core Tools
|
|
329
|
+
|
|
330
|
+
| Category | Tools |
|
|
331
|
+
|----------|-------|
|
|
332
|
+
| **File Operations** | `list_workspace`, `get_file_info` |
|
|
333
|
+
| **Static Analysis** | `run_file`, `run_strings`, `run_binwalk` |
|
|
334
|
+
| **Disassembly** | `run_radare2`, `Radare2_disassemble`, `disassemble_with_capstone` |
|
|
335
|
+
| **Decompilation** | `smart_decompile`, `get_pseudo_code` |
|
|
336
|
+
| **Advanced Analysis** | `analyze_xrefs`, `recover_structures`, `emulate_machine_code` |
|
|
337
|
+
| **Binary Parsing** | `parse_binary_with_lief` |
|
|
338
|
+
| **Binary Comparison** | `diff_binaries`, `match_libraries` |
|
|
339
|
+
| **Malware Analysis** | `dormant_detector`, `extract_iocs`, `run_yara`, `adaptive_vaccine`, `vulnerability_hunter` |
|
|
340
|
+
| **Report Generation** | `get_system_time`, `set_timezone`, `start_analysis_session`, `add_session_ioc`, `add_session_mitre`, `end_analysis_session`, `create_analysis_report`, `send_report_email`, `generate_malware_submission` |
|
|
341
|
+
| **Server Management** | `get_server_health`, `get_tool_metrics` |
|
|
342
|
+
|
|
343
|
+
## 📊 Analysis Workflow
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
📥 Upload → 🔍 Triage → 🔗 X-Refs → 🏗️ Structures → 📝 Decompile → 🛡️ Defense
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Use built-in prompts for guided analysis:**
|
|
350
|
+
|
|
351
|
+
- `full_analysis_mode` - Comprehensive malware analysis with **6-phase expert reasoning** and evidence classification
|
|
352
|
+
- `basic_analysis_mode` - Quick triage for fast initial assessment
|
|
353
|
+
- `game_analysis_mode` - Game client analysis with cheat detection guidance
|
|
354
|
+
- `firmware_analysis_mode` - IoT/Firmware security analysis with embedded system focus
|
|
355
|
+
- `report_generation_mode` - Professional report generation workflow with MITRE ATT&CK mapping
|
|
356
|
+
|
|
357
|
+
> 💡 **AI Reasoning Enhancement**: Analysis prompts use expert persona priming, Chain-of-Thought checkpoints, structured reasoning phases, and evidence classification (OBSERVED/INFERRED/POSSIBLE) to maximize AI analysis capabilities and ensure thorough documentation.
|
|
358
|
+
|
|
359
|
+
## 🏗️ Architecture
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
reversecore_mcp/
|
|
363
|
+
├── core/ # Infrastructure & Services
|
|
364
|
+
│ ├── config.py # Configuration management
|
|
365
|
+
│ ├── ghidra.py, ghidra_manager.py, ghidra_helper.py # Ghidra integration (16GB JVM)
|
|
366
|
+
│ ├── r2_helpers.py, r2_pool.py # Radare2 connection pooling
|
|
367
|
+
│ ├── security.py # Path validation & input sanitization
|
|
368
|
+
│ ├── result.py # ToolSuccess/ToolError response models
|
|
369
|
+
│ ├── metrics.py # Tool execution metrics
|
|
370
|
+
│ ├── report_generator.py # Report generation service
|
|
371
|
+
│ ├── plugin.py # Plugin interface for extensibility
|
|
372
|
+
│ ├── decorators.py # @log_execution, @track_metrics
|
|
373
|
+
│ ├── error_handling.py # @handle_tool_errors decorator
|
|
374
|
+
│ ├── logging_config.py # Structured logging setup
|
|
375
|
+
│ ├── memory.py # AI memory store (async SQLite)
|
|
376
|
+
│ ├── mitre_mapper.py # MITRE ATT&CK framework mapping
|
|
377
|
+
│ ├── resource_manager.py # Subprocess lifecycle management
|
|
378
|
+
│ └── validators.py # Input validation
|
|
379
|
+
│
|
|
380
|
+
├── tools/ # MCP Tool Implementations
|
|
381
|
+
│ ├── analysis/ # Basic analysis tools
|
|
382
|
+
│ │ ├── static_analysis.py # file, strings, binwalk
|
|
383
|
+
│ │ ├── lief_tools.py # PE/ELF/Mach-O parsing
|
|
384
|
+
│ │ ├── diff_tools.py # Binary comparison
|
|
385
|
+
│ │ └── signature_tools.py # YARA scanning
|
|
386
|
+
│ │
|
|
387
|
+
│ ├── radare2/ # Radare2 integration
|
|
388
|
+
│ │ ├── r2_analysis.py # Core r2 analysis
|
|
389
|
+
│ │ ├── radare2_mcp_tools.py # Advanced r2 tools (CFG, ESIL)
|
|
390
|
+
│ │ ├── r2_session.py # Session management
|
|
391
|
+
│ │ └── r2_pool.py # Connection pooling
|
|
392
|
+
│ │
|
|
393
|
+
│ ├── ghidra/ # Ghidra decompilation
|
|
394
|
+
│ │ ├── decompilation.py # smart_decompile, pseudo-code
|
|
395
|
+
│ │ └── ghidra_tools.py # Structure/Enum management
|
|
396
|
+
│ │
|
|
397
|
+
│ ├── malware/ # Malware analysis & defense
|
|
398
|
+
│ │ ├── dormant_detector.py # Hidden threat detection
|
|
399
|
+
│ │ ├── adaptive_vaccine.py # Defense generation
|
|
400
|
+
│ │ ├── vulnerability_hunter.py # Vulnerability detection
|
|
401
|
+
│ │ ├── ioc_tools.py # IOC extraction
|
|
402
|
+
│ │ └── yara_tools.py # YARA rule management
|
|
403
|
+
│ │
|
|
404
|
+
│ ├── common/ # Cross-cutting concerns
|
|
405
|
+
│ │ ├── file_operations.py # Workspace file management
|
|
406
|
+
│ │ ├── server_tools.py # Health checks, metrics
|
|
407
|
+
│ │ └── memory_tools.py # AI memory operations
|
|
408
|
+
│ │
|
|
409
|
+
│ └── report/ # Report generation (v3.1)
|
|
410
|
+
│ ├── report_tools.py # Core report engine
|
|
411
|
+
│ ├── report_mcp_tools.py # MCP tool registration
|
|
412
|
+
│ ├── session.py # Analysis session tracking
|
|
413
|
+
│ └── email.py # SMTP integration
|
|
414
|
+
│
|
|
415
|
+
├── prompts.py # AI reasoning prompts (5 modes)
|
|
416
|
+
├── resources.py # Dynamic MCP resources (reversecore:// URIs)
|
|
417
|
+
└── server.py # FastMCP server initialization & HTTP setup
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## 🐳 Docker Deployment
|
|
421
|
+
|
|
422
|
+
### Multi-Architecture Support
|
|
423
|
+
|
|
424
|
+
The unified `Dockerfile` automatically detects your system architecture:
|
|
425
|
+
|
|
426
|
+
| Architecture | Auto-Detected | Support |
|
|
427
|
+
|--------------|---------------|---------|
|
|
428
|
+
| x86_64 (Intel/AMD) | ✅ | Full support |
|
|
429
|
+
| ARM64 (Apple Silicon M1-M4) | ✅ | Full support |
|
|
430
|
+
|
|
431
|
+
### Run Commands
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# Using convenience script (auto-detects architecture)
|
|
435
|
+
./scripts/run-docker.sh # Start
|
|
436
|
+
./scripts/run-docker.sh stop # Stop
|
|
437
|
+
./scripts/run-docker.sh logs # View logs
|
|
438
|
+
./scripts/run-docker.sh shell # Shell access
|
|
439
|
+
|
|
440
|
+
# Manual Docker build (works for all architectures)
|
|
441
|
+
docker build -t reversecore-mcp:latest .
|
|
442
|
+
|
|
443
|
+
# Or using Docker Compose
|
|
444
|
+
docker compose up -d
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Environment Variables
|
|
448
|
+
|
|
449
|
+
| Variable | Default | Description |
|
|
450
|
+
|----------|---------|-------------|
|
|
451
|
+
| \`MCP_TRANSPORT\` | \`http\` | Transport mode (\`stdio\` or \`http\`) |
|
|
452
|
+
| \`REVERSECORE_WORKSPACE\` | \`/app/workspace\` | Analysis workspace path |
|
|
453
|
+
| \`LOG_LEVEL\` | \`INFO\` | Logging level |
|
|
454
|
+
| \`GHIDRA_INSTALL_DIR\` | \`/opt/ghidra\` | Ghidra installation path |
|
|
455
|
+
|
|
456
|
+
## 🔒 Security
|
|
457
|
+
|
|
458
|
+
- **No shell injection**: All subprocess calls use list arguments
|
|
459
|
+
- **Path validation**: Workspace-restricted file access
|
|
460
|
+
- **Input sanitization**: All parameters validated
|
|
461
|
+
- **Rate limiting**: Configurable request limits (HTTP mode)
|
|
462
|
+
|
|
463
|
+
## 🧪 Development
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
# Install dependencies
|
|
467
|
+
pip install -r requirements-dev.txt
|
|
468
|
+
|
|
469
|
+
# Run tests
|
|
470
|
+
pytest tests/ -v
|
|
471
|
+
|
|
472
|
+
# Run with coverage
|
|
473
|
+
pytest tests/ --cov=reversecore_mcp --cov-fail-under=72
|
|
474
|
+
|
|
475
|
+
# Code quality
|
|
476
|
+
ruff check reversecore_mcp/
|
|
477
|
+
black reversecore_mcp/
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Test Status
|
|
481
|
+
|
|
482
|
+
- ✅ **852 tests passed**
|
|
483
|
+
- 📊 **76% coverage**
|
|
484
|
+
- ⏱️ ~14 seconds execution time
|
|
485
|
+
|
|
486
|
+
## 📚 API Reference
|
|
487
|
+
|
|
488
|
+
### Tool Response Format
|
|
489
|
+
|
|
490
|
+
All tools return structured \`ToolResult\`:
|
|
491
|
+
|
|
492
|
+
```json
|
|
493
|
+
{
|
|
494
|
+
"status": "success",
|
|
495
|
+
"data": "...",
|
|
496
|
+
"metadata": { "bytes_read": 1024 }
|
|
497
|
+
}
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
```json
|
|
501
|
+
{
|
|
502
|
+
"status": "error",
|
|
503
|
+
"error_code": "VALIDATION_ERROR",
|
|
504
|
+
"message": "File not found",
|
|
505
|
+
"hint": "Check file path"
|
|
506
|
+
}
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### Common Error Codes
|
|
510
|
+
|
|
511
|
+
| Code | Description |
|
|
512
|
+
|------|-------------|
|
|
513
|
+
| \`VALIDATION_ERROR\` | Invalid input parameters |
|
|
514
|
+
| \`TIMEOUT\` | Operation exceeded time limit |
|
|
515
|
+
| \`PARSE_ERROR\` | Failed to parse tool output |
|
|
516
|
+
| \`TOOL_NOT_FOUND\` | Required CLI tool missing |
|
|
517
|
+
|
|
518
|
+
## 💻 System Requirements
|
|
519
|
+
|
|
520
|
+
| Component | Minimum | Recommended |
|
|
521
|
+
|-----------|---------|-------------|
|
|
522
|
+
| **CPU** | 4 cores | 8+ cores |
|
|
523
|
+
| **RAM** | 16 GB | 32 GB |
|
|
524
|
+
| **Storage** | 512 GB SSD | 1 TB NVMe |
|
|
525
|
+
| **OS** | Linux/macOS | Docker environment |
|
|
526
|
+
|
|
527
|
+
## 🤝 Contributing
|
|
528
|
+
|
|
529
|
+
1. Fork the repository
|
|
530
|
+
2. Create a feature branch
|
|
531
|
+
3. Make changes with tests
|
|
532
|
+
4. Run \`pytest\` and \`ruff check\`
|
|
533
|
+
5. Submit a pull request
|
|
534
|
+
|
|
535
|
+
## 📄 License
|
|
536
|
+
|
|
537
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
538
|
+
|
|
539
|
+
## 🔗 Links
|
|
540
|
+
|
|
541
|
+
- [GitHub Repository](https://github.com/sjkim1127/Reversecore_MCP)
|
|
542
|
+
- [FastMCP Documentation](https://github.com/jlowin/fastmcp)
|
|
543
|
+
- [MCP Protocol Specification](https://modelcontextprotocol.io/)
|