SUDO
NOPASSWD
GTFOBINS
SUDOERS
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting sudo Abuse on Linux: NOPASSWD, GTFOBins and sudoers Changes

A single permissive sudoers line can hand root to anyone who can run a text editor. The abuse is quiet by design, so the logs have to be configured to tell the story.

Scroll

Sudo misconfiguration is among the most common Linux escalation paths: a rule allowing a user to run an editor, pager, interpreter or file utility as root lets them shell out to root with a GTFOBins technique (T1548.003). Attackers also edit sudoers to make access permanent. The signals are in the auth log, in process telemetry and in file-integrity events on the sudoers files.

Signals at a Glance

SignalWhereATT&CK
sudo -l run by a service or web accountauditd execve, process telemetryT1548.003
sudo COMMAND= naming a GTFOBins binary (vim, find, awk, less, man, nmap)auth.log or secureT1548.003
Root shell spawned by an editor, pager or interpreterauditd execve, EDRT1548.003
Write to /etc/sudoers or /etc/sudoers.dauditd file watch, FIMT1548.003
Repeated sudo authentication failures or not-in-sudoers messagesauth.log, secureT1110

Auditing the Configuration Surface

The sudoers files and the sudo binary are the two assets worth watching. File watches give you tamper evidence, and execve records on sudo capture the enumeration step that usually precedes abuse:

# /etc/audit/rules.d/sudo.rules
-w /etc/sudoers -p wa -k sudoers_change
-w /etc/sudoers.d/ -p wa -k sudoers_change
-w /usr/bin/sudo -p x -k sudo_exec
-a always,exit -F arch=b64 -S execve -F path=/usr/bin/sudo -F auid>=1000 -F auid!=-1 -k sudo_by_user
# tune/validate: confirm the sudo path on your distribution, then load with augenrules --load.

Reading auth.log and secure

Each sudo invocation writes a line with the invoking user, the target user and the full command. Parse it, then compare the command binary against the GTFOBins list for your environment. A single hit is a lead, a hit from a service account is an incident:

index=linux sourcetype=linux_secure "sudo:" "COMMAND="
| rex field=_raw "sudo:\s+(?<src_user>\S+)\s+:.*USER=(?<run_as>\S+)\s*;\s*COMMAND=(?<cmd>.+)$"
| where run_as="root"
| eval bin=mvindex(split(mvindex(split(cmd," "),0),"/"),-1)
| search bin IN ("vi","vim","find","awk","less","more","man","nmap","env","tar","zip","git","python*","perl","ruby","tcpdump")
| stats count values(cmd) as commands by host, src_user
```tune/validate: extend the binary list from GTFOBins and exclude your approved admin users```
title: Root Shell Spawned by Sudo-Able Utility
logsource:
  product: linux
  category: process_creation
detection:
  selection:
    ParentImage|endswith:
      - '/vim'
      - '/vi'
      - '/less'
      - '/man'
      - '/awk'
      - '/find'
      - '/nmap'
    Image|endswith:
      - '/sh'
      - '/bash'
      - '/dash'
    User: 'root'
  condition: selection
level: high
# tune/validate: administrators legitimately shell out from inside vim; baseline by account.
Vetted sources

Use GTFOBins for the binary list, the SigmaHQ Linux auditd and process-creation rules, Elastic’s prebuilt rules for sudoers changes and sudo enumeration, and Atomic Red Team T1548.003 for validation. Baseline your own environment — every admin team has legitimate sudo patterns that look like abuse.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026