👑Find CSRF

  1. Create two Different User accounts on the target site, Mozilla will be the csrfattacker and Chrome will be the csrfvictim.

  2. Verify your email address if it asks for verification.

  3. In the attacker account sign in and go to profile/account settings.

  4. Try changing the default values on those forms and submit the form.

  5. Capture the request in BurpSuite.

  6. Check if any CSRF token is present or not

  7. If Token is not present then the site may be vulnerable to CSRF.

  8. Now you are good to go, send the request to the repeater and drop the request.

  9. Go to the repeater tab and send the request. If you get 200 responses.

  10. Try again, but this time just change any value in the request and send the request.

  11. Go to your profile and check that the value you sent via burp repeater gets updated in your profile. If it gets updated, then it is vulnerable.

  12. Now build an Exploit: Right-click on the request and choose engagement tools and click on generate CSRF PoC in BURP as an attacker with auto submit script option enabled.

  13. Now in Chrome open the csrfvictin account and in a new tab submit this csrf.html file and the information will get changed in the csrfvictin account.

  14. To cross-verify the change, in the first tab refresh your Settings page.

-------------------------------------------------------------

Some Tips to bypass CSRF tokens

  • Try removing the token value and parameter from the request and see that the request actually made any changes in the profile, if yes then you can bypass it.

  • Try adding your own custom / random string into the token parameter replacing the original token. Its length should be equal to the original token

  • Try using the old tokens in the new request

  • Try Converting the POST request to a GET request, remove the CSRF token, and send the request.

  • Try removing anti-CSRF headers from the request.

Last updated