LaurieWired/GhidraMCP
GitHub: LaurieWired/GhidraMCP
GhidraMCP 是一个允许大语言模型自主连接并操作 Ghidra 进行二进制逆向分析的 MCP 服务器。
Stars: 8365 | Forks: 806
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://github.com/LaurieWired/GhidraMCP/releases)
[](https://github.com/LaurieWired/GhidraMCP/stargazers)
[](https://github.com/LaurieWired/GhidraMCP/network/members)
[](https://github.com/LaurieWired/GhidraMCP/graphs/contributors)
[](https://twitter.com/lauriewired)

# ghidraMCP
ghidraMCP 是一个 Model Context Protocol 服务器,用于允许 LLM 自主逆向工程应用程序。它向 MCP 客户端暴露了来自 Ghidra 核心功能的众多工具。
https://github.com/user-attachments/assets/36080514-f227-44bd-af84-78e29ee1d7f9
# 功能
MCP 服务器 + Ghidra 插件
- 在 Ghidra 中反编译和分析二进制文件
- 自动重命名方法和数据
- 列出方法、类、导入和导出
# 安装
## 前置条件
- 安装 [Ghidra](https://ghidra-sre.org)
- Python3
- MCP [SDK](https://github.com/modelcontextprotocol/python-sdk)
## Ghidra
首先,从此仓库下载最新的 [release](https://github.com/LaurieWired/GhidraMCP/releases)。其中包含 Ghidra 插件和 Python MCP 客户端。然后,你可以将插件直接导入到 Ghidra 中。
1. 运行 Ghidra
2. 选择 `File` -> `Install Extensions`
3. 点击 `+` 按钮
4. 从下载的 release 中选择 `GhidraMCP-1-2.zip`(或你选择的版本)
5. 重启 Ghidra
6. 确保在 `File` -> `Configure` -> `Developer` 中启用了 GhidraMCPPlugin
7. *可选*:通过 `Edit` -> `Tool Options` -> `GhidraMCP HTTP Server` 在 Ghidra 中配置端口
视频安装指南:
https://github.com/user-attachments/assets/75f0c176-6da1-48dc-ad96-c182eb4648c3
## MCP 客户端
理论上,任何 MCP 客户端都应该可以与 ghidraMCP 配合使用。下面给出了三个示例。
## 示例 1:Claude Desktop
要将 Claude Desktop 设置为 Ghidra MCP 客户端,请转到 `Claude` -> `Settings` -> `Developer` -> `Edit Config` -> `claude_desktop_config.json` 并添加以下内容:
```
{
"mcpServers": {
"ghidra": {
"command": "python",
"args": [
"/ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py",
"--ghidra-server",
"http://127.0.0.1:8080/"
]
}
}
}
```
或者,直接编辑该文件:
```
/Users/YOUR_USER/Library/Application Support/Claude/claude_desktop_config.json
```
服务器 IP 和端口是可配置的,应设置为指向目标 Ghidra 实例。如果未设置,两者将默认为 localhost:8080。
## 示例 2:Cline
要将 GhidraMCP 与 [Cline](https://cline.bot) 一起使用,这还需要手动运行 MCP 服务器。首先运行以下命令:
```
python bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081 --ghidra-server http://127.0.0.1:8080/
```
唯一*必需*的参数是传输方式。如果未指定所有其他参数,它们将默认为上述值。MCP 服务器运行后,打开 Cline 并选择顶部的 `MCP Servers`。

然后选择 `Remote Servers` 并添加以下内容,确保 url 与 MCP 主机和端口匹配:
1. Server Name: GhidraMCP
2. Server URL: `http://127.0.0.1:8081/sse`
## 示例 3:5ire
另一个支持后端多模型的 MCP 客户端是 [5ire](https://github.com/nanbingxyz/5ire)。要设置 GhidraMCP,请打开 5ire 并转到 `Tools` -> `New`,并设置以下配置:
1. Tool Key: ghidra
2. Name: GhidraMCP
3. Command: `python /ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py`
# 从源码构建
1. 将以下文件从你的 Ghidra 目录复制到该项目的 `lib/` 目录:
- `Ghidra/Features/Base/lib/Base.jar`
- `Ghidra/Features/Decompiler/lib/Decompiler.jar`
- `Ghidra/Framework/Docking/lib/Docking.jar`
- `Ghidra/Framework/Generic/lib/Generic.jar`
- `Ghidra/Framework/Project/lib/Project.jar`
- `Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar`
- `Ghidra/Framework/Utility/lib/Utility.jar`
- `Ghidra/Framework/Gui/lib/Gui.jar`
2. 通过运行以下命令使用 Maven 构建:
`mvn clean package assembly:single`
生成的 zip 文件包含构建的 Ghidra 插件及其资源。这些文件是 Ghidra 识别新扩展所必需的。
- lib/GhidraMCP.jar
- extensions.properties
- Module.manifest
标签:API集成, DAST, DLL 劫持, Ghidra, Ghidra插件, JS文件枚举, LLM, MCP, Model Context Protocol, Python, SOC Prime, Unmanaged PE, URL提取, 二进制分析, 云安全监控, 云安全运维, 云资产清单, 反编译, 可观测性, 域名枚举, 大语言模型, 开发工具, 恶意软件分析, 无后门, 漏洞分析, 自动化分析, 跨站脚本, 路径探测, 逆向工具, 逆向工程, 静态分析