Try in Splunk Security Cloud


This analytic is to detect the execution of sudo or su command in linux operating system. The "sudo" command allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments. This command is commonly abused by adversaries, malware author and red teamers to elevate privileges to the targeted host. This command can be executed by administrator for legitimate purposes or to execute process that need admin privileges, In this scenario filter is needed.

  • Type: Hunting
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
  • Datamodel: Endpoint
  • Last Updated: 2022-01-04
  • Author: Teoderick Contreras, Splunk
  • ID: 4b00f134-6d6a-11ec-a90c-acde48001122




ID Technique Tactic
T1548.003 Sudo and Sudo Caching Privilege Escalation, Defense Evasion
T1548 Abuse Elevation Control Mechanism Privilege Escalation, Defense Evasion
Kill Chain Phase
  • Exploitation
  • DE.CM
  • CIS 3
  • CIS 5
  • CIS 16
| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name IN ("sudo", "su") OR Processes.parent_process_name IN ("sudo", "su") by Processes.dest Processes.user Processes.parent_process_name Processes.process_name Processes.process Processes.process_id Processes.parent_process_id Processes.process_guid 
| `drop_dm_object_name(Processes)` 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `linux_sudo_or_su_execution_filter`


The SPL above uses the following Macros:

:information_source: linux_sudo_or_su_execution_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • Processes.dest
  • Processes.user
  • Processes.parent_process_name
  • Processes.process_name
  • Processes.process
  • Processes.process_id
  • Processes.parent_process_id

How To Implement

To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the Endpoint datamodel in the Processes node. If you are using Sysmon, you can use the Add-on for Linux Sysmon from Splunkbase.

Known False Positives

Administrator or network operator can execute this command. Please update the filter macros to remove false positives.

Associated Analytic Story


Risk Score Impact Confidence Message
9.0 30 30 A commandline $process$ that execute sudo or su in $dest$

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.


Test Dataset

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

source | version: 1