Home Portswigger writeup - Password reset poisoning via middleware
Post
Cancel

Portswigger writeup - Password reset poisoning via middleware

Lab: Password reset poisoning via middleware

To solve this lab, you have to mix different techniques seen in the previous labs of the same series in order to steal, once again, the cookie of this unfortunate Carlos.

  1. On the home page, click “My account

    Password-reset-poisoning-via-middleware-1.png

  2. Then, click “Forgot password”

    Password-reset-poisoning-via-middleware-2.png

  3. Enter your username, “wiener” and click “Submit”

    Password-reset-poisoning-via-middleware-3.png

  4. Access the email client through the exploit server (take the opportunity to keep the exploit server’s URL on a notepad for later)

    Password-reset-poisoning-via-middleware-4.png

    Password-reset-poisoning-via-middleware-5.png

  5. Click the link

    Password-reset-poisoning-via-middleware-5.png

  6. Enter twice a password (kept “peter” in this example) and click “Submit”

    Password-reset-poisoning-via-middleware-6.png

  7. In Burp Suite > Proxy > HTTP History, find the POST request “/forgot-password” that contains the username “wiener”, send it to Repeater

    Password-reset-poisoning-via-middleware-7.png

  8. In Repeater, add the header“X-Forwarded-Host: <your exploit server URL>”, change “wiener” to “carlos” and send it

    Password-reset-poisoning-via-middleware-8.png

  9. Go back to your email client, copy the link, paste it in a new tab, delete the token and don’t send it for the moment

    Password-reset-poisoning-via-middleware-9.png

    Password-reset-poisoning-via-middleware-10.png

  10. Go back to the exploit server, click “Access logs”

    Password-reset-poisoning-via-middleware-11.png

  11. Find the GET request for “/forgot-password” that contains the token for “carlos“

    Password-reset-poisoning-via-middleware-12.png

  12. Go back to the new open tab (the one opened step 9), add carlos’s token at the end of the URL, where you deleted yours a few steps ago, and send it

    Password-reset-poisoning-via-middleware-14.png

  13. Enter twice a password (entered “peter” as well for this account) and submit

    Password-reset-poisoning-via-middleware-15.png

  14. Go to “My account” again

    Password-reset-poisoning-via-middleware-16.png

  15. Enter Carlos’s new credentials and click “Submit”

    Password-reset-poisoning-via-middleware-17.png

  16. The lab is solved

    Password-reset-poisoning-via-middleware-18.png

This post is licensed under CC BY SA 4.0 by the author.