Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Ghidrathon — FLARE团队的开源扩展,用于为Ghidra添加Python 3脚本功能。 | Kitploit
工具/GitHubGitHub/mandiant/ghidrathon
逆向工程脚本与自动化恶意软件分析二进制分析Archived
GitHubmandiant/ghidrathon

Ghidrathon

FLARE团队的开源扩展,用于为Ghidra添加Python 3脚本功能。

查看仓库
788652年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Ghidrathon

GitHub Release GitHub Downloads (all assets, latest release) CI License

Ghidrathon 是一个 Ghidra 扩展,为 Ghidra 添加了 Python 3 脚本功能。为什么?Ghidra 原生支持使用 Java 和 Jython 编写脚本。不幸的是,许多开源分析工具,如 capa、Unicorn Engine、angr 等,都是用 Python 3 编写的,这使得在 Ghidra 中使用这些工具变得困难,在某些情况下甚至不可能。更重要的是,安全社区已经为其他 SRE 框架(如 IDA Pro 和 Binary Ninja)发布了一些优秀的插件,但同样,由于这些插件大多使用 Python 3,因此很难将它们移植到 Ghidra。Ghidrathon 帮助您在 Ghidra 中使用现有的和开发新的 Python 3 工具,并使用现代 Python 编写 Ghidra 脚本,同时与 Ghidra 的用户界面紧密集成。它取代了通过 Jython 实现的现有 Python 2.7 扩展。这包括交互式解释器窗口、与 Ghidra 脚本管理器的集成,以及 Ghidra 无头模式下的脚本执行。

example

请参阅我们的 Ghidra Python 3 脚本示例 此处,以更详细地了解如何为 Ghidra 编写 Python 3 脚本。

欢迎查看:

  • 我们第一篇 Ghidrathon 博客文章 中的概述

安装 Ghidrathon

环境要求

请按照以下步骤将 Ghidrathon 安装到您的 Ghidra 环境中:

  1. 下载并解压最新的 Ghidrathon 发行版
  2. 使用您希望与 Ghidrathon 一起使用的 Python 解释器执行以下命令(发行版中包含 requirements.txt 和 ghidrathon_configure.py):
root@kitploit:~
$ python -m pip install -r requirements.txt
$ python ghidrathon_configure.py <absolute_path_to_ghidra_install_dir>

注意:默认情况下,ghidrathon_configure.py 会尝试将名为 ghidrathon.save 的文件写入 <absolute_path_to_ghidra_install_dir>。您可以在运行 ghidrathon_configure.py 和 Ghidra 之前,通过设置 GHIDRATHON_SAVE_PATH 环境变量来指定该文件的写入路径:

root@kitploit:~
$ export GHIDRATHON_SAVE_PATH="/path/to/custom/dir" # Linux/MacOS
$ set GHIDRATHON_SAVE_PATH="C:\path\to\custom\dir"  # Windows

注意:系统可能会提示您设置名为 JAVA_HOME 的环境变量。该变量应引用您为 Ghidra 安装所配置的 JDK 的绝对路径。

  1. 将 Ghidrathon 扩展(.zip)安装到 Ghidra 中:
    • 使用 Ghidra 的 UI:
      • 导航到 File > Install Extensions...
      • 点击绿色的 + 按钮
      • 导航到 Ghidrathon 扩展(.zip)
      • 点击 Ok
      • 可选
        • 如果出现 Extension Version Mismatch 窗口提示,请选择 Install Anyway
    • 使用受限环境:
      • 将 Ghidrathon 扩展(.zip)解压到 <absolute_path_to_ghidra_install_dir>\Ghidra\Extensions

切换 Python 解释器

您可以通过使用新的 Python 解释器执行步骤 2,将 Ghidrathon 切换为使用不同的 Python 解释器。

使用 Python 虚拟环境

您可以通过在虚拟环境中执行步骤 2,将 Python 虚拟环境与 Ghidrathon 一起使用。要切换到不同的虚拟环境,只需在新的虚拟环境中执行步骤 2。

使用 Ghidrathon

Python 3 解释器窗口

解释器窗口提供对您的 Python 3 解释器的交互式访问。点击“窗口”并选择“Ghidrathon”以打开解释器窗口。

example

Ghidra 脚本管理器集成

