# Internal Recon

### Sudo - Useful Commands

```bash
#List user's privileges
sudo -l
```

### Find - Useful Commands #SUID #SGID #StickyBit

```bash
#Find world writeable directories
find / -perm 777 2>/dev/null

#Find SUID files
find / -perm /4000 -type f 2>/dev/null

#Find root SUID files
find / -perm /4000 -uid 0 -type f 2>/dev/null

#Find SGID files - Run as the group, not the user who started it
find / -perm -g=s -type f 2>/dev/null

#Find Sticky bit files
find / -perm -1000 -type d 2>/dev/null

#Find SUID or SGID (3 folders deep)
find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {} \; 2>/dev/nul
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pwny.cc/so/linux/internal-recon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
