
OGhidra는 Ollama를 통해 대규모 언어 모델(LLMs)과 Ghidra 리버스 엔지니어링 플랫폼을 연결하여, 자연어를 통한 AI 기반 바이너리 분석을 가능하게 합니다. 대화형 질의를 사용하여 Ghidra와 상호작용하고 복잡한 리버스 엔지니어링 워크플로우를 자동화하세요.
Claude에서 영감을 받은 Orchestrator를 사용하는 버전은 https://github.com/llnl/OGhidra/tree/orchestrator 를 참조하세요.
OGhidra는 대규모 언어 모델(LLM)과 Ghidra 리버스 엔지니어링 플랫폼을 연결하여 자연어를 통한 AI 기반 바이너리 분석을 가능하게 합니다. 대화형으로 바이너리를 분석하고, 복잡한 워크플로를 자동화하며, 로컬 AI 모델로 완전한 프라이버시를 유지하세요.
YouTube 설정 튜토리얼
OGhidra는 Ghidra에 AI 기능을 추가하여 다음을 가능하게 합니다:
graph TD
A[User Query] --> B[Planning Phase]
B --> C{Execution Phase}
C -- Tool Calls --> D[Ghidra/LLM]
D --> C
C --> E[Review Phase]
E -- Agentic Loop --> B
E --> F[Final Response]
style E fill:#f9f,stroke:#333,stroke-width:2px
style B fill:#bbf,stroke:#333,stroke-width:2px
에이전틱 루프: OGhidra는 적응형 계획 시스템을 사용합니다. 각 실행 주기 후에 결과를 검토하고 AI는 최종 응답을 제공하기 전에 더 많은 정보를 수집하거나 분석을 개선할 수 있습니다.
python --versionjava -version# Clone repository
git clone https://github.com/LLNL/OGhidra.git
cd OGhidra
# Install dependencies (choose one)
uv sync # Using UV (recommended)
pip install -r requirements.txt # Using pip
# Configure environment
cp .env.example .env
# Edit .env with your settings
아래 OGhidraMCP 플러그인 빌드 단계는 Ghidra 12.0.3(권장)을 대상으로 합니다. YouTube 동영상 튜토리얼도 있습니다: https://www.youtube.com/watch?v=hBD92FUgR0Y
개발자로서 Ghidra에 설치하기 전에 GhidraMCP 확장 프로그램을 빌드해야 합니다:
사전 요구사항:
옵션 1: 자동 빌드 스크립트 사용:
Windows:
# Set the path to your Ghidra installation (will attempt to find last run copy of Ghidra if not set)
set GHIDRA_INSTALL_DIR=C:\path\to\ghidra_12.0.3_PUBLIC
# Run the build script
build_ghidra_plugin.bat
Unix/Linux/Mac:
# Set the path to your Ghidra installation (will attempt to find the last run copy of Ghidra if not set)
export GHIDRA_INSTALL_DIR=/path/to/ghidra_12.0.3_PUBLIC
# Run the build script (make it executable first if needed)
chmod +x build_ghidra_plugin.sh
./build_ghidra_plugin.sh
옵션 2: 수동 빌드 프로세스:
Ghidra 설치 경로로 OGhidraMCP/gradle.properties를 생성/업데이트하세요:
GHIDRA_INSTALL_DIR=/absolute/path/to/ghidra_12.0.3_PUBLIC
On Unix/Linux/macOS:
cd OGhidraMCP
$GHIDRA_INSTALL_DIR/support/gradle/gradlew buildExtension --info
On Windows:
cd OGhidraMCP
"%GHIDRA_INSTALL_DIR%\support\gradle\gradlew.bat" buildExtension --info
확장 프로그램을 성공적으로 빌드한 후:
Ghidra에 설치:
OGhidraMCP/dist/ 디렉토리로 이동ghidra_12.0.3_PUBLIC_YYYYMMDD_OGhidraMCP.zip)플러그인 활성화:
OGhidraMCP 플러그인 활성화http://localhost:8080/methods에서 시작됩니다.코드 브라우저를 열어 두어야 합니다
# For Ollama (local models)
ollama pull gemma3:27b # Good balance (20GB RAM)
ollama pull nomic-embed-text # Embedding model for RAG
# Alternative models
ollama pull gpt-oss:120b # High quality (80GB RAM)
ollama pull devstral-2:123b # High quality (80GB RAM)
ollama pull devstral-2:123b-cloud # Cloud Model
# GUI Mode (recommended)
uv run main.py --ui
# Interactive CLI
uv run main.py --interactive
# In interactive CLI, test connection
health
GUI 모드로 실행한 경우 다음을 사용하세요:
curl http://localhost:8080/methods
.env 파일을 편집하여 AI 제공자를 설정하세요:
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434/
OLLAMA_MODEL=gemma3:27b
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
LLM_PROVIDER=external
EXTERNAL_PROVIDER=google
EXTERNAL_API_KEY=your-api-key-here
EXTERNAL_MODEL=gemini-3.1-flash-lite-preview
EXTERNAL_EMBEDDING_MODEL=gemini-embedding-001
LLM_PROVIDER=custom_api
CUSTOM_API_URL=https://api.example.com/v1/chat/completions
CUSTOM_API_KEY=your-api-key-here
CUSTOM_API_MODEL=your-model-name
CUSTOM_API_EMBEDDING_MODEL=your-embedding-model
모델의 컨텍스트 윈도우에 맞게 조정하세요:
# Context budget in tokens (adjust to your model's limit)
CONTEXT_BUDGET=100000 # 100K tokens for mid-size models
# 200K+ for frontier models
# Execution settings
MAX_EXECUTION_STEPS=5 # Steps per planning cycle
MAX_AGENTIC_CYCLES=3 # How many plan-execute-review loops
AGENTIC_LOOP_ENABLED=true # Enable adaptive replanning
일반적인 리버스 엔지니어링 작업에 대한 원클릭 액세스:
특화된 분석 목표 설정:
# In GUI: Use "Task Mode" dropdown
# In CLI: set task_mode <mode>
task_mode malware # Malware analysis with pattern detection
task_mode vuln # Vulnerability research focus
task_mode general # General reverse engineering
12개 이상의 악성코드 패턴 자동 탐지:
패턴은 MITRE ATT&CK 매핑과 함께 AI 컨텍스트에서 자동 알림을 트리거합니다.
바이너리 분석으로 풍부하고 질의 가능한 지식 구축:
# Enumerate all functions with AI summaries
# Choose from:
- Rename Only: Only process generic function names
- Smart Enumeration: Focus on security-relevant functions
- Full Enumeration: Analyze every function in the binary
기능:
분석 세션 저장 및 복원:
# Save progress
File → Save Session
# Load previous work
File → Load Session
# Auto-save after bulk operations
# Sessions include:
- Analyzed functions with summaries
- RAG vectors for semantic search
- Performance statistics
- UI state
OGhidra는 두 가지 백엔드 유형을 지원합니다:
다음 명령줄 옵션을 사용하여 백엔드를 선택하세요:
--ghidra-backend={http,pyghidra}
| 백엔드 옵션 | 설명 |
|---|---|
http | GhidraMCP 백엔드 사용 |
pyghidra | PyGhidra 백엔드 사용 |
OGhidra 실행 시 Ghidra 프로젝트 파일(.gpr)을 지정하세요:
--pyghidra-project=/path/to/project.gpr
PyGhidra는 OGhidra를 실행하려면 유효한 Ghidra 프로젝트가 필요합니다.
Ghidra 프로젝트 내에서 분석할 바이너리를 지정하세요:
--pyghidra-program=<program_name>
Ghidra 프로젝트에서 프로그램을 선택하는 예시 호출:
uv run main.py --ui --ghidra-backend=pyghidra --pyghidra-project=/path/to/project.gpr --pyghidra-program=<program_name>
요구사항:
바이너리 경로를 직접 제공할 수도 있습니다:
--pyghidra-binary=/path/to/binary
이 옵션을 사용하면 PyGhidra가 자동으로 다음을 수행합니다:
.gpr) 생성바이너리를 직접 실행하는 예시 호출:
uv run main.py --ui --ghidra-backend=pyghidra --pyghidra-binary=/path/to/binary
uv run main.py --ui# In GUI: Click "Generate Report" button
# Report includes:
- Executive Summary
- Function Inventory (renamed functions with behavior)
- Security Analysis (high-risk functions, patterns)
- Import Analysis
- String Analysis
- Recommendations
OGhidra는 분석된 함수에 대한 의미 검색을 위해 벡터 임베딩을 사용합니다:
# Enable in .env
RESULT_CACHE_ENABLED=true
TIERED_CONTEXT_ENABLED=true
이점:
계층적 컨텍스트 압축이 관련 정보를 유지합니다:
CURRENT_LOOP_MAX_CHARS=2000 # Recent: full detail
PREV_LOOP_MAX_CHARS=400 # Previous: summaries
OLDER_LOOP_MAX_CHARS=100 # Older: references only
디버깅을 위한 모든 AI 상호 작용 추적:
LLM_LOGGING_ENABLED=true
LLM_LOG_FILE=logs/llm_interactions.log
LLM_LOG_FORMAT=json
# Verify plugin is loaded
# Open up codebrowser!
# Check server is running
curl http://localhost:8080/methods
# Verify Ollama is running
ollama list
# Check connectivity
curl http://localhost:11434/api/tags
# Restart Ollama service
ollama serve
# Reduce context budget
CONTEXT_BUDGET=50000
# Enable compaction
COMPACTION_ENABLED=true
COMPACTION_THRESHOLD=0.75
gemma3:9b로 전환max_workers=2 설정RESULT_CACHE_ENABLED=falseCUSTOM_API_REQUEST_DELAY=2.0┌─────────────────────────────────────────────────────────────┐
│ OGhidra UI │
│ (GUI / Interactive CLI) │
└────────────────────────┬────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Bridge (src/bridge.py) │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ • Agentic Loop: Plan → Execute → Review → Replan │ │
│ │ • Tool Router: Ghidra client, LLM client, CAG manager │ │
│ │ • Context Manager: Budget allocation, compression │ │
│ └────────────────────────────────────────────────────────┘ │
└───────────┬────────────────────────┬────────────────────────┘
│ │
▼ ▼
┌───────────────────────┐ ┌─────────────────────────┐
│ Ghidra Client │ │ LLM Clients │
│ • GhidraMCP Plugin │ │ • Ollama (local) │
│ • Binary operations │ │ • External APIs │
│ • Decompilation │ │ • Custom endpoints │
└───────────────────────┘ └─────────────────────────┘
│ │
└────────────┬───────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ CAG Manager (Knowledge System) │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ • Vector Store: Semantic search over functions │ │
│ │ • Pattern Detector: 12+ malware techniques │ │
│ │ • Metadata Extractor: Structured function analysis │ │
│ │ • Session Store: Persistent analysis state │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
기여를 환영합니다! 관심 분야:
커뮤니티 지침은 CODE_OF_CONDUCT.md를 참조하세요.
연구에 OGhidra를 사용하는 경우 다음을 인용해 주세요:
@software{oghidra2025,
title = {OGhidra: AI-Powered Reverse Engineering with Ghidra},
author = {Enoch Wang},
year = {2025},
url = {https://github.com/LLNL/OGhidra}
}
OGhidra는 훌륭한 오픈소스 프로젝트를 기반으로 합니다:
OGhidra는 BSD 3-Clause 라이선스의 조건과 상용 라이선스 대안에 따라 배포됩니다.
자세한 내용은 LICENSE 및 NOTICE.md를 참조하세요.
LLNL-CODE-2013290
빌드된 확장 프로그램 찾기:
OGhidraMCP/dist/에 생성됩니다.ghidra_12.0.3_PUBLIC_YYYYMMDD_OGhidraMCP.zip과 같습니다.| 도구 | 설명 |
|---|
| Analyze Current Function | 선택한 함수의 동작 심층 분석 |
| Rename Current Function | AI가 분석을 기반으로 의미 있는 이름 제안 |
| Rename All Functions | 스마트/전체/이름만 변경 옵션으로 일괄 이름 바꾸기 |
| Analyze Imports | 라이브러리 및 외부 종속성 식별 |
| Analyze Strings | URL, 자격 증명, 구성 데이터 찾기 |
| Generate Report | 포괄적인 보안 평가 |