# Passwords and Keys

### Overview

Linux systems frequently store or reference credentials such as:

* Plaintext passwords
* Password hashes
* SSH private keys
* API tokens or service credentials

If a low-privileged user can **read credentials belonging to a higher-privileged account**, escalation may be possible without exploiting anything.

### Password Locations

```bash
# History files
cat ~/.*history

# Look for Hidden files and directories in the system root
ls -la /

# Look for SSH config files / keys
find / -name authorized_keys 2> /dev/null
find / -name id_rsa 2> /dev/null
```

### Secret Search

```bash
grep -RniE "password|secret|apikey|token|flag" .
# -R recursive
# -n show line number
# -i case insensitive
# -E extended regex

rg -i "password|secret|apikey|token|flag"
```


---

# 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://gokulkarthik.gitbook.io/pentesting-checklist/linux/linux-privilege-escalation/passwords-and-keys.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.
