Detection: Windows PsTools Recon Usage

EXPERIMENTAL DETECTION

This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.

Description

The following analytic identifies execution of Sysinternals PsTools and Sysinternals Suit binaries that are commonly used for reconnaissance and information gathering on Windows endpoints. PsTools (PsExec, PsFile, PsGetSid, PsInfo, PsPing, etc.) or Sysinternals Suit tools, are frequently used by administrators for legitimate maintenance but are also leveraged by threat actors to collect system, account, network and service information during discovery and lateral movement. This detection focuses on process execution and PE metadata telemetry (OriginalFileName). If confirmed malicious, this activity can indicate targeted reconnaissance and foothold escalation, enabling subsequent lateral movement or credential abuse.

 1
 2| tstats `security_content_summariesonly`
 3  count min(_time) as firstTime
 4        max(_time) as lastTime
 5
 6  from datamodel=Endpoint.Processes where
 7
 8  Processes.process_name IN (
 9      "PsGetsid.exe",
10      "PsGetsid64.exe",
11      "PsInfo.exe",
12      "PsInfo64.exe",
13      "pslist.exe",
14      "pslist64.exe",
15      "PsLoggedon.exe",
16      "PsLoggedon64.exe",
17      "psloglist.exe",
18      "psloglist64.exe",
19      "PsPing.exe",
20      "PsPing64.exe",
21      "PsService.exe",
22      "PsService64.exe",
23      "Tcpvcon.exe",
24      "Tcpvcon64.exe",
25      "Tcpvcon64a.exe"
26  )
27  OR
28  Processes.original_file_name IN (
29      "PsGetSid.exe",
30      "Psinfo.exe",
31      "pslist.exe",
32      "psloggedon.exe",
33      "psloglist.exe",
34      "psping.exe",
35      "psservice.exe",
36      "Tcpvcon.exe"
37  )
38
39by Processes.action Processes.dest Processes.original_file_name Processes.parent_process Processes.parent_process_exec
40   Processes.parent_process_guid Processes.parent_process_id Processes.parent_process_name Processes.parent_process_path
41   Processes.process Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id
42   Processes.process_integrity_level Processes.process_name Processes.process_path Processes.user Processes.user_id
43   Processes.vendor_product
44
45
46| `drop_dm_object_name(Processes)`
47
48| `security_content_ctime(firstTime)`
49
50| `security_content_ctime(lastTime)`
51
52| `windows_pstools_recon_usage_filter`

Data Source

Name Platform Sourcetype Source
CrowdStrike ProcessRollup2 N/A 'crowdstrike:events:sensor' 'crowdstrike'
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
Windows Event Log Security 4688 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_pstools_recon_usage_filter search *
windows_pstools_recon_usage_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the Processes node of the Endpoint data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.

Known False Positives

Legitimate administrators commonly use PsTools for troubleshooting and management. False positives are likely in environments where PsTools are an approved operational toolset, or where automated management systems invoke them. Tune by whitelisting approved management hosts, service accounts, and scheduled maintenance windows.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

PsTools binary $process_name$ was executed on host $dest$.

Risk Object Risk Object Type Risk Score Threat Objects
user user 25 process_name
dest system 30 process_name

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Not Applicable N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 2