> 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 privater Schlüssel und Zertifikate aus PFX-Dateien für die Evil-WinRM-Zertifikatsauthentifizierung.

### **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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3148b69e02bd1853e62a43ac3e27fddb0eedf49a%2Fimage%20(1632).png?alt=media" alt=""><figcaption></figcaption></figure>

**Wiederherstellung des Zertifikats**

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="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6dc3fe3a67201a5f17c6b4d5c3a5b2d30df971ee%2Fimage%20(1633).png?alt=media" alt=""><figcaption></figcaption></figure>

### **SSL-Verbindung mit Evil-WinRM unter Verwendung von privatem Schlüssel und Zertifikat**

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-53377a379d295c669d34bd555ed463327ef10cfb%2Fimage%20(1634).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-df8146e1a35574fa67c593e58e1c4d1ca4118ac6%2Fimage%20(1635).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
