ghidra
БесплатноБез исполняемых скриптовНе проверенGhidra is an open-source reverse engineering suite from the NSA that disassembles and decompiles compiled programs so their behaviour can be read and…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Ghidra — Scriptable reverse engineering from the command line
Overview
Ghidra loads executables, libraries and firmware images, recovers functions and data types, and decompiles machine code to C-like source. Besides the GUI it ships a headless analyzer (analyzeHeadless) and a Python library (PyGhidra), so an agent can import binaries, run analysis and extract results without opening a window.
Instructions
Installation
Ghidra has no installer: install a JDK, download the release zip, verify it and unpack it into a new directory.
java -version # Ghidra 12.1.x needs JDK 21 (Temurin or Corretto builds work)
curl -LO https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_12.1.4_build/ghidra_12.1.4_PUBLIC_20260921.zip
echo "ddac49f903da9d5bac833e5cc79395098b9c33cfd3279be5f31bd00387d2d4db ghidra_12.1.4_PUBLIC_20260921.zip" | sha256sum -c -
unzip -q ghidra_12.1.4_PUBLIC_20260921.zip -d "$HOME/tools"
export GHIDRA_INSTALL_DIR="$HOME/tools/ghidra_12.1.4_PUBLIC"
The SHA-256 value is published in the notes of each release. Take the asset whose name contains _PUBLIC_, not the "Source code" archives, and never unpack over an existing installation. The master branch already requires JDK 25, so check Ghidra/application.properties when building from source.
Headless analysis
The first two arguments are the directory that holds projects and the project name (optionally name/folder). Then choose -import for new files or -process for programs already in the project. The project is created on first import, and auto-analysis runs unless -noanalysis is given.
mkdir -p /srv/re/projects /srv/re/out
"$GHIDRA_INSTALL_DIR/support/analyzeHeadless" /srv/re/projects fw-audit \
-import /srv/re/samples/router-rootfs/usr/sbin/httpd \
-analysisTimeoutPerFile 900 -max-cpu 4 \
-log /srv/re/out/analysis.log -scriptlog /srv/re/out/script.log
| Option | Effect |
|---|---|
-import /srv/re/samples/lib |
Import and analyze a file or directory; repeatable. Add -recursive for subdirectories and archives |
-process httpd |
Work on programs already in the project; without a name, every program in the project folder (add -recursive for subfolders). Quote wildcards: -process '*.so' |
-overwrite |
Replace a program of the same name on import instead of skipping it |
-readOnly |
Do not save imports or changes |
-noanalysis |
Skip auto-analysis (useful when only running a script) |
-preScript Setup.java / -postScript Report.java out.tsv |
Run a script before or after analysis, with optional arguments; repeatable |
-scriptPath "/srv/re/scripts;/opt/team-scripts" |
Extra script directories (default: ~/ghidra_scripts and the bundled ones) |
-processor ARM:LE:32:v7 -cspec default |
Force the language and compiler instead of relying on the file header |
-loader BinaryLoader -loader-baseAddr 08000000 |
Load a raw image at a hexadecimal base address |
-analysisTimeoutPerFile 900 |
Stop analysis of one file after 900 seconds, then continue with the scripts |
-deleteProject |
Remove a project created in this run when finished |
Headless runs use a 2 GB Java heap by default. Raise it for large binaries with GHIDRA_HEADLESS_MAXMEM=8G in the environment.
Scripts in Java
Scripts extend GhidraScript and see currentProgram, monitor and the flat API. Pass the file name only; the directory goes into -scriptPath. Arguments after the script name arrive in getScriptArgs().
// ListRiskyCalls.java — writes call sites of risky libc functions as TSV, one file per program
// Args: output directory, then optional function names
//@category Analysis
import java.io.File;
import java.io.PrintWriter;
import java.util.Arrays;
import ghidra.app.script.GhidraScript;
import ghidra.program.model.listing.Function;
import ghidra.program.model.symbol.Reference;
import ghidra.program.model.symbol.Symbol;
public class ListRiskyCalls extends GhidraScript {
@Override
public void run() throws Exception {
String[] args = getScriptArgs();
String[] names = args.length > 1
? Arrays.copyOfRange(args, 1, args.length)
: new String[] {"strcpy", "strcat", "sprintf", "gets", "system"};
File report = new File(args[0], currentProgram.getName() + "-risky-calls.tsv");
try (PrintWriter out = new PrintWriter(report)) {
for (String name : names) {
for (Symbol sym : currentProgram.getSymbolTable().getSymbols(name)) {
for (Reference ref : getReferencesTo(sym.getAddress())) {
if (!ref.getReferenceType().isCall()) {
continue;
}
Function caller = getFunctionContaining(ref.getFromAddress());
out.println(name + "\t" + ref.getFromAddress() + "\t"
+ (caller == null ? "-" : c
Установить ghidra в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ghidra?
Ghidra is an open-source reverse engineering suite from the NSA that disassembles and decompiles compiled programs so their behaviour can be read and scripted. Use when a user asks to analyze a binary with Ghidra from the command line, run analyzeHeadless, batch-import firmware or malware samples into a Ghidra project, decompile functions to C, write a Ghidra script in Java or Python, or automate analysis with PyGhidra. For authorized work only: malware analysis, vulnerability research, firmware the user owns, CTF challenges.
Как установить скилл ghidra?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ghidra запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic