Skip to main content
SOC Scenarios: Phishing-to-Persistence Investigation
Lesson 13 of 13

SOC Scenarios: Phishing-to-Persistence Investigation

Correlate email, endpoint, network, and binary artifacts across a phishing-to-persistence intrusion timeline, apply Sigma and YARA rules for scoping, and execute ordered incident containment.

Advanced 36 min Blue Team / SOC

Learning objectives

  • Reconstruct an end-to-end phishing-to-persistence attack timeline using normalized UTC events across multiple log sources
  • Pivot backward and forward from a trigger alert using shared identifiers such as ProcessGuid, user account, and SHA-256 hash
  • Apply Sigma rules and YARA signatures during live triage to scope affected hosts and classify dropped files
  • Execute containment, eradication, and post-incident hardening steps without destroying volatile evidence or tipping off the intruder

Recommended first: Alert Triage, False Positives & Incident EscalationDetection Engineering & Portable Rules with SigmaWriting & Tuning YARA Rules for Artifact DetectionHypothesis-Driven Threat Hunting

#Why this matters

Real intrusions rarely present themselves as a single self-explanatory alert. A Tier 2 SOC analyst usually starts from one medium-confidence signal, such as an encoded PowerShell process or an outbound HTTP request to an unfamiliar domain. Within minutes, the analyst must determine whether that alert is harmless administrative noise or one link in an active compromise.

Handling an incident end to end requires moving fluidly across telemetry silos. You must trace an intrusion backward to initial phishing delivery, trace forward to payload staging and persistence, sweep the wider fleet with Sigma and YARA, and contain every affected asset in the right order.

#Anatomy of a phishing-to-persistence chain

Most workplace compromises follow a recognizable sequence of MITRE ATT&CK stages, each leaving distinct telemetry across different sensors:

Phishing-to-persistence intrusion and telemetry trailPhishing-to-persistence intrusion and telemetry trailMailGWEndpointC2SIEMDeliver spearphishing attachment (T1566.001)User opens document; winword.exe spawns powershell.exe (T1059.001)Fetch secondary payload over HTTPS (T1105 / T1071.001)Write binary and add Registry Run key (T1547.001)Forward Sysmon 1, 3, 11, 13 and DNS/Proxy logs

Because no single log source captures the whole story, analysts map each stage to its primary telemetry and pivot fields:

Intrusion stage ATT&CK technique Primary telemetry Key pivot fields
Initial access T1566.001 Spearphishing Attachment Email gateway logs sender, recipient, attachment_sha256
Execution T1059.001 PowerShell Sysmon Event ID 1 / Win 4688 Computer, User, ParentProcessGuid, CommandLine
Payload staging T1105 Ingress Tool Transfer Sysmon Event ID 3 & 11, Proxy/DNS DestinationIp, QueryName, TargetFilename, Hashes
Persistence T1547.001 Run Key / T1053.005 Task Sysmon Event ID 13 / Win 4698 TargetObject, Details, TaskName

#Pivoting across multi-source logs

The core rule of timeline reconstruction is normalize to UTC first. Workstations, email gateways, and proxies may log in different local time zones; comparing unnormalized timestamps leads to broken causality.

Once timestamps are aligned in UTC, pivot backward from the trigger alert to establish root cause, then pivot forward to measure full impact:

Reconstructing a UTC timeline from exported SIEM logs on a lab host
$ jq -r 'select(.Computer=="wks-014.lab.local") | [.UtcTime, .Source, .EventID, .Summary] | @tsv' soc-case07.jsonl | sort
2026-11-12T07:51:10Z	MailGW	MSG_DELIVER	to=d.karimov@example.test subj="Invoice_4091" sha256=9f86d081...
2026-11-12T07:54:03Z	Sysmon	1	Parent=winword.exe Image=powershell.exe Cmd="-NoP -W Hidden -Enc JABz..."
2026-11-12T07:54:05Z	DNS	QUERY	qname=cdn-sync.example.test src=10.10.10.14
2026-11-12T07:54:06Z	Sysmon	11	Image=powershell.exe Target=C:\Users\d.karimov\AppData\Local\Temp\sync_agent.exe
2026-11-12T07:54:08Z	Sysmon	13	Image=sync_agent.exe Target=HKCU\Software\Microsoft\Windows\CurrentVersion\Run\SyncSvc Details="C:\Users\d.karimov\AppData\Local\Temp\sync_agent.exe"

