> For the complete documentation index, see [llms.txt](https://blog.rootkid.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.rootkid.in/exam-prep-notes/junior-penetration-tester-ejptv2-notes/host-and-network-penetration-testing/post-exploitation/linux-privilege-escalation.md).

# Linux Privilege Escalation

## Linux Privilege Escalation - Weak Permissions

### **LinEnum Tool**

* [**`LinEnum`**](https://github.com/rebootuser/LinEnum) - LinEnum is a simple bash script that automates common Linux local enumeration checks in addition to identifying privilege escalation vulnerabilities. \</aside>

### Searching for Files with Read-Write Permissions for Low Privilege Users

To search for files with read-write permissions accessible by low privilege users, use the following command:

```sh
find / -not -type d -perm -o+w
```

This command searches the filesystem for files that have read or write permissions set for low privilege users, which can potentially be used for privilege escalation.

## Linux Privilege Escalation - SUDO Privileges

### Checking Sudo Privileges

To check your sudo privileges, use the following command:

```sh
sudo -l
```

This command lists the commands that you're allowed to run with sudo.

#### Best Reference for Exploiting Misconfigured Sudo

For exploiting misconfigured sudo, refer to [GTFOBins](https://gtfobins.github.io/).

This website provides a collection of Unix-like system command-line exploits that can be used for privilege escalation and post-exploitation scenarios.

***

***

***

**`Hacker's Mantra:`**`Hackers: rewriting the code of the world.`
