Detection: Ping Sleep Batch Command

Description

The following analytic identifies the use of ping commands as a delay or sleep mechanism within batch-style command execution. It leverages process creation telemetry from Endpoint Detection and Response (EDR) agents and examines process and parent process command-line fields for ping commands that specify a count and are chained with additional commands using command separators or redirection operators. While execution of the command may generate individual process creation events, such as a separate ping.exe process, this analytic specifically focuses on the original command string passed to a command interpreter, such as cmd.exe /c, that combines the ping-based delay with subsequent command execution. Adversaries may use ping as an alternative to explicit sleep or timeout commands to introduce execution delays, potentially evading automated analysis, sandboxing, or behavior-based detection. Because ping is commonly used for legitimate network troubleshooting, findings should be reviewed in the context of the complete command line, parent process, user, and commands executed before or after the delay.

 1
 2| tstats `security_content_summariesonly`
 3  count min(_time) as firstTime
 4        max(_time) as lastTime
 5
 6FROM datamodel=Endpoint.Processes WHERE
 7(
 8    Processes.parent_process= "*ping*"
 9    Processes.parent_process IN (
10        "*-n*",
11        "*/n*"
12    )
13    Processes.parent_process IN (
14        "*& *",
15        "*&*",
16        "*&C:*",
17        "*>*",
18        "*>*",
19        "*
20|
21|*"
22    )
23)
24OR
25(
26    (
27        Processes.process_name= "ping.exe"
28        OR
29        Processes.original_file_name= "ping.exe"
30    )
31    Processes.process IN (
32        "*-n*",
33        "*/n*"
34    )
35    Processes.process IN (
36        "*& *",
37        "*&*",
38        "*&C:*",
39        "*>*",
40        "*>*",
41        "*
42|
43|*"
44    )
45)
46
47BY Processes.action Processes.dest Processes.original_file_name
48   Processes.parent_process Processes.parent_process_exec
49   Processes.parent_process_guid Processes.parent_process_id
50   Processes.parent_process_name Processes.parent_process_path
51   Processes.process Processes.process_exec Processes.process_guid
52   Processes.process_hash Processes.process_id Processes.process_integrity_level
53   Processes.process_name Processes.process_path Processes.user
54   Processes.user_id Processes.vendor_product
55
56
57| `drop_dm_object_name("Processes")`
58
59| `security_content_ctime(firstTime)`
60
61| `security_content_ctime(lastTime)`
62
63| `ping_sleep_batch_command_filter`

Data Source

Name Platform Sourcetype Source
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
CrowdStrike ProcessRollup2 Other 'crowdstrike:events:sensor' 'crowdstrike'

Macros Used

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

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1497.003 Time Based Checks Discovery
Exploitation
DE.AE
CIS 10

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 Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

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

Administrators, network operators, scripts, and software installers may legitimately use ping commands as a simple delay mechanism between commands or operations. Review the full command line, parent process, user context, and surrounding activity to determine whether the execution is expected. Update the filter macro to exclude known legitimate command patterns or processes in your environment.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Potential ping-based execution delay detected on [$dest$] by [$user$] via [$process$] dest system 20
Potential ping-based execution delay detected on [$dest$] by [$user$] via [$process$] user user 20

Threat Objects

Field Type
parent_process parent_process
process process

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing 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: 17