Lab 20: Threat Hunting & Red Team Capstone

Objective

Execute a full red team engagement simulation and then switch to blue team — hunting for the traces left behind:

  1. Red Team — exploit a vulnerability chain: web recon → SQLi → shell upload → privesc → persistence

  2. Blue Team — use the attacker's own artefacts to detect, contain, and eradicate the compromise

  3. SIEM log correlation — correlate multiple log sources to build a complete attack picture

  4. Threat hunting hypothesis — develop and test hypotheses against log data

  5. Purple Team debrief — map every attack step to a MITRE ATT&CK technique and corresponding detection


Background

Threat hunting is proactive — you don't wait for an alert. You form a hypothesis ("if an attacker has lateral movement capability, they'll enumerate SMB shares") and go looking for evidence. The best threat hunters are ex-red teamers who know exactly what they'd do if they were attacking.

Real-world examples:

  • 2022 Uber breach — Uber's SIEM had the lateral movement data but no one was actively hunting; the attacker announced himself on Slack before detection. A threat hunting programme would have caught it in hour 1.

  • 2020 FireEye Red Team Tools Theft — FireEye threat hunters noticed an unusual OAuth token request at 12:44 AM that didn't match any known employee pattern. This was the initial detection of the SolarWinds campaign.

  • APT29 (Cozy Bear) — operates with a TTPs-over-tools philosophy; replaces common tools to evade signature detection. Threat hunting on behaviour (not signatures) is the only reliable detection method.

  • Purple team exercises — used by Netflix, Microsoft, and major banks; red team attacks a defined scope, blue team defends in real time, both sides debrief with full TTPs mapping afterward.

MITRE ATT&CK: Full Kill Chain — T1190, T1059, T1055, T1053, T1098, T1046, T1041


Architecture

Time

75 minutes


Lab Instructions

Step 1: Setup — Target with Full Logging


Step 2: RED TEAM — Execute the Attack Chain

📸 Verified Output:


Step 3: BLUE TEAM — Threat Hunting


Step 4: BLUE TEAM — Detection + Containment


Step 5: Purple Team Debrief — ATT&CK Mapping


Step 6: Cleanup


Remediation

Every vulnerability exploited in this lab has a clear fix:

Attack Step
Fix

SQLi via category=

Parameterised queries

Credential dump

Hash passwords (bcrypt); separate DB credentials from app logic

File upload

Validate filename/content; store outside webroot; disallow script extensions

RCE via /api/exec

Delete this endpoint — never expose shell=True over HTTP

No detection

WAF, IDS/IPS, SIEM with correlation rules, threat hunting programme

Further Reading

Last updated