Try in Splunk Security Cloud

Description

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

ATT&CK

ID Technique Tactic
T1548.003 Sudo and Sudo Caching Privilege Escalation, Defense Evasion
T1548 Abuse Elevation Control Mechanism Privilege Escalation, Defense Evasion

| 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`

Associated Analytic Story

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.

Required field

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

Kill Chain Phase

  • Privilege Escalation

Known False Positives

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

RBA

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

Reference

Test Dataset

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 | version: 1