CTF

Voy a poner retos de diferentes plataformas.

https://ctfchallenge.com

Reto: VulnBegin

objetivo: http://www.vulnbegin.co.uk/

Miramos los robots.txt del objetivo: http://www.vulnbegin.co.uk/robots.txt

Vemos lo siguiente:

Disallow: /secret_d1rect0y/

Dentro del objetivo: http://www.vulnbegin.co.uk/secret_d1rect0y

¡Felicidades! [^FLAG^2B22E2CB70E218510802B0359488F6A2^FLAG^]

https://www.picoctf.org/

Categoría: Web Exploitation

Where are the robots

Objetivo: https://jupiter.challenges.picoctf.org/problem/56830/

Vemos los robots.txt

https://jupiter.challenges.picoctf.org/problem/56830/robots.txt

Y nos sale lo siguiente:

Disallow: /1bb4c.html

https://jupiter.challenges.picoctf.org/problem/56830/1bb4c.html

¡Felicidades! picoCTF{ca1cu1at1ng_Mach1n3s_1bb4c}

Categoría: Web Exploitation

includes

Objetivo: http://saturn.picoctf.net:54634/

En el Inspector:

Miramos en la pestaña editor de estilos:

Donde tenemos: picoCTF{1nclu51v17y_1of2_

En ver código fuente:

Dentro del código JS

<script src="script.js"></script>

Tenemos: f7w_2of2_df589022}

Al juntar las dos partes: picoCTF{1nclu51v17y_1of2_f7w_2of2_df589022}

Categoría: Web Exploitation

Inspect HTML

Objetivo : http://saturn.picoctf.net:50920/

Entramos en el Inspector:

Ahí está la bandera comentada en código HTML:

<!-- picoCTF{1n5p3t0r_0f_h7ml_1fd8425b} -->

picoCTF{1n5p3t0r_0f_h7ml_1fd8425b}

Categoría: Web Exploitation

Insp3ct0r

Objetivo : https://jupiter.challenges.picoctf.org/problem/9670/

Miramos en el código fuente:

Tenemos aqui la primera parte de la bandera:

<!-- Html is neat. Anyways have 1/3 of the flag: picoCTF{tru3_d3 -->

Miramos en el código css: mycss.ss.

/* You need CSS to make pretty pages. Here's part 2/3 of the flag: t3ct1ve_0r_ju5t */

Ahora, miramos en el código JS:

/* Javascript sure is neat. Anyways part 3/3 of the flag: _lucky?2e7b23e3} */

Lo juntamos todo:

¡Felicidades ya tenemos la bandera!


picoCTF{tru3_d3t3ct1ve_0r_ju5t_lucky?2e7b23e3}

Categoría: Web Exploitation

Scavenger Hunt

Miramos en el código fuente:

<!-- Here's the first part of the flag: picoCTF{t -->

Miramos en el código css: mycss.css


/* CSS makes the page look nice, and yes, it also has part of the flag. Here's part 2: h4ts_4_l0 */

Miramos en el código JS:


/* How can I keep Google from indexing my website? */

Nos da la pista siguiente:

Los robots.txt

http://mercury.picoctf.net:39698/robots.txt


User-agent: *
Disallow: /index.html
# Part 3: t_0f_pl4c
# I think this is an apache server... can you Access the next flag?

Nos da la pista del archivo: .htaccess

http://mercury.picoctf.net:39698/.htaccess

# Part 4: 3s_2_lO0k
# I love making websites on my Mac, I can Store a lot of information there.

Se refiere al: .DS_Store

http://mercury.picoctf.net:39698/.DS_Store

**Congrats! You completed the scavenger hunt. Part 5: _fa04427c}**

Lo juntamos todo:

picoCTF{th4ts_4_l0t_0f_pl4c3s_2_lO0k_fa04427c}

Category: Web Exploitation

GET aHEAD

Objetivo : http://mercury.picoctf.net:34561/

Vamos a usar una herramienta online para ver las cabeceras HTTP.

https://wtools.io/check-headers-online

Le ponemos el objetivo:

picoCTF{r3j3ct_th3_du4l1ty_8f878508}

Category: Web Exploitation

Cookies

Ponemos lo siguiente:

snickerdoodle

Podemos usar en inspeccionar, Almacenamiento, Cookies y ir cambiando el valor.

O podemos usar un plugin llamado Cookie Quick Manager.

Ponemos el siguiente valor:

18

Se recarga la web:

picoCTF{3v3ry1_l0v3s_c00k135_a1f5bdb7}

Category: Web Exploitation

dont-use-client-side

Objetivo: https://jupiter.challenges.picoctf.org/problem/17682/

Miramos en el código fuente del código JS.

