Ghidra的MCP服务器
MCP server for Ghidra

原始链接: https://github.com/LaurieWired/GhidraMCP

ghidraMCP是一个模型上下文协议(MCP)服务器,它使LLM能够自主地使用Ghidra反向工程应用程序。它为MCP客户端提供了Ghidra强大的功能,用于反编译、分析、自动重命名方法和数据以及列出程序元素等任务。 安装方法:下载最新版本,其中包含Ghidra插件和Python MCP客户端。通过Ghidra的扩展管理器安装插件并确保其已启用。 ghidraMCP支持各种MCP客户端。对于Claude Desktop,请通过添加一个`ghidra`服务器条目配置其`claude_desktop_config.json`文件,并指定`bridge_mcp_ghidra.py`的路径。对于5ire,创建一个新的工具,键为"ghidra",名称为"GhidraMCP",并将要执行的命令设置为`bridge_mcp_ghidra.py`。`bridge_mcp_ghidra.py`是连接LLM和Ghidra的Python脚本。 Maven构建会创建一个包含插件和Ghidra所需资源的zip文件。`lib/GhidraMCP.jar`、`extensions.properties`和`Module.manifest`文件对于Ghidra识别GhidraMCP扩展至关重要。

这个 Hacker News 帖子讨论了“用于 Ghidra 的 MCP 服务器”,这是一个将 Ghidra(一个软件逆向工程框架)与大型语言模型 (LLM) 集成的工具。“dang” 的评论链接到另一个相关帖子,“GhidraMCP:现在 AI 可以逆向恶意软件了”。用户们正在分享他们使用 LLM 处理 Ghidra 输出的经验。虽然一位用户 (“brokensegue”) 发现将代码复制粘贴到 LLM 中结果不理想,但另一位用户 (“Everdred2dx”) 有了积极的体验,LLM 正确推断出了 PS2 游戏中几个相关函数的目的和参数。讨论随后转向了为什么会出现这种情况,理论范围从训练数据中的符号识别到 LLM 理解和重写代码的能力。另一位用户 (“sitkack”) 强调了 LLM 识别多种编码格式并辅助反编译的能力。

原文

License GitHub release (latest by date) GitHub stars GitHub forks GitHub contributors Follow @lauriewired

ghidra_MCP_logo

ghidraMCP is an Model Context Protocol server for allowing LLMs to autonomously reverse engineer applications. It exposes numerous tools from core Ghidra functionality to MCP clients.

ghidraMCP_demo.mp4

MCP Server + Ghidra Plugin

  • Decompile and analyze binaries in Ghidra
  • Automatically rename methods and data
  • List methods, classes, imports, and exports
  • Mac / Windows
  • Install Ghidra
  • Python3

First, download the latest release from this repository. This contains the Ghidra plugin and Python MCP client. Then, you can directly import the plugin into Ghidra.

  1. Run Ghidra
  2. Select File -> Install Extensions
  3. Click the + button
  4. Select the GhidraMCP-1-0.zip (or your chosen version) from the downloaded release
  5. Restart Ghidra
  6. Make sure the GhidraMCPPlugin is enabled in File -> Configure -> Developer

Video Installation Guide:

ghidra_MCP_Install.mp4

Theoretically, any MCP client should work with ghidraMCP. Two examples are given below.

Example 1: Claude Desktop

To set up Claude Desktop as a Ghidra MCP client, go to Claude -> Settings -> Developer -> Edit Config -> claude_desktop_config.json and add the following:

{
  "mcpServers": {
    "ghidra": {
      "command": "python",
      "args": [
        "/ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py"
      ]
    }
  }
}

Alternatively, edit this file directly:

/Users/YOUR_USER/Library/Application Support/Claude/claude_desktop_config.json

Another MCP client that supports multiple models on the backend is 5ire. To set up GhidraMCP, open 5ire and go to Tools -> New and set the following configurations:

  1. Tool Key: ghidra
  2. Name: GhidraMCP
  3. Command: python /ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py

Build with Maven by running:

mvn clean package assembly:single

The generated zip file includes the built Ghidra plugin and its resources. These files are required for Ghidra to recognize the new extension.

  • lib/GhidraMCP.jar
  • extensions.properties
  • Module.manifest
联系我们 contact @ memedata.com