# 0xcyberberserker/ghosttrace-lab architecture

> Architecture diagram of the GitHub repository 0xcyberberserker/ghosttrace-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xcyberberserker/ghosttrace-lab
- Repository: https://github.com/0xcyberberserker/ghosttrace-lab

## Overview

GhostTrace is a reverse-engineering and malware-analysis workspace centered on uploading a sample, running Ghidra static analysis, and presenting persistent job status and findings. The operator can enrich analysis with sandbox/debugger evidence, generate cached triage reports, and develop reconstruction targets, hypotheses, and draft artifacts. The README documents the broader service topology, including Ollama, RabbitMQ, and the Windows lab; those links are shown as documented rather than inferred from unsampled implementation. The excerpts establish key route and service relationships, but do not expose every runtime path.

Main entry points: [`webui/app.py`](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/app.py) (Flask API), [`Ghidraaas/flask_api.py`](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/flask_api.py) (Ghidra service), [`sandbox/runner/app.py`](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/sandbox/runner/app.py) (Sandbox runner), [`webui/job_service.py`](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_service.py) (Job service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator workspace"]
  node_browser["Web interface<br/>[analysis.js]"]
  node_webapp["Flask API<br/>[app.py]"]
end

subgraph group_analysis["Static analysis"]
  node_ghclient["Ghidra client<br/>[ghidra_client.py]"]
  node_ghidraapi["Ghidra service<br/>[flask_api.py]"]
  node_decompile["Decompilation"]
  node_functions["Function listing<br/>[FunctionsList.py]"]
  node_functions_alt["Function listing<br/>[FunctionsListA.py]"]
  node_imports["Import listing<br/>[ImportsList.py]"]
  node_strings["String listing<br/>[StringsList.py]"]
end

subgraph group_insight["Evidence and reasoning"]
  node_triage["Triage report<br/>[triage_report.py]"]
  node_assistant["Analysis assistant"]
  node_guidance["Assistant guidance"]
  node_reconstruction["Reconstruction service"]
  node_reconstruction_records["Reconstruction records"]
end

subgraph group_operations["Jobs and orchestration"]
  node_jobservice["Job service<br/>[job_service.py]"]
  node_jobstore[("Job store<br/>[job_store.py]")]
  node_jobstatus["Job status<br/>[job_status.py]"]
  node_webqueue["Triage queue<br/>[task_queue.py]"]
  node_webworker["Triage worker<br/>[worker.py]"]
end

subgraph group_lab["Sandbox and debugging"]
  node_sandbox_client["Sandbox client<br/>[sandbox_client.py]"]
  node_runner["Sandbox runner<br/>[app.py]"]
  node_sandbox_worker["Sandbox worker<br/>[worker.py]"]
end

node_operator(("Operator"))
node_ollama["Ollama LLM"]
node_rabbitmq["RabbitMQ"]
node_windows["Windows lab"]
node_debugger["x64dbg bridge"]

node_operator -->|"uses"| node_browser
node_browser -->|"sends requests"| node_webapp
node_webapp -->|"routes job operations"| node_jobservice
node_jobservice -->|"records jobs"| node_jobstore
node_jobservice -->|"resolves status"| node_jobstatus
node_jobservice -->|"queries analysis"| node_ghclient
node_ghclient -->|"calls REST API"| node_ghidraapi
node_ghidraapi -.->|"provides decompilation"| node_decompile
node_ghidraapi -.->|"provides functions"| node_functions
node_ghidraapi -.->|"provides functions"| node_functions_alt
node_ghidraapi -.->|"provides imports"| node_imports
node_ghidraapi -.->|"provides strings"| node_strings
node_webapp -->|"queues triage"| node_webqueue
node_webworker -->|"runs reports"| node_triage
node_triage -->|"fetches analysis"| node_ghidraapi
node_webapp -->|"generates targets"| node_reconstruction
node_reconstruction -->|"uses records"| node_reconstruction_records
node_webapp -->|"serves assistant"| node_assistant
node_webapp -->|"builds guidance"| node_guidance
node_assistant -->|"requests reasoning"| node_ollama
node_webapp -->|"routes sandbox calls"| node_sandbox_client
node_sandbox_client -->|"sends HTTP requests"| node_runner
node_runner -->|"forwards evidence"| node_webapp
node_runner -->|"queues sandbox work"| node_rabbitmq
node_sandbox_worker -->|"starts queue worker"| node_runner
node_windows -->|"shares bridge state"| node_runner
node_windows -->|"provides debugger context"| node_debugger
node_runner -->|"exchanges findings"| node_debugger
node_webapp -->|"reads and writes state"| node_jobstore

click node_browser "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/static/js/analysis.js"
click node_webapp "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/app.py"
click node_jobservice "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_service.py"
click node_jobstore "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_store.py"
click node_jobstatus "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_status.py"
click node_webqueue "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/task_queue.py"
click node_webworker "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/worker.py"
click node_ghclient "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/ghidra_client.py"
click node_ghidraapi "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/flask_api.py"
click node_decompile "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionDecompile.py"
click node_functions "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionsList.py"
click node_functions_alt "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionsListA.py"
click node_imports "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/ImportsList.py"
click node_strings "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/StringsList.py"
click node_triage "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/triage_report.py"
click node_assistant "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/ghidra_assistant.py"
click node_guidance "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/assistant_guidance.py"
click node_reconstruction "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/reconstruction_service.py"
click node_reconstruction_records "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/reconstruction_record.py"
click node_sandbox_client "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/sandbox_client.py"
click node_runner "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/sandbox/runner/app.py"
click node_sandbox_worker "https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/sandbox/runner/worker.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser,node_webapp toneBlue
class node_ghclient,node_ghidraapi,node_decompile,node_functions,node_functions_alt,node_imports,node_strings toneAmber
class node_triage,node_assistant,node_guidance,node_reconstruction,node_reconstruction_records toneMint
class node_jobservice,node_jobstore,node_jobstatus,node_webqueue,node_webworker toneRose
class node_sandbox_client,node_runner,node_sandbox_worker,node_operator,node_ollama,node_rabbitmq,node_windows,node_debugger toneIndigo
```

## Components

### Operator workspace

- [Web interface](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/static/js/analysis.js): `webui/static/js/analysis.js`
- [Flask API](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/app.py): `webui/app.py`

### Static analysis

- [Ghidra client](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/ghidra_client.py): `webui/ghidra_client.py`
- [Ghidra service](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/flask_api.py): `Ghidraaas/flask_api.py`
- [Decompilation](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionDecompile.py): `Ghidraaas/ghidra_plugins/FunctionDecompile.py`
- [Function listing](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionsList.py): `Ghidraaas/ghidra_plugins/FunctionsList.py`
- [Function listing](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/FunctionsListA.py): `Ghidraaas/ghidra_plugins/FunctionsListA.py`
- [Import listing](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/ImportsList.py): `Ghidraaas/ghidra_plugins/ImportsList.py`
- [String listing](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/Ghidraaas/ghidra_plugins/StringsList.py): `Ghidraaas/ghidra_plugins/StringsList.py`

### Evidence and reasoning

- [Triage report](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/triage_report.py): `webui/triage_report.py`
- [Analysis assistant](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/ghidra_assistant.py): `webui/ghidra_assistant.py`
- [Assistant guidance](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/assistant_guidance.py): `webui/assistant_guidance.py`
- [Reconstruction service](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/reconstruction_service.py): `webui/reconstruction_service.py`
- [Reconstruction records](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/reconstruction_record.py): `webui/reconstruction_record.py`

### Jobs and orchestration

- [Job service](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_service.py): `webui/job_service.py`
- [Job store](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_store.py): `webui/job_store.py`
- [Job status](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/job_status.py): `webui/job_status.py`
- [Triage queue](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/task_queue.py): `webui/task_queue.py`
- [Triage worker](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/worker.py): `webui/worker.py`

### Sandbox and debugging

- [Sandbox client](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/webui/sandbox_client.py): `webui/sandbox_client.py`
- [Sandbox runner](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/sandbox/runner/app.py): `sandbox/runner/app.py`
- [Sandbox worker](https://github.com/0xcyberberserker/ghosttrace-lab/blob/main/sandbox/runner/worker.py): `sandbox/runner/worker.py`

### Other components

- **Operator**
- **Ollama LLM**
- **RabbitMQ**
- **Windows lab**
- **x64dbg bridge**

## Connections

- Operator → Web interface: uses
- Web interface → Flask API: sends requests
- Flask API → Job service: routes job operations (evidence: `webui/app.py`)
- Job service → Job store: records jobs (evidence: `webui/job_service.py`)
- Job service → Job status: resolves status (evidence: `webui/job_service.py`)
- Job service → Ghidra client: queries analysis (evidence: `webui/job_service.py`)
- Ghidra client → Ghidra service: calls REST API (evidence: `webui/ghidra_client.py`)
- Ghidra service → Decompilation: provides decompilation
- Ghidra service → Function listing: provides functions
- Ghidra service → Function listing: provides functions
- Ghidra service → Import listing: provides imports
- Ghidra service → String listing: provides strings
- Flask API → Triage queue: queues triage (evidence: `webui/app.py`)
- Triage worker → Triage report: runs reports (evidence: `webui/worker.py`)
- Triage report → Ghidra service: fetches analysis (evidence: `webui/triage_report.py`)
- Flask API → Reconstruction service: generates targets (evidence: `webui/app.py`)
- Reconstruction service → Reconstruction records: uses records (evidence: `webui/reconstruction_service.py`)
- Flask API → Analysis assistant: serves assistant (evidence: `webui/app.py`)
- Flask API → Assistant guidance: builds guidance (evidence: `webui/app.py`)
- Analysis assistant → Ollama LLM: requests reasoning
- Flask API → Sandbox client: routes sandbox calls (evidence: `webui/app.py`)
- Sandbox client → Sandbox runner: sends HTTP requests (evidence: `webui/sandbox_client.py`)
- Sandbox runner → Flask API: forwards evidence (evidence: `sandbox/runner/app.py`)
- Sandbox runner → RabbitMQ: queues sandbox work
- Sandbox worker → Sandbox runner: starts queue worker (evidence: `sandbox/runner/worker.py`)
- Windows lab → Sandbox runner: shares bridge state
- Windows lab → x64dbg bridge: provides debugger context
- Sandbox runner → x64dbg bridge: exchanges findings
- Flask API → Job store: reads and writes state (evidence: `webui/app.py`)
