When a user logs in to an application, they usually only have access to the parts of the application that they need to perform their specific tasks. If access controls are incorrectly set, a user can gain access to functionality that should only be available to higher-privileged users.
If you have credentials for a high-privileged and a low-privileged account, you can test the effectiveness of an application's access controls by accessing the application using different accounts. You can use Burp to send ad-hoc requests to compare access or automate the steps for sending multiple requests as a different user.
You can follow along with the processes below using the lab Method based access control can be circumvented from our Web Security Academy.
Get credentials for an admin / high-privileged account and a low-privileged user.
To run a quick test on specific endpoints, you can use Burp Repeater:
administrator:admin.
wiener:peter.
Find the low privileged user's most recent request. Select the request and copy the session cookie.
401 Unauthorized response.
Testing for privilege escalation on a large number of endpoints can be time-consuming. Burp Suite can help you to automate this process across all the requests in the current site map:
administrator:admin. Browse around the application to populate Target > Site map making sure you visit the admin panel.
wiener:peter.
Go to the Proxy > HTTP history tab. Select the low-privileged user's most recent request and copy the session cookie to use later.
Create a session handling rule that adds the low-privileged user's session cookie to all requests sent from the Target tool:
Set the following details to add the low-privileged user's session cookie.
Name: session
Value: The cookie you copied from your low-privileged user's request
Re-request the entire site map as a low-privileged user:
401 Unauthorized, confirming that this endpoint is not vulnerable in this case.
You can also use the Autorize extension from the BApp Store to compare requests. This lets you browse as a high-privileged and mirrors the requests as a low-privileged user.