Every line connects cleanly to the next. Within three minutes of email delivery (07:51:10Z), winword.exe spawned a hidden PowerShell command, queried cdn-sync.example.test, wrote sync_agent.exe into AppData\Local\Temp, and registered an HKCU\...\Run persistence entry.

#Applying Sigma and YARA during live scoping

To sweep the rest of the environment rapidly, analysts pair behavioural Sigma rules in the SIEM with artifact-level YARA rules on collected or quarantined binaries.

A portable Sigma rule detects the Office-to-PowerShell execution pattern across SIEM backends without relying on a single file hash:

yaml
title: Suspicious PowerShell Spawned by Microsoft Word
id: 7b4e1c2a-91d4-4a62-8c1e-3f0a55b12d01
status: experimental
description: Detects winword.exe spawning powershell.exe during phishing execution
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    ParentImage|endswith: '\winword.exe'
    Image|endswith: '\powershell.exe'
  condition: selection
level: high

Meanwhile, when EDR or forensic collection retrieves suspicious binaries from Temp or AppData, a targeted YARA signature confirms whether samples share the same loader family and reveals sibling files on disk:

text
rule Lab_SyncAgent_Persistence_Marker {
    meta:
        description = "Detects lab training dropper referencing cdn-sync.example.test and Run key"
        author = "CyberSamSU SOC"
    strings:
        $mz = { 4D 5A }
        $dom = "cdn-sync.example.test" ascii wide nocase
        $run = "Software\\Microsoft\\Windows\\CurrentVersion\\Run" ascii wide
    condition:
        $mz at 0 and $dom and $run
}

Running YARA against the lab quarantine folder verifies which collected samples match the campaign:

Scanning collected lab artifacts with YARA
$ yara -r sync_agent.yar /lab/quarantine/case07/
Lab_SyncAgent_Persistence_Marker /lab/quarantine/case07/wks-014_sync_agent.exe
Lab_SyncAgent_Persistence_Marker /lab/quarantine/case07/wks-029_updater_tmp.exe

Notice what the YARA scan caught: a second host (wks-029) held the same payload under a different filename (updater_tmp.exe). Hash-only searching would have missed it if the binary had been recompiled or padded.

#Containment, eradication, and common mistakes

Order of operations matters during live incident response:

  1. Scope before tipping off the attacker: Check email recipients, DNS queries, and sibling hosts quietly before deleting messages or blocking domains that might warn an active operator.
  2. Isolate and preserve: Network-isolate compromised endpoints via EDR so the host stays powered on for memory or disk acquisition before wiping processes.
  3. Revoke identities: Reset passwords and revoke active OAuth or SSO refresh tokens for compromised accounts.
  4. Eradicate completely: Remove both the dropped binary and its persistence trigger (Run key, scheduled task, or service), then verify across a reboot.

Common mistakes that prolong incidents include:

  • Comparing mixed time zones: Building a timeline from local workstation time alongside UTC firewall logs, reversing cause and effect.
  • Deleting the file without removing persistence: Removing sync_agent.exe while leaving a scheduled task or downloader script intact allows automatic re-infection.
  • Reimaging before scoping: Wiping the first noisy host immediately destroys volatile memory and leaves undetected sibling infections running elsewhere on the subnet.
  • Relying solely on hash blocks: Blocking one SHA-256 while ignoring the underlying phishing sender, C2 domain, and behavioural Sigma pattern.

#Summary

  • End-to-end SOC investigations correlate email, process, network, and registry telemetry on a unified UTC timeline.
  • Analysts pivot backward from an alert to find initial access and forward to trace payload staging, C2 traffic, and persistence.
  • Combining behavioural Sigma queries with YARA artifact scans ensures scoping catches renamed or modified variants across the fleet.
  • Effective response follows a strict order: scope quietly, isolate and preserve evidence, revoke credentials, and eradicate both payloads and persistence mechanisms.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge