FortiSIEM Rules

Windows: PsExec/PAExec Escalation to LOCAL SYSTEM

Rule ID

PH_Rule_SIGMA_1609

Default Status

Enabled

Description

Detects suspicious commandline flags used by PsExec and PAExec to escalate a command line to LOCAL_SYSTEM rights. PAExec is a remote administration tool designed as an alternative to Microsoft's PsExec. The tool is a small remote shell that includes functionality for copying files, remote execution, and fully interactive shell sessions with remote Windows machines without the need to install client software. It relies on the SMB protocol. The tool copies an executable to the hidden Admin$ share and then uses the Windows Service Control Manager API to start it as a service. The service uses named pipes, which connect back to the PAExec tool. It can be freely distributed. PAExec is self-contained and doesn't use an installer. This rule is adapted from https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_sysinternals_psexec_paexec_escalate_system.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 PAExec or PsExec. Typically system administrators need these utilities to do their work. PAExec may be bundled with other software. In any case, using suspicious commandline flags to escalate a command line to LOCAL_SYSTEM rights is highly unusual. 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 ".* -i -s cmd.*|.* -i -s powershell.*|.* -i -s pwsh.*|.* -i /s cmd.*|.* -i /s powershell.*|.* -i /s pwsh.*|.* -s -i cmd.*|.* -s -i powershell.*|.* -s -i pwsh.*|.* -s /i cmd.*|.* -s /i powershell.*|.* -s /i pwsh.*|.* -s cmd.*|.* -s powershell.*|.* -s pwsh.*|.* /i -s cmd.*|.* /i -s powershell.*|.* /i -s pwsh.*|.* /i /s cmd.*|.* /i /s powershell.*|.* /i /s pwsh.*|.* /s -i cmd.*|.* /s -i powershell.*|.* /s -i pwsh.*|.* /s /i cmd.*|.* /s /i powershell.*|.* /s /i pwsh.*|.* /s cmd.*|.* /s powershell.*|.* /s pwsh.*" AND command REGEXP ".*accepteula.*|.*paexec.*|.*psexec.*"

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