~/write-ups/writeup-b0a7d93542

Web Application Penetration Testing CTF 1

Imported from Notion: Web Application Penetration Testing CTF 1

target:: Notion MEDIUM date:: 2026.07.26 notion

Pistas

  1. Sometimes, important files are hidden in plain sight. Check the root (’/’) directory for a file named ‘flag.txt’ that might hold the key to the first flag.

  2. Explore the structure of the server’s directories. Enumeration might reveal hidden treasures.

  3. The login form seems a bit weak. Trying out different combinations might just reveal the next flag.

  4. The login form behaves oddly with unexpected inputs. Think of injection techniques to access the ‘admin’ account and find the flag.


Empezamos con un escaneo para ver que puertos hay abiertos:

nmap -sSV target​.ine.l​ocal

Vemos que podemos ver 4 archivos en la web, la ruta es: http://192.196.107.3/view_file?file=file1.txt

La pista dice que esta en la raíz a si que probamos manualmente un Local File Inclusion :

http://192.196.107.3/view_file?file=../../../../../../flag.txt

Notion image
Notion image

Flag 1: FLAG1_7163ec3e80644de4bbf0f4106042afb3


La segunda pista habla sobre enumerar directorios, a si que usaremos gobuster

gobuster dir -u http://targe​t.ine.​local -w /usr/s​hare/w​ordlis​ts/dir​b/comm​on.txt​
Notion image
Notion image

Vemos un directorio interesante llamado secured a si que vamos al navegador a ver que hay ahi.

Notion image
Notion image

Vemos que hay dentro un archivo llamado flag.txt a si que lo ponemos en el navegador para ver su contenido:

Notion image
Notion image

Tenemos la flag 2: FLAG2_ae14a2e0b87d427f80f759f3d9db994f


Ahora vamos con la tercera y cuarta, que habla sobre el panel login, a si que abramos burpsuite para intentar logearnos.

Clickamos en la extension foxyproxy y habilitamos burpsuite

Notion image
Notion image

Pondremos user: test password: test para testear y ver respuesta al dar en el boton log in.

Notion image
Notion image
Notion image
Notion image

Lo mandamos al repeater.

Notion image
Notion image

Podemos ver que arroja un mensaje de error: Invalid username or password

Vamos a probar si es vulnerable a SQLi introduciendo en el parametro username : admin' --

Notion image
Notion image

Lo es, a si que vamos a hacerlo manual en el panel login.

Notion image
Notion image
Notion image
Notion image

Tenemos la flag 4: FLAG4_9be2406a4a534cf2bcd798e561c3df7f

Para la flag 3 debemos enumerar usuarios, a si que mandaremos al intruder lo que teniamos previamente en el repeater.

Notion image
Notion image

En el intruder, cubrimos admin con el ratón.

Notion image
Notion image

clickamos en Add§ y vamos a la pestaña Payloads

Notion image
Notion image

En Payload settings damos a load y cargamos nuestra wordlist que en este caso será /usr/share/wordlist/metasploit/unix_users.txt

Ahora damos arriba a la derecha a start attack y empezará el ataque probando users en nuestro SQLi , buscamos Status code 302 como nos da admin , tras un rato, vemos que un usuario guest nos arroja status code 302

Notion image
Notion image

Probamos en el panel log in de la web:

  • user: guest' --

  • password: CUALQUIER COSA

ya que ' -- lo que hace es ignorar el resto de la query

Notion image
Notion image
Notion image
Notion image

Tenemos la flag 3: FLAG3_4edc5a60eb314564aaa2b03476875875


- EOF -

<< back_to_index