T1548.001 Sumo Logic CSE · Sumo

Detect Setuid and Setgid in Sumo Logic CSE

Adversaries abuse the setuid (SUID) and setgid (SGID) permission bits on Linux and macOS to execute code in another user's context, typically root. When a file with SUID is executed, it runs as the file owner rather than the executing user. Adversaries can set SUID on their malware to enable future privilege escalation, or exploit existing SUID binaries listed on GTFOBins. Keydnap malware added setuid to binaries; Exaramel for Linux used a setuid binary for privilege escalation. The find command is commonly used by attackers to discover exploitable SUID/SGID binaries.

MITRE ATT&CK

Tactic
Privilege Escalation Defense Evasion
Technique
T1548 Abuse Elevation Control Mechanism
Sub-technique
T1548.001 Setuid and Setgid
Canonical reference
https://attack.mitre.org/techniques/T1548/001/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
(_sourceCategory="linux*" OR _sourceCategory="auditd*" OR _sourceCategory="syslog*")
| parse regex "(?<raw_command>chmod\s+[\w+/\-]+\s+[^\s]+)" nodrop
| parse regex "(?<find_command>find\s+[^|;]+\-perm\s+[^\s]+)" nodrop
| parse regex "uid=(?<uid>\d+)" nodrop
| parse regex "auid=(?<auid>\d+)" nodrop
| parse regex "comm=\"?(?<command>[^\"\s]+)" nodrop
| parse regex "exe=\"?(?<executable>[^\"\s]+)" nodrop
| eval detection_type = if(
    matches(_raw, "(?i)chmod.*(4[0-7]{3}|u\\+s|2[0-7]{3}|g\\+s|6[0-7]{3})"),
    "Chmod_SUID_SGID_Set",
    if(
      matches(_raw, "(?i)find.*\\-perm.*(\\+4000|\\-4000|/4000|\\+2000|\\-2000|setuid|setgid)"),
      "Find_SUID_Discovery",
      if(
        matches(_raw, "(?i)(uid=0|user=root).*((\/tmp|\/var\/tmp|\/dev\/shm|\/home\/)[^ ]+)"),
        "Root_Exec_From_Writable_Path",
        null
      )
    )
  )
| where !isNull(detection_type)
| parse regex "hostname=(?<hostname>[^\s]+)" nodrop
| fields _messageTime, hostname, uid, command, executable, detection_type, _raw
| sort by _messageTime desc
high severity medium confidence

Sumo Logic detection for T1548.001 Setuid/Setgid abuse. Parses Linux auditd and syslog sources to detect chmod privilege bit setting, find-based SUID reconnaissance, and root execution from writable non-standard paths. Uses regex parsing against raw log events.

Data Sources

Linux auditd logsLinux syslogSumo Logic Installed Collector on Linux hosts

Required Tables

Sumo Logic _sourceCategory linux*, auditd*, syslog*

False Positives & Tuning

  • Linux package installation scripts (rpm, dpkg) that set SUID bits on binaries such as passwd, ping, or sudo during legitimate software installs
  • Security scanning tools like Lynis or OpenSCAP running SUID discovery as part of scheduled compliance checks
  • Container entrypoint scripts executing as root from mounted home directories in development Kubernetes or Docker environments
Download portable Sigma rule (.yml)

Other platforms for T1548.001


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Set SUID Bit on a Test Binary

    Expected signal: Syslog/auditd: chmod syscall on /tmp/df00tech-suid-test with mode 04xxx. Process creation event for chmod with u+s argument. Sysmon for Linux (if deployed): FileModify event for /tmp/df00tech-suid-test.

  2. Test 2Discover SUID Binaries on the System

    Expected signal: Process creation event for find with -perm /4000 argument. Syslog entry for find execution.

  3. Test 3Set SGID Bit on Test File

    Expected signal: Auditd: chmod syscall with mode=02755 for /tmp/df00tech-sgid-test. Process creation for chmod command.

Unlock Pro Content

Get the full detection package for T1548.001 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections