# 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
```


---

# 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://notes.derrickso.com/useful-commands/linux.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.