<script type="text/javascript">
  function verify() {
    checkpass = document.getElementById("pass").value;
    split = 4;
    if (checkpass.substring(0, split) == 'pico') {
      if (checkpass.substring(split*6, split*7) == '706c') {
        if (checkpass.substring(split, split*2) == 'CTF{') {
         if (checkpass.substring(split*4, split*5) == 'ts_p') {
          if (checkpass.substring(split*3, split*4) == 'lien') {
            if (checkpass.substring(split*5, split*6) == 'lz_b') {
              if (checkpass.substring(split*2, split*3) == 'no_c') {
                if (checkpass.substring(split*7, split*8) == '5}') {
                  alert("Password Verified")
                  }
                }
              }
      
            }
          }
        }
      }
    }
    else {
      alert("Incorrect password");
    }
    
  }
</script>

Sí, nos fijamos podemos sacar lo siguiente:

(0, split) == ‘pico’

split, split*2) == ‘CTF{‘)

split2, split3) == ‘no_c’)

split3, split4) == ‘lien’)

split4, split5) == ‘ts_p’)

(split5, split6) == ‘lz_b’)

split6, split7) == ‘706c’)

(split7, split8) == ‘5}’)

Se une la bandera:

picoCTF{no_clients_plz_b706c5}

Category: Cryptography

Mod 26

Objetivo: cvpbPGS{arkg_gvzr_V’yy_gel_2_ebhaqf_bs_ebg13_hyLicInt}

Usamos una herramienta para decodificar el ROT13

Vamos a usar esta herramienta online:

https://cryptii.com/pipes/rot13-decoder

Le ponemos el objetivo y se consigue la bandera:

picoCTF{next_time_I'll_try_2_rounds_of_rot13_ulYvpVag}

13

Objetivo : cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}

Usamos una herramienta online para decodificar el ROT13

https://cryptii.com/pipes/rot13-decoder

Ponemos el objetivo y el resultado es:

picoCTF{not_too_bad_of_a_problem}

Mind your Ps and Qs

Descargamos el archivo values:

Es un RSA.

Vamos a decodificar con esta herramienta online:

https://www.dcode.fr/rsa-cipher

c: 861270243527190895777142537838333832920579264010533029282104230006461420086153423
n: 1311097532562595991877980619849724606784164430105441327897358800116889057763413423
e: 6553

Después de poner en cada casilla de la herramienta anterior poner el código c, n, e

Conseguimos la bandera:

picoCTF{sma11_N_n0_g0od_13686679}

Category: General Skills

Obedient Cat.

Descargamos el archivo llamado flag.

Lo abrimos con un bloc de notas y dentro tenemos.

picoCTF{s4n1ty_v3r1f13d_2fd6ed29}

Wave a flag:

Descargamos el archivo llamado warm.

Dentro del bloc de notas le damos a buscar y ponemos pico.

Encontramos la siguiente bandera:

picoCTF{b1scu1ts_4nd_gr4vy_f0668f62}

2Warm

Pasar el número 42 a binario:

Resultado

101010

Para poder resolver el reto hacemos lo siguiente:

picoCTF{101010}

Warmed Up

0x3D (hexadecimal) pasarlo a decimal:

picoCTF{61}

Bases

Objetivo: bDNhcm5fdGgzX3IwcDM1

Usamos una herramienta online para decodificar base64.

https://www.base64decode.org/

Ponemos el código anterior:

l3arn_th3_r0p35

Ahora solo falta:

picoCTF{l3arn_th3_r0p35}

Lets Warm Up

0x70 (hexadecimal) a ASCII

Usamos esta herramienta online:

https://www.calculators.tech/hex-to-ascii

Nos da:

p

La bandera es la siguiente:

picoCTF{p}

what’s a net cat?

Objetivo: jupiter.challenges.picoctf.org port:41120

Vamos a usar un plugin de Chrome llamado Netcat.

Le ponemos hostname: jupiter.challenges.picoctf.org,

port: 41120,

connect.

Resultado de la bandera:

picoCTF{nEtcat_Mast3ry_3214be47}

Category : Forensics

Information

Descargamos la imagen llamada cat.jpg

Vemos los metadatos de esta imagen, vamos a usar esta herramienta online

https://www.metadata2go.com/

Encontramos en la licencia de la imagen lo siguiente:


cGljb0NURnt0aGVfbTN0YWRhdGFfMXNfbW9kaWZpZWR9

Decodificar

Buscamos esta herramienta online de base 64

https://www.base64decode.org/

Ponemos el código anterior encontramos lo siguiente:

picoCTF{the_m3tadata_1s_modified}

https://www.root-me.org

Challenges: Web - Client

HTML - disabled buttons

Objetivo : http://challenge01.root-me.org/web-client/ch25/

Entramos en el inspector

Miramos en el código HTML del formulario (form)

