← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux Setuid Binary Abuse Privilege Escalation Dataset

This hunt uses a simulated Linux auditd dataset (linux_auditd_setuid_2022-09-26T193000.json) capturing T1548.001: Abuse Elevation Control Mechanism (Setuid and Setgid), where an attacker with limited shell access finds or plants a binary with the SUID bit set that allows arbitrary command execution (e.g., find, vim, python, or a custom dropped binary), escalating from a standard user to root.

Step 1: Hypothesis Formation

Hypothesis: A chmod operation sets the SUID bit (+s/4755) on a binary not normally requiring it, or a pre-existing GTFOBins-listed SUID binary (e.g., find, nmap, python3) is invoked with arguments consistent with its known privilege-escalation abuse pattern, immediately followed by a shell spawning with euid=0 from a process that was previously running as a standard user. Indicators:

Null Hypothesis: A legitimate system package (e.g., ping, mount, passwd) has the SUID bit as part of its normal, vendor-shipped installation, and no abuse pattern is present. Invalidate by confirming the binary and its permission bit against the package manager's manifest (dpkg -V / rpm -V).

Rationale: SUID/SGID misconfigurations are among the most common and reliable Linux privilege-escalation vectors, especially on systems where administrators grant SUID to utility binaries for convenience; detecting the abuse pattern at execution time catches both planted and misconfigured-legitimate binaries.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm svc_reports set the SUID bit on /usr/bin/find, then invoked its documented GTFOBins escalation pattern to spawn a root shell without ever authenticating via sudo.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-09-26 19:36:02srv-batch-04auditd SYSCALL (chmod)chmod 4755 /usr/bin/find executed by uid=1004 (svc_reports)SUID-Grant IOC: find does not ship with the SUID bit by default; this is a deliberate, non-standard permission change made by a low-privilege account.
2022-09-26 19:36:15srv-batch-04auditd EXECVEfind . -exec /bin/sh -p \; -quit executedGTFOBins IOC: this exact command is the documented, widely-known find SUID privilege-escalation one-liner.
2022-09-26 19:36:15srv-batch-04auditd SYSCALLResulting /bin/sh process: uid=1004 euid=0 suid=0Escalation-Confirmed IOC: real UID remains the standard user while effective/saved UID is root - definitive proof the SUID abuse succeeded.
2022-09-26 19:37:40srv-batch-04auditd EXECVERoot shell used to run cat /etc/shadow and useradd -o -u 0 -g 0 svc2 (UID-0 backdoor account)Persistence IOC: the attacker immediately used root access to read credential material and create a second, hidden UID-0 account.
-srv-batch-04(auth log check)No corresponding sudo or su authentication event in /var/log/auth.log for this sessionConfirms the privilege escalation bypassed all standard authorization mechanisms entirely.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an attacker with limited shell access set the SUID bit on /usr/bin/find and used a well-known GTFOBins one-liner to spawn a root shell, then created a hidden UID-0 backdoor account!