Challenge

Information

Includes es un challenge de dificultad fácil dentro de la categoría Web Exploitation de la plataforma CyLab y fue creado por el usuario LT syreal Jones.

Description

Can you get the flag?

Go to this website and see what you can discover.

Hints

Hint 1

Is there more code than what the inspector initially shows?


Solution

Site

Code

Included Files

Con curl, realizo una petición para obtener los nombres de los archivos incluidos en la página.

root@kali:~  curl -sX GET "http://saturn.picoctf.net:61497/" | grep -E "href|src"
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>

style.css

root@kali:~  curl -sX GET "http://saturn.picoctf.net:61497/style.css"
body {
  background-color: lightblue;
}

/*  picoCTF{1nclu51v17y_1of2_  */

script.js

root@kali:~  curl -sX GET "http://saturn.picoctf.net:61497/script.js"
function greetings()
{
  alert("This code is in a separate file!");
}

//  f7w_2of2_XXXXXXXX}

Flag

Cada uno de los archivos contiene un fragmento de la flag. Al combinar ambas cadenas, consigo reconstruirla por completo.

root@kali:~  echo "$(curl -sX GET "http://saturn.picoctf.net:61497/style.css" | grep "pico" | awk '{print $2}')""$(curl -sX GET "http://saturn.picoctf.net:61497/script.js" | grep '//' | awk '{print $2}')"
picoCTF{1nclu51v17y_1of2_f7w_2of2_XXXXXXXX}

Hasta aquí la resolución del challenge Includes de CyLab.

Happy Hacking! 🙂