<form action="" method="post" name="authform">
            <div>
                <input disabled type="text" name="auth-login" value="" />
                <input disabled type="submit" value="Member access" name="authbutton" />
            </div>
        </form>

Le quitamos disabled a los input

<form action="" method="post" name="authform">
            <div>
                <input type="text" name="auth-login" value="" />
                <input type="submit" value="Member access" name="authbutton" />
            </div>
        </form>

Ahora ya funciona el formulario ponemos, por ejemplo, Hola y pulsamos en Member access

Member access granted! The validation password is HTMLCantStopYou

Ya tenemos la contraseña: HTMLCantStopYou

Javascript - Authentication

Objetivo : http://challenge01.root-me.org/web-client/ch9/

Entramos en el inspector, pestaña red, damos a recargar

Dentro de la pestaña consola, GET http://challenge01.root-me.org/web-client/ch9/login.js

Pestaña respuesta:

GEThttp://challenge01.root-me.org/web-client/ch9/login.js
[HTTP/1.1 200 OK 0ms]

/* <![CDATA[ */

function Login(){

  var pseudo=document.login.pseudo.value;

  var username=pseudo.toLowerCase();

  var password=document.login.password.value;

  password=password.toLowerCase();

  if (pseudo=="4dm1n" && password=="sh.org") {

      alert("Password accepté, vous pouvez valider le challenge avec ce mot de passe.\nYou an validate the challenge using this password.");

  } else { 


      alert("Mauvais mot de passe / wrong password"); 



  }



}


/* ]]> */ 

Tenemos el username y la password

pseudo==”4dm1n” && password==”sh.org”

La contraseña es: sh.org

JavaScript Source:

Objetivo: http://challenge01.root-me.org/web-client/ch1/

Nos sale un alert damos a aceptar miramos el código fuente

Tenemos el código JS:

<script type="text/javascript">
	/* <![CDATA[ */
	    function login(){
		pass=prompt("Entrez le mot de passe / Enter password");
		if ( pass == "123456azerty" ) {
		    alert("Mot de passe accepté, vous pouvez valider le challenge avec ce mot de passe.\nYou can validate the challenge using this password.");  }
		else {
		    alert("Mauvais mot de passe / wrong password !");
		}
	    }
	/* ]]> */
	</script>

La contraseña: 123456azerty

Javascript - Authentication 2

Objetivo: http://challenge01.root-me.org/web-client/ch11/

Ver código fuente de la web. Miramos en el login.js.

<script language="JavaScript" src="login.js"></script>

function connexion(){
    var username = prompt("Username :", "");
    var password = prompt("Password :", "");
    var TheLists = ["GOD:HIDDEN"];
    for (i = 0; i < TheLists.length; i++)
    {
        if (TheLists[i].indexOf(username) == 0)
        {
            var TheSplit = TheLists[i].split(":");
            var TheUsername = TheSplit[0];
            var ThePassword = TheSplit[1];
            if (username == TheUsername && password == ThePassword)
            {
                alert("Vous pouvez utiliser ce mot de passe pour valider ce challenge (en majuscules) / You can use this password to validate this challenge (uppercase)");
            }
        }
        else
        {
            alert("Nope, you're a naughty hacker.")
        }
    }
}

El usuario es GOD y la contraseña HIDDEN para resolver el reto ponemos la contraseña HIDDEN

Javascript - Obfuscation 1

Objetivo : http://challenge01.root-me.org/web-client/ch4/ch4.html

Nos sale un alert damos a cancelar miramos en el código fuente:

<script type="text/javascript">
              /* <![CDATA[ */

              pass = '%63%70%61%73%62%69%65%6e%64%75%72%70%61%73%73%77%6f%72%64';
              h = window.prompt('Entrez le mot de passe / Enter password');
              if(h == unescape(pass)) {
                  alert('Password accepté, vous pouvez valider le challenge avec ce mot de passe.\nYou an validate the challenge using this pass.');
              } else {
                  alert('Mauvais mot de passe / wrong password');
              }

              /* ]]> */
          </script>

Vemos que la contraseña es:

pass = '%63%70%61%73%62%69%65%6e%64%75%72%70%61%73%73%77%6f%72%64';

Para descubrir la contraseña hacemos lo siguiente:

En inspeccionar entramos en la pestaña consola:

Se escribe

unescape(pass);

Contraseña: cpasbiendurpassword

Challenges : Web - Server

HTML Source Code

Objetivo : http://challenge01.root-me.org/web-serveur/ch1/

Miramos en el código fuente y tenemos:

<!--
                                                                                                                                                                                                                                                        Je crois que c'est vraiment trop simple là !
                                                                                                                                                                                                                                                            It's really too easy !
                                                                                                                                                                                                                                                                 password : nZ^&@q5&sjJHev0


-->

Contraseña: nZ^&@q5&sjJHev0

