FortiSIEM Rules

Windows: PowerShell DownloadFile

Rule ID

PH_Rule_SIGMA_585

Default Status

Enabled

Description

Detects the execution of powershell, a WebClient object creation and the invocation of DownloadFile in a single command line. This rule is adapted from https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_susp_ps_downloadfile.yml

Severity

7

Category

Security

MITRE ATT&CK® Tactics

Command And Control

MITRE ATT&CK® Techniques


T1059.001

Command and Scripting Interpreter: PowerShell

Adversaries may abuse PowerShell commands and scripts for execution. Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code.

https://attack.mitre.org/techniques/T1059/001

T1104

Multi-Stage Channels

Adversaries may create multiple stages for command and control that are employed under different conditions or for certain functions. Remote access tools will call back to the first-stage command and control server for instructions. The first stage may have automated capabilities to collect basic host information, update tools, and upload additional files. A second remote access tool (RAT) could be uploaded at that point to redirect the host to the second-stage command and control server. Use of multiple stages may obfuscate the command and control channel to make detection more difficult.

https://attack.mitre.org/techniques/T1104

T1105

Ingress Tool Transfer

Adversaries may transfer tools or other files from an external system into a compromised environment. Files may be copied from an external adversary controlled system through the command and control channel to bring tools into the victim network or through alternate protocols with another tool such as FTP. Files can also be copied over on Mac and Linux with native tools like scp, rsync, and sftp.

https://attack.mitre.org/techniques/T1105

Impacts

Server

Data Source

Windows Sysmon via FortiSIEM Agent

Detection

Correlation

Remediation Guidance

No remediation guidance specified

Time Window

If the following pattern or patterns match an ingested event within the given time window in seconds, trigger an incident.

300 seconds

Trigger Conditions

If the following defined pattern/s occur within a 300 second time window.

Filter

SubPattern Definitions

SubPattern Name: Filter

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

eventType="Win-Sysmon-1-Create-Process" AND command REGEXP ".*powershell.*" AND command REGEXP ".*\.DownloadFile.*" AND command REGEXP ".*System\.Net\.WebClient.*"

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

command,hostName

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1

Incident Attribute Mapping

This section defines which fields in matching raw events should be mapped to the incident attributes in the resulting incident.

The available raw event attributes to map are limited to the group by attributes and the aggregate event constraint fields for each subpattern

 command = Filter.command,
hostName = Filter.hostName