Skip to content

About

Defensive malware analysis with REA, Ghidra, and Codex: evidence-based case studies, reports, and setup guides supporting the Code Geeks blog.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Malware analysis with REA, Ghidra, and Codex

Case studies and setup documentation supporting the Code Geeks blog. The focus is defensive behavior reconstruction and evidence-based reporting with an AI-assisted workflow.

Potentially harmful research content: reports describe malicious behavior and include defanged indicators. This repository distributes documentation, not malware. Analyze samples only in a disposable isolated lab with appropriate authorization. Installation instructions do not authorize execution or contact with sample infrastructure. See publication and legal considerations and SECURITY.md.

Start here

  1. Install REA, Ghidra, and their prerequisites on macOS Apple Silicon.
  2. Read the case report and case notes.
  3. Use the adapted investigation prompt below only after preparing and checking an isolated lab.

REA exposes tools to Codex through MCP and uses its own Ghidra bridge for native analysis:

Codex -> REA MCP -> REA Ghidra bridge -> Ghidra headless
                -> REA JavaScript analysis tools

Ghidra is the selected open-source native backend. A separate ghidra-rpc server is unnecessary. The repository contains no vendored skills, tool distributions, installers or machine-specific configuration. The installation guide uses generic user paths and distinguishes historical validation from steps not replayed on a clean machine.

Repository layout

README.md                              General guide, sample catalog and prompt
AGENTS.md                              Instructions for agents working here
GLOSSARY.md                            Case terminology
LICENSE                                License for original documentation
SECURITY.md                            Research concerns and reporting
cases/infostealer-5ecd3cba/
  REPORT.md                            Findings, provenance and limitations
  CASE_NOTES.md                        Method, timeline and checks
docs/
  installation-macos-arm64.md           Detailed host tool setup
  publication-review.md                Publication boundary and legal review
  adr/                                 Recorded publication decision
samples/                               LOCAL ONLY: originals and malicious derivatives
.private/                              LOCAL ONLY: raw evidence, helpers and original notes

Only the documentation is intended for publication. samples/ and .private/ are excluded from Git and will not appear in a fresh clone. The allowlist in .gitignore also excludes unexpected files by default; adding a new public document requires updating it. Git ignore rules are not access controls and can be overridden by force-adding files. Review the staged contents before any publication.

Local sample catalog

Metadata is public; archive and executable contents are not distributed. Currently retained: one original sample archive. Extracted and decoded components belong to the same case and are kept under its private samples/ directory.

Case Local ZIP under samples/ Contents Unzip password Sample SHA-256
infostealer-5ecd3cba 5ecd3cbaa22a3298feebd051e9230103009dcd55eeaeeedc8f6473387eae0d55/5ecd3cbaa22a3298feebd051e9230103009dcd55eeaeeedc8f6473387eae0d55.zip One encrypted entry: 5ecd3cbaa22a3298feebd051e9230103009dcd55eeaeeedc8f6473387eae0d55.exe, a 98,092,544-byte Windows x64 Bun executable infected 5ecd3cbaa22a3298feebd051e9230103009dcd55eeaeeedc8f6473387eae0d55

ZIP SHA-256: 8f51e99dc0191a357f0dee0c1b453746af773ed19332235375e3224befb6e28e. The archive directory confirms one encrypted EXE entry; its declared size matches the retained EXE. The password is supplied by the analyst and was not retested by extracting the archive during this refactor. The original EXE hash was rechecked after relocation. The password is a handling convention, not protection that makes malware safe.

No download or extraction of samples is needed to read this repository.

Case: infostealer-5ecd3cba

Companion article: Static malware analysis with REA, Ghidra, and Codex (Italian).

The static investigation took place on 2026-10-17 in an isolated Linux/amd64 Docker lab. It identified a Bun JavaScript loader inside a Windows executable. Following initial PE inspection, the analysis focused on a 345,177-byte embedded JavaScript bundle; the roughly 98 MB native executable was not fully decompiled.

The code supports screenshot and telemetry collection, encrypted PE downloads, loading within the loader's own process, and a conditional deployment branch for a component named “miner.” It does not establish credential theft, actual mining, completed persistence or a specific infostealer family. The case name preserves the initial suspicion rather than a confirmed attribution.

The malware was not executed; its endpoints were not contacted and remote payloads were not acquired. The report contains the findings and the notes explain the method. Supporting artifacts remain private, so the public texts support review of the reasoning but not a complete independent replay.

The investigation prompt

This is the adapted English prompt from the companion article, with a sample-path placeholder. It is not a verbatim transcript of the original request. The prompt establishes both the questions and the limits of the investigation:

Use REA to statically analyze /path/to/case/sample.exe.
The sample is suspected to be an infostealer: check what evidence
in the available code supports that classification.

Work in the prepared Docker lab, with no network access and the sample
mounted read-only. Verify isolation before opening the sample.
Do not execute the malware or extracted code, do not use Wine, and do
not contact any endpoints found in the sample.

Produce a Markdown report covering:
- sample hashes and identification;
- directories and files created or merely referenced;
- processes started, enumerated, or modified;
- persistence, distinguishing configuration from demonstrated creation;
- domains, URLs, any DGA, and server-switching mechanisms;
- payload downloads and any updates;
- defensive indicators, with roles and code references;
- analysis limitations and unavailable components.

Distinguish operations inferred from code from observed behavior.
Preserve the evidence and stop the container when finished.

The analyst verified extraction boundaries, hashes, string-table rotations and an independent decoder comparison. A prompt and an agent summary alone are not proof of behavior. Read the report's coverage and confidence statements before using indicators for incident response.

Contributing and publishing

Each published case contains only its report and notes. Retain original samples and malicious derivatives under ignored samples/; retain raw evidence and analyst helpers under ignored .private/. Record hashes, offsets, conditions and uncertainty. Separate code-derived findings, dynamic observations and externally reported claims.

Before publishing, review the publication checks and the actual staged file list. Original documentation is licensed under CC BY 4.0; third-party tools and artifacts retain their own rights. The documentation license grants no rights to samples or third-party code and provides no legal authorization to analyze a target.

About

Defensive malware analysis with REA, Ghidra, and Codex: evidence-based case studies, reports, and setup guides supporting the Code Geeks blog.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Contributors