> 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/ja/ports-and-services/winrm-5986/evil-winrm-openssl.md).

# Evil-WinRM - OpenSSL

Evil-WinRMの証明書認証のためのPFXファイルからの秘密鍵と証明書の抽出。

### **PFXファイルから秘密鍵と証明書を抽出する**

**秘密鍵の復旧**

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

<figure><img src="https://2001299964-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>

**証明書の復旧**

.PFX から証明書を抽出するには **.PFX** ファイルでは、次のコマンドを使用します:

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

<figure><img src="https://2001299964-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>

### **秘密鍵と証明書を使った Evil-WinRM での SSL 接続**

<figure><img src="https://2001299964-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>

秘密鍵と証明書を抽出したら、次の安全な **Evil-WinRM** 接続を、生成されたファイルを使用して確立します:

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

<figure><img src="https://2001299964-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/ja/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.
