FortiSIEM Rules

Windows: Potential PsExec Remote Execution

Rule ID

PH_Rule_SIGMA_1608

Default Status

Enabled

Description

Detects potential psexec command that initiate execution on a remote systems via common commandline flags used by the utility. This rule is adapted from https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_sysinternals_psexec_remote_execution.yml

Severity

7

Category

Security

MITRE ATT&CK® Tactics

Resource Development

Resource Development consists of techniques that involve adversaries creating, purchasing, or compromising/stealing resources that can be used to support targeting. Such resources include infrastructure, accounts, or capabilities. These resources can be leveraged by the adversary to aid in other phases of the adversary lifecycle, such as using purchased domains to support Command and Control, email accounts for phishing as a part of Initial Access, or stealing code signing certificates to help with Defense Evasion.

https://attack.mitre.org/tactics/TA0042

MITRE ATT&CK® Techniques


T1587.001

Develop Capabilities: Malware

Before compromising a victim, adversaries may develop malware and malware components that can be used during targeting. Building malicious software can include the development of payloads, droppers, post-compromise tools, backdoors, packers, C2 protocols, and the creation of infected removable media. Adversaries may develop malware to support their operations, creating a means for maintaining control of remote machines, evading defenses, and executing post-compromise behaviors.

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

Impacts

Server

Data Source

Windows Sysmon via FortiSIEM Agent

Detection

Correlation

Remediation Guidance

Investigate whether the user needs to really run psexec.py on the specific host. Typically system administrators need these utilities to do their work. psexec.py may be bundled with other software. If necessary, rebuild the host from a known, good source and have the user change their password.

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 ".*accepteula.*" AND command REGEXP ".* -u .*" AND command REGEXP ".* -p .*" AND command REGEXP ".* \\\\.*"

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