Advertisement
Guest User

Untitled

a guest
Apr 10th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. //params
  2. username = 'USERNAME'; // your login email / username
  3. password = 'PASSWORD'; //your login password
  4. yubikey_string = 'xxxxxx'; //your users unique 6 character yubikey string
  5.  
  6. function makeid(id) {
  7. var text = "";
  8. var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  9. for (var i = 0; i < 32; i++)
  10. text += possible.charAt(Math.floor(Math.random() * possible.length));
  11. return 'ffffff' + id + text;
  12. }
  13.  
  14. yubikey = makeid(yubikey_string);
  15.  
  16. //populate login form fields
  17. var inputs = document.querySelectorAll('input');
  18. inputs[0].focus();
  19.  
  20. document.execCommand('insertText', false, username);
  21. inputs[1].focus();
  22.  
  23. document.execCommand('insertText', false, password);
  24. //submit form
  25. document.querySelector('button').click();
  26.  
  27. //wait to populate yubikey field
  28. setTimeout(() => {
  29. document.querySelector('input').focus();
  30. document.execCommand('insertText', false, yubikey);
  31. document.querySelector('button').click();
  32. }, 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement