PowerShell WebRequest Using Memory Stream
The following analytic detects the use of .NET classes in PowerShell to download a URL payload directly into memory, a common fileless malware staging technique. It leverages PowerShell Script Block Logging…
Description
The following analytic detects the use of .NET classes in PowerShell to download a URL payload directly into memory, a common fileless malware staging technique. It leverages PowerShell Script Block Logging (EventCode=4104) to identify suspicious PowerShell commands involving `system.net.webclient`, `system.net.webrequest`, and `IO.MemoryStream`. This activity is significant as it indicates potential fileless malware execution, which is harder to detect and can bypass traditional file-based defenses. If confirmed malicious, this technique could allow attackers to execute code in memory, evade detection, and maintain persistence in the environment.
Detection logic
Detection requirements
- Platform
- ESXiLinuxmacOSNetwork DevicesWindows
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
- No false positives have been identified at this time.
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
| Reference | Cited by |
|---|---|
| attack.mitre.org/techniques/T1059/001/ | 6 |
| thedfirreport.com/2022/05/09/seo-poisoning-a-gootloader-story/ | 8from 2 sources |
| www.mandiant.com/resources/blog/tracking-evolution-gootloader-operations | 5 |
From the source
- At source
- Open at source
- Upstream identifier
- 103affa6-924a-4b53-aff4-1d5075342aab
- Tagged by the source as
- Malicious PowerShellMedusa RansomwareMoonPeakPHP-CGI RCE Attack on Japanese OrganizationsEndpointendpointSplunk 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
- Aug 26, 2026
- Version
- 1