> For the complete documentation index, see [llms.txt](https://notes.derrickso.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.derrickso.com/useful-commands/linux.md).

# Linux

## Privilege Escalation Enumeration

### Root Privilege Related

```shell
sudo -l
find / -type f -perm -u=s 2>/dev/null # or -perm -4000
```

### Password

```shell
find . -type f -exec grep -i -I "PASSWORD" {} /dev/null
```

## Network

### Generating SSL Certificate

```shell
openssl genrsa -des3 -passout pass:x -out keypair.key 2048

openssl rsa -passin pass:x -in keypair.key -out private.key

openssl req -new -key private.key -out sign_request.csr

openssl x509 -req -days 365 -in cert.csr -signkey private.key -out sign_request.crt
```

### Grep IP address

```shell
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" file.txt
```
