> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/ports-and-services/winrm-5986/evil-winrm-openssl.md).

# Evil-WinRM - OpenSSL

### **Extrahieren eines privaten Schlüssels und Zertifikats aus einer .PFX-Datei**

**Wiederherstellung des privaten Schlüssels**

```bash
openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out priv-key.pem -nodes
```

<figure><img src="/files/f0053b63d3ef5d5c4350e029b743959c7d91ff95" alt=""><figcaption></figcaption></figure>

**Zertifikatswiederherstellung**

Um das Zertifikat aus der **.PFX** Datei zu extrahieren, verwenden Sie den folgenden Befehl:

```bash
openssl pkcs12 -in legacyy_dev_auth.pfx -nokeys -out certificate.pem
```

<figure><img src="/files/f5efe9fc72b5bd0247a3ac0054fce03fd48e56ee" alt=""><figcaption></figcaption></figure>

### **SSL-Verbindung mit Evil-WinRM unter Verwendung des privaten Schlüssels und Zertifikats**

<figure><img src="/files/816c8b1ed98338cbae61102a1ff059b78983df37" alt=""><figcaption></figcaption></figure>

Sobald der private Schlüssel und das Zertifikat extrahiert wurden, stellen Sie eine sichere **Evil-WinRM** Verbindung mithilfe der erzeugten Dateien her:

```bash
evil-winrm -i 10.10.11.152 -c certificate.pem -k priv-key.pem -S
```

<figure><img src="/files/e64fc3d2d60a96a6e480735936d2a360a0a5a226" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/ports-and-services/winrm-5986/evil-winrm-openssl.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
