Host header authentication bypass | Portswigger Lab

g0y3nd4 [Shuvo Biswas]
2 min readFeb 15, 2023

--

HTTP Host header attacks | walkthrough

Lab Description: This lab makes an assumption about the privilege level of the user based on the HTTP Host header.

To solve the lab, access the admin panel and delete Carlos’s account.

*At first I reviewed ‘source-code’ and ‘bruteforce directory’ but nothing interesting here.

*Then I find ‘robots.txt’ and find disallow ‘/admin’.

robots.txt

*After visiting ‘/admin’ I got a message “Admin interface only available to local users”. It means the Admin page only can access local users.

‘/admin’ page

*After intercept the ‘/admin’ request and response in Burpsuite repeater, then I see “401 Unauthorized”.

*Then I try to edit request and add “X-Forwarded-For: localhost” but it’s not working.

*Then I change the “Host” to “Host: localhost” and I accessed the admin panel .

*After accessing the admin I found 2 users here. The Lab was I have to delete the ‘Carlos’ user.

Admin Panel

*I found a path in response for deleting the user ‘Carlos’.

Path of deleting the user ‘carlos’

*Using this path I successfully delete the user ‘Carlos’ and its follow redirection to the admin panel.

Delete ‘carols’ user

*After redirecting the Admin page the Lab was solved successful .

--

--

g0y3nd4 [Shuvo Biswas]
g0y3nd4 [Shuvo Biswas]

Written by g0y3nd4 [Shuvo Biswas]

Ethical Hacking |JGEC | CTF Player | Cyber Security

No responses yet