Write-up: Authentication bypass via information disclosure @ PortSwigger Academy

Frank Leitner
InfoSec Write-ups
Published in
3 min readNov 24, 2022

--

This write-up for the lab Authentication bypass via information disclosure is part of my walkthrough series for PortSwigger’s Web Security Academy.

Learning path: Server-side topics → Information disclosure

Python script: script.py

Lab description

Steps

Analysis

The lab application is a shop website with very interesting products. As usual, the first step is checking the website.

After browsing around a bit and logging in with the known credentials, nothing too interesting appears. Time to check the requests in Burp. Nothing too interesting there either.

The admin endpoint in some previous labs was found under /admin. But to avoid using this knowledge, I can use multiple means of content discovery. Burp Professional comes with such functionality and several good free tools allow for content discovery as well.

The one I use here is ffuf together with the great wordlists provided by SecLists:

Visiting the endpoint

I visit this page to receive this message:

No more information is given.

A common way of propagating originating IPs to a web server (used in proxy or load balancing scenarios) is the X-Forwarded-For header. This, however, does not work here (and the lab description states it is a custom header anyway).

Two HTTP verbs can be used to obtain additional information, OPTIONS and TRACE. The latter produces an interesting result:

Supply custom header

Now that I know the header, accessing the admin interface becomes easy. I need to ensure the custom header is sent with each request so I add a Match and Replace rule to always add this new header to requests.

I use 127.0.0.1 as the content to trick the application to believe that the request originated from localhost.

Now just reload the page in the browser, access the admin panel and delete user carlos to solve the lab:

From Infosec Writeups: A lot is coming up in the Infosec every day that it’s hard to keep up with. Join our weekly newsletter to get all the latest Infosec trends in the form of 5 articles, 4 Threads, 3 videos, 2 GitHub Repos and tools, and 1 job alert for FREE!

--

--

Tech nerd, doing security stuff for fun and some as a job | CISSP-ISSAP, OSCP