<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: performing-static-binary-analysis
description: >-
  Perform static analysis on compiled binaries to identify functions, strings, imports, and control flow without executing the target.
domain: cybersecurity
subdomain: reverse-engineering
tags:
  - static-analysis
  - disassembly
  - binary-analysis
  - ghidra
  - radare2
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1027"]
  cwe: ["CWE-506"]
  tools: ["Ghidra", "radare2", "objdump", "strings", "LIEF"]
---

# Performing Static Binary Analysis

## Overview

Perform static analysis on compiled binaries to identify functions, strings, imports, and control flow without executing the target.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `Ghidra` | Security tooling |
| `radare2` | Security tooling |
| `objdump` | Security tooling |
| `strings` | Security tooling |
| `LIEF` | Security tooling |
| Isolated lab environment for testing | Environment requirement |
| Authorization and signed Rules of Engagement (RoE) | Environment requirement |
| Relevant target samples or systems acquired through authorized channels | Environment requirement |

## Quick Reference

```bash
# Extract strings from binary
strings -a -n 8 ./target | sort -u > strings.txt

# Analyze with radare2
r2 -A ./target
[0x00401000]> afl        # list functions
[0x00401000]> pdf @main  # disassemble main
[0x00401000]> iz         # list strings

# ELF header analysis
readelf -h ./target
readelf -S ./target
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
ghidra --version 2>/dev/null || echo "Install Ghidra"

# Set up working directory
mkdir -p /tmp/performing-static-binary-analysis/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with Ghidra
# Refer to Quick Reference above for detailed commands
echo "[*] Running Performing Static Binary Analysis with Ghidra..."

# Log all operations
script -q /tmp/performing-static-binary-analysis/logs/session.log
```

### Step 3: Deep Investigation

```bash
# Apply radare2 for secondary analysis
echo "[*] Deep investigation with radare2..."

# Cross-reference findings
diff /tmp/performing-static-binary-analysis/output/primary.json /tmp/performing-static-binary-analysis/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/performing-static-binary-analysis/output/report.json
{
  "technique": "performing-static-binary-analysis",
  "domain": "reverse-engineering",
  "tools_used": ["Ghidra", "radare2"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: Static Binary Analysis Detection
id: 6d8d97f1-0216-48ce-a540-9a9661f6556d
status: experimental
description: Detects suspicious activity related to performing static binary analysis techniques in reverse engineering context
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine: "*performing*static*"
  condition: selection
level: medium
tags:
  - attack.t1027
  - attack.defense_evasion
falsepositives:
  - Malware analysis sandbox performing automated binary inspection
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Static Binary Analysis Detection | windows/process_creation | Sigma rule (medium) |
| ATT&CK Coverage | MITRE ATT&CK | T1027 |

## Verification

- [ ] Environment and tools verified and operational
- [ ] Target samples acquired through authorized channels
- [ ] Primary analysis completed with findings documented
- [ ] Secondary validation performed with independent tooling
- [ ] All artifacts preserved in structured output directory
- [ ] Detection opportunities documented for blue team

## References

- [MITRE ATT&CK T1027](https://attack.mitre.org/techniques/T1027) — Related technique
- [Ghidra Documentation](https://ghidra.org/) — Primary tooling
- [radare2 Reference](https://radare2.org/) — Secondary tooling
