๐ Admin Access
A detailed write-up of the Web challenge 'Admin Access' from KnightCTF - 2025
Initial Analysis
The site appeared as follows, with a login screen:
After completing the registration and login phase, you would enter a completely empty dashboard where the only available action was to log out. Thatโs when I realized that registering was pointless. Inspecting the page source, I found a strange comment:
the comment revealed an email, most likely belonging to the account containing the flag. Continuing to explore the site since it was a black-box challenge without any files I found the “Forgot Password” section:
Where it was possible to specify an email to reset a password. At this point, I thought about resetting the password for the account associated with the email I had found earlier. And I considered a Host Header Injection.
Exploit
So i started ngrok on port 80:
Host: ngrok_link
. By sending the request with the modified Host header through ngrok, I was able to extract the reset token from the previously sent “Forgot Password” request with the email kctf2025@knightctf.com:
After extracting the valid token, I reset the password using the obtained link and logged in with the account using the following credentials:
|
|
Automated Exploit
I also created a fully automated exploit that performs the entire process described earlier:
|
|
this is exploit.py
:
|
|
and this is request.py
:
|
|