Detection of PowerShell Download Patterns
This brief details a detection strategy for identifying PowerShell command-line activity associated with common file download patterns used by various threat actors.
This detection focuses on identifying suspicious use of the .NET WebClient class within PowerShell to download files or strings from the internet. This technique is frequently utilized by threat actors during the initial access or post-exploitation phases to fetch secondary payloads, modular malware, or remote access trojans (RATs). While the use of PowerShell for legitimate administrative tasks is common, the specific combination of 'new-object', 'net.webclient', and 'download' methods within the command line is highly indicative of malicious activity. This detection is designed to capture standard PowerShell (powershell.exe), PowerShell ISE (powershell_ise.exe), and PowerShell Core (pwsh.exe).
Impact
Successful exploitation of this technique allows attackers to download and execute arbitrary code on a compromised host. This can lead to full system compromise, exfiltration of sensitive information, or the deployment of ransomware. Attackers leverage these patterns to maintain stealth while bypassing standard file-based security controls by executing payloads directly into memory or saving them to temporary directories.
Recommendation
Deploy the provided Sigma rule to your SIEM and tune it to baseline legitimate administrative scripts that may utilize .NET classes. Ensure that PowerShell script block logging (Event ID 4104) is enabled, as it provides higher visibility into obfuscated command lines that might bypass simple process-creation based detection.
Immediate actions
Deploy the Sigma rule to the SIEM and monitor for high-volume hits that may indicate legitimate internal tooling.
Threat Hunt
Search for historical process creation events containing 'net.webclient' in the command line over the past 30 days.
Data: Process creation telemetry
Detection coverage 1
Detect Suspicious PowerShell Download Patterns
mediumDetects a PowerShell process that contains download commands in its command line string using .NET WebClient class
Detection queries are available on the platform. Get full rules →