Detect Spearphishing Link in CrowdStrike LogScale
Adversaries may send spearphishing emails with a malicious link in an attempt to gain access to victim systems. Unlike spearphishing attachments, this variant embeds URLs in email body text, requiring the recipient to actively click or paste the link into a browser. Clicked links may deliver browser exploits, prompt downloads of malware or scripts, or harvest credentials via convincing login pages. Advanced variants include OAuth consent phishing (abusing OAuth 2.0 authorization flows to steal application access tokens), device code phishing (abusing OAuth 2.0 device authorization grant to obtain persistent tokens), and IDN homograph attacks where lookalike Unicode domains impersonate trusted brands. URLs may also be obfuscated via URL shorteners, integer-format IP addresses (e.g., hxxp://1157586937), or the @ symbol trick. Threat actors including Kimsuky, MuddyWater, BlackTech, LuminousMoth, DarkGate, and Squirrelwaffle have extensively leveraged this technique.
MITRE ATT&CK
- Tactic
- Initial Access
- Technique
- T1566 Phishing
- Sub-technique
- T1566.002 Spearphishing Link
- Canonical reference
- https://attack.mitre.org/techniques/T1566/002/
LogScale Detection Query
#event_simpleName=ProcessRollup2
| ParentBaseFileName = /(?i)^(outlook|thunderbird|teams|msoutlook|msedge|chrome|firefox|iexplore|opera|brave|mshta)\.exe$/
| FileName = /(?i)^(powershell|pwsh|cmd|wscript|cscript|mshta|rundll32|regsvr32|msiexec|certutil|bitsadmin|curl|wget)\.exe$/
| CommandLine != /(?i)(--type=renderer|--type=utility|--type=gpu-process|--type=crashpad-handler|--extension-process|NativeMessagingHost|MicrosoftEdgeUpdate|GoogleUpdate|ChromeSetup|EdgeUpdate)/
| not (FileName = /(?i)msiexec\.exe$/ AND CommandLine = /(?i)(MicrosoftEdgeUpdate|GoogleUpdate|ChromeSetup|EdgeUpdate)/)
| eval DetectionVector = case(
ParentBaseFileName = /(?i)(outlook|thunderbird|teams|msoutlook)\.exe$/, "EmailClientDirectSpawn",
ParentBaseFileName = /(?i)mshta\.exe$/, "MshtaChainSpawn",
ParentBaseFileName = /(?i)(msedge|chrome|firefox|iexplore|opera|brave)\.exe$/, "BrowserSpawnedSuspiciousProcess",
true(), "Unknown"
)
| eval RiskScore = case(
ParentBaseFileName = /(?i)mshta\.exe$/, 90,
ParentBaseFileName = /(?i)(outlook|thunderbird|teams)\.exe$/, 85,
ParentBaseFileName = /(?i)(msedge|chrome|firefox|iexplore|opera|brave)\.exe$/ AND FileName = /(?i)(powershell|wscript|cscript|mshta)\.exe$/, 75,
true(), 60
)
| groupBy([ComputerName, UserName, ParentBaseFileName, FileName, CommandLine, DetectionVector, RiskScore], function=count(as=EventCount))
| sort(RiskScore, order=desc) CrowdStrike LogScale (CQL) query using Falcon ProcessRollup2 events to detect T1566.002 spearphishing link follow-on execution. Identifies email clients, browsers, and mshta.exe spawning suspicious scripting or execution tools. Includes detection vector classification and risk scoring consistent with the KQL and SPL reference detections.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate URL protocol handler invocations from browsers (e.g., clicking a ms-appinstaller:// or ms-excel:// link) that cause the browser to spawn msiexec or a scripting engine as part of an approved application launch
- Enterprise productivity suites with Teams or Outlook add-ins that automate business workflows by launching PowerShell or cmd.exe (e.g., CRM integration scripts, HR system connectors)
- Security awareness training platforms or phishing simulation tools (e.g., KnowBe4, Proofpoint Security Awareness) that may trigger these parent-child process chains as part of simulated phishing campaigns
Other platforms for T1566.002
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Email Client Spawning PowerShell via Link Handler
Expected signal: Sysmon Event ID 1: Process Create — Image=powershell.exe, CommandLine contains '-WindowStyle Hidden' and 'Net.WebClient' and 'DownloadString'. Sysmon Event ID 3: Network connection attempt to 127.0.0.1:8080 (connection refused). Security Event ID 4688 if command line auditing is enabled. PowerShell ScriptBlock Log Event ID 4104 with full script content.
- Test 2Browser Spawning MSHTA via HTA File Download
Expected signal: Sysmon Event ID 1: Process Create — Image=mshta.exe, ParentImage=msedge.exe (or cmd.exe depending on Edge's open handler). Sysmon Event ID 11: File creation event for df00tech-test.hta in %TEMP%. Security Event ID 4688 for mshta.exe process creation with full command line including path to HTA file.
- Test 3OAuth Device Code Phishing Flow Initiation
Expected signal: Sysmon Event ID 1: Process Create — Image=powershell.exe, CommandLine contains 'devicecode' and 'login.microsoftonline.com'. Sysmon Event ID 3: Network connection to login.microsoftonline.com on port 443. Sysmon Event ID 22: DNS query for login.microsoftonline.com. Azure AD sign-in logs: device code flow request entry visible in non-interactive sign-in logs for the test client_id (04b07795 is the Azure CLI client ID, a well-known public client).
- Test 4Malicious Link Payload Drop Simulation
Expected signal: Sysmon Event ID 11: File creation in %TEMP% for Invoice_2026-03-12.pdf.cmd (double extension with .cmd as final extension). Sysmon Event ID 1: Process Create — Image=cmd.exe, CommandLine references the %TEMP% staged file path, ParentImage=powershell.exe. Security Event ID 4688 for both powershell.exe and cmd.exe. The temporal pattern of PowerShell network activity followed by file creation in staging dir followed by cmd.exe execution matches the hunting query for email client network + file drop correlation.
References (11)
- https://attack.mitre.org/techniques/T1566/002/
- https://us-cert.cisa.gov/ncas/tips/ST05-016
- https://www.mandiant.com/resources/blog/url-obfuscation-schema-abuse
- https://www.microsoft.com/security/blog/2021/07/14/microsoft-delivers-comprehensive-solution-to-battle-rise-in-consent-phishing-emails/
- https://www.secureworks.com/blog/oauths-device-code-flow-abused-in-phishing-attacks
- https://www.netskope.com/blog/new-phishing-attacks-exploiting-oauth-authorization-flows-part-1
- https://www.optiv.com/insights/source-zero/blog/microsoft-365-oauth-device-code-flow-and-phishing
- https://docs.microsoft.com/en-us/microsoft-365/security/office-365-security/safe-links-about
- https://learn.microsoft.com/en-us/defender-xdr/advanced-hunting-urlclickevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1566.002/T1566.002.md
- https://blog.trendmicro.com/trendlabs-security-intelligence/pawn-storm-abuses-open-authentication-advanced-social-engineering-attacks
Unlock Pro Content
Get the full detection package for T1566.002 including response playbook, investigation guide, and atomic red team tests.