On this page
Insecure Direct Object References — IDOR
Lab
Insecure direct object references · Apprentice
Solution
Given
This lab stores user chat logs directly on the server's file system, and retrieves them using static URLs.
Solve the lab by finding the password for the user `carlos`, and logging into their account.
Analyzing the task
The chat history is stored on the server's file system and accessible via static URLs. We need to find the password for user carlos, apparently by finding it in the user's transcripts.
Recon
Open the site, see Live Chat. Open it, write a couple of messages. Oh, there's a View transcript button, click it — downloads a TXT file.
Okay, let's see what happened in Burp. On clicking View transcript:
POST /download-transcript
Returns HTTP/2 302 Found:
Location: /download-transcript/2.txt
So it's a redirect to download the file.
Okay, let's try guessing other transcripts:
Location: /download-transcript/3.txt
Location: /download-transcript/4.txt
Location: /download-transcript/5.txt
No transcript. Didn't work right away. Throw it into Intruder, params from 0 to 100 to start. Ha, found just one — 1.
GET /download-transcript/1.txt
You: Ok so my password is v6skv9vlon85s20dcidq. Is that right?
Password obtained. Log in to the site. Lab solved.
More in this category
Web Shell Upload via Extension Blacklist Bypass (PortSwigger Lab)
.php is blacklisted, but .htaccess uploads without complaint — we slip our own Apache config in and make the server execute shell.bug as PHP.
Web Shell Upload via Obfuscated File Extension (PortSwigger Lab)
Extension blacklist rejects .php and a double-extension shell.php.jpg is served as an image — a null byte in shell.php%00.jpg bypasses both checks.
Remote Code Execution via Web Shell Upload (PortSwigger Lab)
Avatar upload has no validation — drop a PHP web shell and read /home/carlos/secret.