https://overthewire.org/wargames/natas/

Natas Level 0

Ponemos el usuario y la contraseña natas0


Username: natas0
Password: natas0
URL:      http://natas0.natas.labs.overthewire.org

Natas Level 0 –> Level 1

Una vez dentro poner el usuario y la contraseña anterior.

Miramos en el código fuente y tenemos:


<!--The password for natas1 is g9D9cREhslqBKtcA2uocGHPfMZVzeFK6 -->

Tenemos el siguiente objetivo:

Username: natas1
URL:      http://natas1.natas.labs.overthewire.org

Dentro de la url anterior ponemos en el alert usuario natas1 y la contraseña anterior.

Natas Level 1 –> Level 2

Miramos en el código fuente:


<!--The password for natas2 is h4ubbcXrWqsTo7GGnnUMLppXbOogfBZ7 -->

El objetivo:

Username: natas2
URL:      http://natas2.natas.labs.overthewire.org

En la URL anterior ponemos natas2 y la contraseña anterior.

Natas Level 2 –> Level 3

Miramos en el Inspector tenemos lo siguiente:


<div id="content">
	::bedore
	There is nothing on this page
	<img src="files/pixel.png">
</div>

Entonces en el objetivo:


http://natas2.natas.labs.overthewire.org/files/

Vemos un archivo llamado: users.txt.

Dentro hay lo siguiente:



# username:password
alice:BYNdCesZqW
bob:jw2ueICLvT
charlie:G5vCxkVV3m
natas3:G6ctbMJ5Nb4cbFwhpMPSvxGHhQ7I6W8Q
eve:zo4mJWyNj2
mallory:9urtcpzBmH

Ya tenemos para poder acceder al otro nivel:

Username: natas3
URL:      http://natas3.natas.labs.overthewire.org

Entramos en el objetivo anterior, en el alert: Usuario: natas3 Contraseña: G6ctbMJ5Nb4cbFwhpMPSvxGHhQ7I6W8Q (del archivo users.txt)

Natas Level 3 –> Level 4

En el código fuente tenemos la siguiente pista:


<!-- No more information leaks!! Not even Google will find it this time... -->

Con esa pista vamos a mirar los robots.txt

http://natas3.natas.labs.overthewire.org/robots.txt

Después de mirar los robots.txt

User-agent: *
Disallow: /s3cr3t/

Al entrar al objetivo:


http://natas3.natas.labs.overthewire.org/s3cr3t/

Nos sale un archivo llamado users.txt

¡Felicidades ya lo tenemos!

natas4:tKOcJIbzM4lTs8hbCmzn5Zr4434fGZQm

Natas Level 3 –> Level 4

El usuario:


Username: natas4
URL:      http://natas4.natas.labs.overthewire.org

La contraseña anterior: tKOcJIbzM4lTs8hbCmzn5Zr4434fGZQm

https://xss-game.appspot.com

Level 1

Ponemos lo siguiente en el campo de texto:

<script>
alert("hola");
</script>

http://www.xssgame.com

Foogle

En el campo de texto:

<script>
alert("hola");
</script>

https://hackmyvm.eu/

Challenges

001

Nos da el siguiente hash: aG12e2Jhc2U2NGRlY29kZXJ9

Usamos una herramienta: ejemplo buscamos por decrypt hash.

Y obtenemos: aG12e2Jhc2U2NGRlY29kZXJ9:hmv{base64decoder}

Bandera: hmv{base64decoder}

002

Nos dan el siguiente enlace: http://momo.hackmyvm.eu/ch4ll3ng3002/

Miramos en el código fuente: isthisthepassword?

Ponemos isthisthepassword? en el input

Bandera: HMV{thatwasreallyeazy}

004

Nos dan el sigueinte hash: 686d767b6d79666c61676973656173797d

Usamos una herramienta: decrypt hash

Conseguimos: 686d767b6d79666c61676973656173797d:hmv{myflagiseasy}

Bandera: hmv{myflagiseasy}

009

Se inspecciona la web: seleccionamos the flag is here

Bandera:  HMV{infrontofme}

014

Nos dan el siguiente enlace: http://momo.hackmyvm.eu/

Miramos los robots.txt

Bandera: HMV{robotized}

Descubre el secreto

Tenemos el siguiente código:

72 79 76 65 32 77 85 78 68 79

Para obtener el mensaje tenemos que tener en cuenta la tabla ASCII.

Solución:

HOLA MUNDO

What is the developer’s nickname?

Sir Code-a-lot

What month of the year was this webpage written in?

April

What is the name of the webpage that the developer has not finished making (and therefore not linked to)?

Admin.html

What is the administrator’s username?

admin

What is the administrator’s password?

SuperSecretPassword

What protocol was the flag transferred with?

HTTP