Skip to content
← RegistryDossier · 5 steps · 4 edges

sudo NOPASSWD on a shell-spawner → root

User has sudo NOPASSWD on a binary that can shell out (vi, less, awk, perl, python). Use the binary's escape sequence to drop into a root shell.

Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll

§ Context

Assumed environment: foothold as a low-priv user. `sudo -l` reveals an allowed binary that doesn't require a password and that exposes a shell escape per GTFOBins.

§ Steps

  1. 01
    Low-priv shellInitial Access
    T1078Valid Accounts
  2. 02
    Spawn root shell from inside the binaryExecution
    T1059Command and Scripting Interpreter
  3. 03
    sudo -l → identify allowed binariesDiscovery
    T1087Account Discovery
  4. 04
    Match binary to GTFOBins sudo entryPrivilege Escalation
    L-SUDO-MISCONFSudo Misconfiguration (NOPASSWD / weak Defaults)
  5. 05
    Cron / SSH key persistencePersistence
    L-CRON-WRAPCron-Based Persistence

§ References

§ Frequently asked

What is the "sudo NOPASSWD on a shell-spawner → root" attack path?
User has sudo NOPASSWD on a binary that can shell out (vi, less, awk, perl, python). Use the binary's escape sequence to drop into a root shell. It chains 5 steps drawn from real-world offensive-security techniques.
What starting position does this attack require?
The first step is Low-priv shell (T1078) — a initial access primitive. Assumed environment: foothold as a low-priv user.
What is the final impact of this kill-chain?
The final step lands on Cron / SSH key persistence (L-CRON-WRAP), which falls under Persistence. From here, an operator typically pivots into post-exploitation or maintains persistence.
How can defenders detect or prevent this attack?
Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.

§ Related dossiers