Detection: Splunk Absolute Path Traversal Using runshellscript

Description

The following analytic detects the exploitation of an absolute path traversal vulnerability in Splunk Enterprise versions lower than 8.2.12, 9.0.6, and 9.1.1, where an attacker can execute arbitrary code located on a separate disk. It leverages logs from the splunk_python macro, specifically looking for the runshellscript command with a specific argument count and path pattern. This activity is significant as it indicates a potential exploitation attempt that could lead to unauthorized code execution. If confirmed malicious, this could allow an attacker to gain control over the Splunk instance, leading to data breaches or further system compromise.

 1`splunk_python` *runshellscript*  
 2| eval log_split=split(_raw, "runshellscript: ") 
 3| eval array_raw = mvindex(log_split,1) 
 4| eval data_cleaned=replace(replace(replace(array_raw,"\[",""),"\]",""),"'","") 
 5| eval array_indices=split(data_cleaned,",") 
 6| eval runshellscript_args_count=mvcount(array_indices) 
 7| where runshellscript_args_count = 10 
 8| eval interpreter=mvindex(array_indices,0) 
 9| eval targetScript=mvindex(array_indices,1) 
10| eval targetScript != "*C:*" 
11| stats count min(_time) as firstTime max(_time) as lastTime by splunk_server interpreter targetScript 
12| `security_content_ctime(firstTime)`
13| `security_content_ctime(lastTime)` 
14| `splunk_absolute_path_traversal_using_runshellscript_filter`

Data Source

Name Platform Sourcetype Source
Splunk Splunk icon Splunk 'splunkd_ui_access' 'splunkd_ui_access.log'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
splunk_absolute_path_traversal_using_runshellscript_filter search *
splunk_absolute_path_traversal_using_runshellscript_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
T1083 File and Directory Discovery Discovery
KillChainPhase.EXPLOITAITON
NistCategory.DE_AE
Cis18Value.CIS_10
APT18
APT28
APT3
APT32
APT38
APT39
APT41
APT5
Aoqin Dragon
BRONZE BUTLER
Chimera
Confucius
Dark Caracal
Darkhotel
Dragonfly
FIN13
Fox Kitten
Gamaredon Group
HAFNIUM
Inception
Ke3chang
Kimsuky
Lazarus Group
Leafminer
LuminousMoth
Magic Hound
MuddyWater
Mustang Panda
Patchwork
Play
RedCurl
Sandworm Team
Scattered Spider
Sidewinder
Sowbug
TeamTNT
ToddyCat
Tropic Trooper
Turla
Volt Typhoon
Windigo
Winnti Group
Winter Vivern
admin@338
menuPass

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 False
This configuration file applies to all detections of type hunting.

Implementation

Must have access to internal indexes. Only applies to Splunk on Windows versions.

Known False Positives

The command runshellscript can be used for benign purposes. Analyst will have to review the searches and determined maliciousness specially by looking at targeted script.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Possible attack against splunk_server $splunk_server$ through abuse of the runshellscript command 35 50 70
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset python.log splunk_python
Integration ✅ Passing Dataset python.log splunk_python

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: 3