PowerShell 4104 Hunting
The following analytic identifies suspicious PowerShell execution using Script Block Logging (EventCode 4104). It leverages specific patterns and keywords within the ScriptBlockText field to detect potentially…
Description
The following analytic identifies suspicious PowerShell execution using Script Block Logging (EventCode 4104). It leverages specific patterns and keywords within the ScriptBlockText field to detect potentially malicious activities. This detection is significant for SOC analysts as PowerShell is commonly used by attackers for various malicious purposes, including code execution, privilege escalation, and persistence. If confirmed malicious, this activity could allow attackers to execute arbitrary commands, exfiltrate data, or maintain long-term access to the compromised system, posing a severe threat to the organization's security.
Detection logic
Detection requirements
- Platform
- LinuxmacOSWindows
The rule states no platform. This is derived from the 3 ATT&CK techniques it maps to.
- Log source category
- powershell_script_block_logging_4104
Known benign triggers
- Limited false positives. May filter as needed.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
From the source
- At source
- Open at source
- Upstream identifier
- d6f2b006-0041-11ec-8885-acde48001122
- Tagged by the source as
- 0bj3ctivity StealerAPT37 Rustonotto and FadeStealerAxios Supply Chain Post CompromiseBraodo StealerCactus RansomwareChina-Nexus Threat ActivityCISA AA23-347ACISA AA24-241ACleo File Transfer SoftwareDarkGate MalwareData DestructionFlax TyphoonGhostRedirector IIS Module and Rungan BackdoorHellcat RansomwareHermetic WiperInterlock RansomwareLumma StealerMalicious PowerShellMedusa RansomwareMicrosoft WSUS CVE-2025-59287MuddyWaterPhantom StealerPHP-CGI RCE Attack on Japanese OrganizationsRhysida RansomwareSalat StealerSalt TyphoonScattered SpiderStarland RAT CampaignSystemBCWater GamayunXWormEndpointendpointSplunk CloudSplunk EnterpriseSplunk Enterprise Securityendpoint
Licence
- Published under
- Apache License 2.0Read the licence
- Attribution
- Required
- Obtained under
- Apache-2.0Read the origin licence
Authorship
- Written by
- Published
- Sep 8, 2026
- Version
- 4