HTTP Host header attacks - gachikuku/portswigger GitHub Wiki
Apprentice lab:
Host header authentication bypass
Apprentice lab:
Host header authentication bypass
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 the user carlos
.
-
Solution
- Visit
/admin
endpoint. - Intercept on (using
mitmproxy
) and reload page. - Notice an HTTP/2 Request is made. Add
:authority
Header and set it tolocalhost
. - Do the same for delete poor
carlos
request.
- Visit
IMPORTANT NOTE:
See discussion as on why:authority
pseudo-header is used, instead ofHost
.
Apprentice lab:
Basic password reset poisoning
Apprentice lab:
Basic password reset poisoning
This lab is vulnerable to password reset poisoning. The user carlos
will carelessly click on any links in emails that he receives. To solve the lab, log in to Carlos's account.
You can log in to your own account using the following credentials: wiener:peter
. Any emails sent to this account can be read via the email client on the exploit server.
-
Solution
- Login as
wiener:peter
. - Do what normally would someone do, if password was lost. Study the flow.
- Modify the POST request of
/forgot-password
by adding a:authority: domain
header and changing the username tocarlos
. - Replay (
r
) the request and go to logs. A token is received from a different IP. Copy the token and reset the password forcarlos
. - Login as
carlos
.
- Login as