---
title: "Enumeration sheet"
date: 2024-06-28
draft: false
---

https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Linux%20-%20Privilege%20Escalation.md
https://gtfobins.github.io/


UPG SHELL
`python3 -c 'import pty;pty.spawn("/bin/bash");'`

python -c 'import pty;pty.spawn("/bin/bash");'

# easy wins
```bash
sudo -l 
cat /etc/passwd | grep -i '/bin/.*sh' 
```

# SUID binaries
```bash
find / -perm -4000 -type f -exec ls -la {} 2>/dev/null \;
find / -uid 0 -perm -4000 -type f 2>/dev/null
```

# List world writable files
```bash
find / -writable ! -user `whoami` -type f ! -path "/proc/*" ! -path "/sys/*" -exec ls -al {} \; 2>/dev/null
find / -perm -2 -type f 2>/dev/null
find / ! -path "*/proc/*" -perm -2 -type f -print 2>/dev/null
```

# check internally hosted services

```bash
netstat -tnlp 
ps auxww
```

# nginx stuff
You should also check 
/opt and /srv


Looking at what other sites are hosted on this server
```bash
ls -al /etc/nginx/sites-enabled
```

# password search
`grep -r password . 2>/dev/null` 

# Questions
- What is running? 
	- `ps auxww` 
- What's listening?
	- `netstat -tnlp | grep [pid from above]`
- Where is nginx forwarding traffic?
	- `cat /etc/nginx/sites-enabled/default`
	
