Advertisement
Guest User

Untitled

a guest
May 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.29 KB | None | 0 0
  1. <html>
  2.   <body>
  3.     <div id="t"></div>
  4.    
  5.   </body>
  6. <script>
  7.   function sleep(ms) {
  8.     return new Promise(resolve => setTimeout(resolve, ms));
  9.   }
  10.  
  11.   function makeid(length) {
  12.    var result           = '';
  13.    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  14.    var charactersLength = characters.length;
  15.    for ( var i = 0; i < length; i++ ) {
  16.      result += characters.charAt(Math.floor(Math.random() * charactersLength));
  17.   }
  18.   return result;
  19. }
  20.  
  21.  async function create() {
  22.    var http = new XMLHttpRequest();
  23.    var url = 'new_account.php';
  24.    
  25.  
  26.    // Sleep in loop
  27.    while(true) {
  28.      await sleep(500);
  29.      var params = ''.concat('firstname=', makeid(5), "&username=", makeid(5), "&password=", makeid(5));
  30.      http.open('POST', url, true);
  31.  
  32.      //Send the proper header information along with the request
  33.      http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  34.  
  35.      http.onreadystatechange = function() {//Call a function when the state changes.
  36.          if(http.readyState == 4 && http.status == 200) {
  37.            document.getElementById('t').innerHTML += http.responseText;
  38.          }
  39.      }
  40.      http.send(params);
  41.      await sleep(500);
  42.    }
  43.  }
  44.  create();
  45. </script>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement