Account Generator

When a password input is detected, it will generate a Email;Username;Password combination and set it to clipboard, then it waits until a email was received and alerts the user of it

  1. // ==UserScript==
  2. // @name Account Generator
  3. // @version 2.2
  4. // @license MIT
  5. // @description When a password input is detected, it will generate a Email;Username;Password combination and set it to clipboard, then it waits until a email was received and alerts the user of it
  6. // @author TheEmptynessProject (https://github.com/TheEmptynessProject)
  7. // @match *://*/*
  8. // @grant GM_setClipboard
  9. // @grant GM_xmlhttpRequest
  10. // @grant GM_registerMenuCommand
  11. // @namespace https://github.com/TheEmptynessProject/AccountGenUniversal
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. let passLen = 16; //Set to your desired password length
  17. GM_registerMenuCommand('Generate', generate);
  18. function generatePassword(leng) {
  19. const lowerLetters = "abcdefghijklmnopqrstuvwxyz";
  20. const upperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  21. const numbers = "1234567890";
  22. const symbols = "\|!@#%&/([)]=}?+*~^,.:-_<>";
  23. const all = lowerLetters + upperLetters + numbers + symbols;
  24. let pass = "";
  25.  
  26. pass += lowerLetters[Math.floor(Math.random() * lowerLetters.length)];
  27. pass += upperLetters[Math.floor(Math.random() * upperLetters.length)];
  28. pass += numbers[Math.floor(Math.random() * numbers.length)];
  29. pass += symbols[Math.floor(Math.random() * symbols.length)];
  30.  
  31. for (let i = 4; i < leng; i++) {
  32. pass += all[Math.floor(Math.random() * all.length)];
  33. }
  34.  
  35. pass = pass.split('').sort(function() {
  36. return 0.5 - Math.random()
  37. }).join('');
  38.  
  39. return pass;
  40. }
  41.  
  42. function getEmail() {
  43. return new Promise((resolve, reject) => {
  44. GM_xmlhttpRequest({
  45. method: "GET",
  46. url: "https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1",
  47. onload: function(response) {
  48. let res = JSON.parse(response.response)[0]
  49. resolve(res);
  50. }
  51. });
  52. });
  53. }
  54.  
  55. function waitForEmail(email) {
  56. const intervalId2 = setInterval(function() {
  57. GM_xmlhttpRequest({
  58. method: "GET",
  59. url: `https://www.1secmail.com/api/v1/?action=getMessages&login=${email.substring(0, email.indexOf('@'))}&domain=${email.substring(email.indexOf('@') + 1)}`,
  60. onload: function(response) {
  61. const ref_response = JSON.parse(response.responseText);
  62.  
  63. if (ref_response.length > 0) {
  64. const first_msg = ref_response[0];
  65. const msg_id = first_msg.id;
  66. const from_msg = first_msg.from || 'Unknown Sender';
  67. const subject = first_msg.subject || 'No Subject';
  68. const date = first_msg.date || 'No Date';
  69.  
  70. const msg_details = `From: ${from_msg}\nSubject: ${subject}`;
  71.  
  72. GM_xmlhttpRequest({
  73. method: "GET",
  74. url: `https://www.1secmail.com/api/v1/?action=readMessage&login=${email.substring(0, email.indexOf('@'))}&domain=${email.substring(email.indexOf('@') + 1)}&id=${msg_id}`,
  75. onload: function(bodyResponse) {
  76. const msg_body_response = JSON.parse(bodyResponse.responseText);
  77. const msg_body = msg_body_response.body || 'No Body';
  78. console.log("Received EMAIL");
  79. clearInterval(intervalId2);
  80. openEmailInNewTab(msg_body);
  81. }
  82. });
  83. }
  84. }
  85. });
  86. }, 1000);
  87. }
  88.  
  89. function openEmailInNewTab(content) {
  90. const dataUri = 'data:text/html,' + encodeURIComponent(content);
  91. const newTab = window.open(dataUri, '_blank');
  92. if (!newTab) {
  93. alert('Popup blocked. Please allow popups and try again. Logged email to console and set url to clipboard.');
  94. GM_setClipboard(dataUri);
  95. console.log(content);
  96. }
  97. }
  98.  
  99. async function generate() {
  100. let email = await getEmail();
  101. let pass = generatePassword(passLen);
  102. let user = "";
  103. const first = [
  104. 'James', 'Sophia', 'Ahmed', 'Maria', 'Chen', 'Isabella', 'Muhammad', 'Emma', 'Juan', 'Aya',
  105. 'Mateo', 'Fatima', 'Liam', 'Sophie', 'Raj', 'Mia', 'Luca', 'Sofia', 'Yuki', 'Andrei',
  106. 'Olivia', 'Pedro', 'Amara', 'Kai', 'Leila', 'Alejandro', 'Elsa', 'Ahmed', 'Amina', 'Viktor',
  107. 'Alice', 'Diego', 'Maya', 'Hugo', 'Sarah', 'Ivan', 'Jasmine', 'Santiago', 'Camila', 'Felix',
  108. 'Aisha', 'Daniel', 'Nia', 'Fabio', 'Anastasia', 'Khaled', 'Luna', 'Oscar', 'Priya', 'Amir'
  109. ];
  110. const second = [
  111. 'Zephyr', 'Jamboree', 'Whimsy', 'Gobsmack', 'Bumble', 'Quasar', 'Lullaby', 'Zigzag', 'Sassafras', 'Galaxy',
  112. 'Quokka', 'Noodle', 'Bamboo', 'Pumpernickel', 'Sphinx', 'Lollipop', 'Blizzard', 'Muffin', 'Quicksilver', 'Jellybean',
  113. 'Penguin', 'Chameleon', 'Umbrella', 'Moonbeam', 'Sasquatch', 'Jigsaw', 'Kangaroo', 'Rhubarb', 'Waffle', 'Flapdoodle',
  114. 'Brouhaha', 'Cactus', 'Turbulence', 'Platypus', 'Tango', 'Fandango', 'Gobbledygook', 'Kaleidoscope', 'Serenity',
  115. 'Avalanche', 'Phoenix', 'Pegasus', 'Spectre', 'Cascade', 'Veridian', 'Abyss', 'Torrent', 'Cascade', 'Mirage'
  116. ];
  117. user = first[Math.round(Math.random() * first.length)] + second[Math.round(Math.random() * second.length)];
  118. let output = email + ";" + user + ";" + pass
  119. GM_setClipboard(output);
  120. waitForEmail(email);
  121. }
  122. })();