<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: analyzing-spear-phishing-campaigns
description: >-
  Analyze targeted spear phishing campaigns including email header forensics, payload analysis, and attribution techniques.
domain: cybersecurity
subdomain: social-engineering
tags:
  - spear-phishing
  - email-forensics
  - targeted-attacks
  - payload-analysis
  - attribution
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1566.001"]
  cwe: ["CWE-693"]
  tools: ["gophish", "king-phisher", "email-header-analyzer"]
---

# Analyzing Spear Phishing Campaigns

## Overview

Analyze targeted spear phishing campaigns including email header forensics, payload analysis, and attribution techniques.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `gophish` | Security tooling |
| `king-phisher` | Security tooling |
| `email-header-analyzer` | 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
# Initialize working environment
mkdir -p /tmp/analyzing-spear-phishing-campaigns/{output,logs,artifacts}

# Execute primary analysis with gophish
echo "[*] Running Analyzing Spear Phishing Campaigns with gophish..."

# Validate results with king-phisher
echo "[*] Cross-validating with king-phisher..."

# Generate summary report
cat /tmp/analyzing-spear-phishing-campaigns/output/report.json
```

## Workflow

### Step 1: Preparation and Reconnaissance

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

# Set up working directory
mkdir -p /tmp/analyzing-spear-phishing-campaigns/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with gophish
# Refer to Quick Reference above for detailed commands
echo "[*] Running Analyzing Spear Phishing Campaigns with gophish..."

# Log all operations
script -q /tmp/analyzing-spear-phishing-campaigns/logs/session.log
```

### Step 3: Deep Investigation

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

# Cross-reference findings
diff /tmp/analyzing-spear-phishing-campaigns/output/primary.json /tmp/analyzing-spear-phishing-campaigns/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/analyzing-spear-phishing-campaigns/output/report.json
{
  "technique": "analyzing-spear-phishing-campaigns",
  "domain": "social-engineering",
  "tools_used": ["gophish", "king-phisher"],
  "findings": [],
  "recommendations": []
}
EOF
```

## 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 T1566.001](https://attack.mitre.org/techniques/T1566/001) — Related technique
- [gophish Documentation](https://gophish.org/) — Primary tooling
- [king-phisher Reference](https://king-phisher.org/) — Secondary tooling
