Lab: Offline password cracking
This lab stores the user's password hash in a cookie. The lab also contains an XSS vulnerability in the comment functionality. To solve the lab, obtain Carlos's
stay-logged-in cookie and use it to crack his password. Then, log in as
carlos and delete his account from the "My account" page.
With Burp running, use your own account to investigate the "Stay logged in" functionality. Notice that the
stay-logged-incookie is Base64 encoded.
Decode the cookie to see that it is constructed as follows:
- You now need to steal the victim user's cookie. Observe that the comment functionality is vulnerable to XSS.
- Go to the exploit server and take note of the URL.
Go to one of the blogs and post a comment containing the following stored XSS payload, remembering to enter your own exploit server ID:
On the exploit server, open the access log. There should be a
GETrequest from the victim containing their
Decode the cookie in Burp Decoder. The result will be
Copy the hash and paste it into a search engine. This will reveal that the password is
- Log in to the victim's account, go to the "My account" page, and delete their account to solve the lab.
Note: The purpose of this lab is to demonstrate the potential of cracking passwords offline. Most likely, this would be done using a tool like hashcat, for example. When testing your clients' websites, we do not recommend submitting hashes of their real passwords in a search engine.