Ghidrathon 直接与 Ghidra 脚本管理器集成,使您能够在 Ghidra 中创建、编辑和执行 Python 3 脚本。点击“Create New Script”并选择“Python 3”以创建新的 Python 3 脚本。点击“Run Script”或“Run Editors's Script”以执行您的 Python 3 脚本,并在 Ghidra Console 窗口中查看脚本输出。

example

Ghidra 无头模式

Ghidrathon 帮助您在 Ghidra 无头模式下执行 Python 3 脚本。执行位于 Ghidra 安装文件夹中的 analyzeHeadless 脚本,指定您的 Python 3 脚本,并在控制台窗口中查看脚本输出。

root@kitploit:~
$ analyzeHeadless C:\Users\wampus example -process example.o -postScript ghidrathon_example.py
[...]
INFO  SCRIPT: C:\Users\wampus\.ghidra\.ghidra_10.0.3_PUBLIC\Extensions\Ghidrathon-master\ghidra_scripts\ghidrathon_example.py (HeadlessAnalyzer)
Function _init @ 0x101000: 3 blocks, 8 instructions
Function FUN_00101020 @ 0x101020: 1 blocks, 2 instructions
Function __cxa_finalize @ 0x101040: 1 blocks, 2 instructions
Function printf @ 0x101050: 1 blocks, 2 instructions
Function _start @ 0x101060: 1 blocks, 13 instructions
Function deregister_tm_clones @ 0x101090: 4 blocks, 9 instructions
Function register_tm_clones @ 0x1010c0: 4 blocks, 14 instructions
Function __do_global_dtors_aux @ 0x101100: 5 blocks, 14 instructions
[...]
INFO  REPORT: Post-analysis succeeded for file: /example.o (HeadlessAnalyzer)
INFO  REPORT: Save succeeded for processed file: /example.o (HeadlessAnalyzer)

有关在无头模式下运行 Ghidra 的更多信息,请查看 <absolute_path_to_ghidra_install_dir>/support/analyzeHeadlessREADME.html。

第三方 Python 模块

我们开发 Ghidrathon 的最大动机之一,就是能够在 Ghidra 中使用第三方 Python 3 模块。您可以像在典型的 Python 环境中一样,安装模块并开始在 Ghidra 中使用它。这也适用于您之前安装的模块。例如,我们可以安装并使用 Unicorn 来在 Ghidra 中模拟 ARM 代码。

example

编写 Ghidra Python 3 脚本

Ghidrathon 提供的脚本体验与 Ghidra 的 Java 和 Jython 扩展非常相似,包括将 GhidraScript 状态实例变量(例如 currentProgram)和 FlatProgramAPI 方法(例如 findBytes) 在 Python builtins 作用域中提供。这意味着您的代码导入的 所有 Python 模块都可以访问这些变量和方法。Ghidrathon 与 Ghidra 的 Java 和 Jython 扩展略有不同,它将 GhidraScript 状态变量公开为 Python 函数调用,而不是直接访问,例如您的 Python 3 代码必须使用函数调用 currentProgram() 来访问 currentProgram。这一小改动可确保您的 Python 3 代码在执行期间获得正确的 GhidraScript 状态变量。请参阅我们的 Ghidra Python 3 脚本示例 此处,以更详细地了解如何为 Ghidra 编写 Python 3 脚本。

它是如何工作的?

Ghidrathon 使用开源项目 Jep 将您的本地 Python 安装链接到 Ghidra。本质上,您的本地 Python 解释器运行在 Ghidra 内部,可以访问您所有的 Python 包 以及 标准 Ghidra 脚本 API。Ghidrathon 还支持 Python 虚拟环境,帮助您创建、隔离和管理那些您可能只想为 Ghidra 使用而安装的包。由于 Ghidrathon 使用您本地的 Python 安装,您可以控制运行在 Ghidra 内部的 Python 版本和环境。

有关 Jep 如何将 Python 嵌入 Java 的更多信息,请参阅其文档 此处。

注意事项

Ghidrathon 使用开源库 Jep,它通过 Java 本地接口(JNI)将 Python 嵌入到 JVM 中。Ghidra 开发人员不建议在 Ghidra 中使用 JNI,相关原因请参阅 此处。

下载工具
工具版本来源
Ghidrathon>= 4.0.0https://github.com/mandiant/Ghidrathon/releases
Python>= 3.8.0https://www.python.org/downloads
Jep== 4.2.0https://pypi.org/project/jep
Ghidra>= 10.3.2https://github.com/NationalSecurityAgency/ghidra/releases
Java>= 17.0.0https://adoptium.net/temurin/releases