The-Mission-part-1

La Mission Partie 1 - Knock Knock

Publié le 06/06/2024, 16:33:00

Ce défi était le premier d'une série de 7 sur la même blackbox, et qui nous permettait d'utiliser tous les outils automatisés nécéssaires.

En se connectant au site du challenge, nous sommes redirigés sur l'url: /app/login , Qui montre aussi un bouton d'enregistrement. Pour enregistrer un nouvel utilisateur, cela fut plus compliqué que prévu. Déjà il n'était pas possible d'enregistrer un compte avec un domain autre que nahamcon.ctf. Vu que l'application envoie des confirmations d'inscription par mail avant d'activer l'accès, j'étais un peu bloqué.

Validation nécéssaire

Après plus d'énumération des composants, j'ai remarqué que /app/logout redirigeait sur /dev-app, ce qui m'a permis un nouveau pas en avant.

Trouver des nouveaux points de terminaison

Registering a user there proved more successful and didn’t have validation, which gave me a cookie named dev-token. It took me quite some time before realising that the logout option, if used on the /app side, would actually send a delete request for the correct cookie name for production.

Name of the production cookie

With the correct cookie name, it was then possible to simply reuse the jwt cookie obtained on the dev-app and reuse it in the production app, by changing its name in the browser tools or burp.

token-for-prod=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozfQ.MVXc0x_5qMYMmU3orSxp7HfC1FOB9FXuutII-AP_eno

With that in hand, we now can be identified as an authenticated user in the dashboard, even though it’s unavailable for maintenance.

Authentication successful!

Expanding on previous findings, since we now had a username, I wanted to see his details so I visited the following and caught the flag!

/app/api/me

Caught the flag!

flag{925f2f867c0f46d986979c935aafca31}

starlord-profile

Star-Lord - Développeur


Synthweb.ch - création de site web en Suisse, LinkedIn, Instagram