🌐 Local Authority
A detailed write-up of the Web challenge 'Local Authority' from PicoCTF - 2022
📊 Challenge Overview
Category Details Additional Info 🏆 Event PicoGym Event Link 🔰 Category Web 🌐 💎 Points Out of 500 total ⭐ Difficulty 🟢 Easy Personal Rating: 0/10 👤 Author LT ‘syreal’ Jones Profile 🎮 Solves 54.440 solve rate 📅 Date 29-01-2025 PicoGym 🦾 Solved By mH4ck3r0n3 Team:
📝 Challenge Information
Can you get the flag?
🎯 Challenge Files & Infrastructure
Provided Files
1
Files: None
🔍 Initial Analysis
First Steps
Initially, the website appears as follows:
Initially, I thought of an SQL Injection, but when I tried to insert special characters, as mentioned above, they were blocked. So, I tried logging in with the credentials
admin:admin
, but the only screen I received was an error screen:So, I decided to inspect the
/login.php
page, since there was nothing interesting on the page where the actual login was.As we can see, there is a JavaScript function that creates a hash. If the login is successful, it sets the hash in the invisible
admin_form
and sends a POST request to/admin.php
(which will verify if the hash is correct). In fact, when I tried to access/admin.php
directly, I only received aNot Authorized
message since I hadn’t passed a valid hash. In the source, there was also a script included in the page, as we can seesecure.js
. By clicking on it, I found the source:As we can see, the validation is done here, and it appears that the password is in plaintext. Let’s move on to the exploit.
🎯 Solution Path
Exploitation Steps
Exploitation
The exploit was simply to access the login page with the credentials
admin:strongPassword098765
. Once I did that, I was redirected to/admin.php
, where the flag was present.
Flag capture
🛠️ Exploitation Process
Approach
The exploit makes a request to the
/login.php
page and logs in. It then extracts the hash and makes a request to the/admin.php
page, passing the correct hash extracted via a regex. The flag was present in the request’s response text, and I extracted it using a regex to then print it.
🚩 Flag Capture
Flag
Proof of Execution
🔧 Tools Used
Tool Purpose Python Exploit ChromeDevTools Web Testing
💡 Key Learnings
Time Optimization
Always inspect the source code of all pages.
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
📊 Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:02 | From start to flag |
Global Ranking | Challenge ranking | |
Points Earned | Team contribution |
Created: 29-01-2025 • Last Modified: 29-01-2025 *Author: mH4ck3r0n3 • Team: *