Let’s start discussing various techniques of exploiting IDOR vulnerabilities, from basic enumeration to mass data gathering, to user privilege escalation.
Insecure Parameters
Employee Manager web application that hosts employee records.
Let’s say we are logged in as an employee with user id uid=1
.
Once we click on Documents
, we are directed to /documents.php?uid=1
.
Documents
page shows uploaded files from our user:
Files above seems to be using the user uid
and the month/year as part of the file name, which may allow us to fuzz files for other users.
This is one of the most basic type of IDOR - Static File IDOR
Also, if the web app doesn’t have proper access control system, we will be able to view other employee’s document by simply changing uid
value to something else.
Mass Enumeration
We can use tools like Burp Suite
or ZAP
to retrieve all the files or write a small bash script to download all files.
Let’stake a view at the HTML source code:
We can pick any unique word to be able to grep
the link of the file. In our case, we see that each link starts with <li class='pure-tree_link'>
, so we may curl
the page and grep
for this line, as follows:
Let’s use Regex
with grep
to only get the documents links:
Now, we can use a simple for
loop to loop over the uid
parameter and return the document of all employees, and then use wget
to download each document link:
When we run the script, it will download all documents from all employees with uids
between 1-10.