Crafter1030

Virusfree?

Feb 20th, 2025
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.97 KB | None | 0 0
  1. import os
  2. import string
  3. import random
  4. import time
  5. import numpy as np
  6. import keyboard as BasicBoard
  7. import pandas as pd
  8. from selenium import webdriver
  9. from selenium.webdriver.common.by import By
  10. from selenium.webdriver.chrome.options import Options
  11. import discord
  12. import pathlib
  13.  
  14. ChromeOptions = Options()
  15. ChromeOptions.add_argument("--log-level=3")
  16. Version = "2.2"
  17. Url = "https://store.steampowered.com/join"
  18. SteamIcon = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Steam_icon_logo.svg/240px-Steam_icon_logo.svg.png"
  19. BotUrl="https://github.com/lilkajt/Steam-Account-Generator"
  20. DomainInput = ""
  21. ClearConsole = os.system("cls||clear")
  22. BotPath = pathlib.Path().resolve()
  23.  
  24. # FILE FUNCTIONS
  25. def ExportCSV(email, username, password):
  26. data = {"Email": email, "Username": username, "Password": password}
  27. df = pd.DataFrame(data, index=[0])
  28. filePath = f"{BotPath}\\CreatedAccounts.csv"
  29.  
  30. if not os.path.exists(filePath):
  31. df.to_csv(filePath, index=False)
  32. else:
  33. df.to_csv(filePath, mode="a", index=False, header=False)
  34.  
  35. def AccountsFromCSV():
  36. fileName = input("\tWhat is the file name(without extension): ")
  37. file = pd.read_csv(f"{BotPath}\\{fileName}.csv")
  38. emails = file["Email"].tolist()
  39. usernames = file["Username"].tolist()
  40. passwords = file["Password"].tolist()
  41. return emails, usernames, passwords
  42.  
  43. def ExampleFile(fileName):
  44. data = {"Email":"[email protected]", "Username":"test1", "Password":"testpassword"}
  45. df = pd.DataFrame(data, index=[0])
  46. filePath = f"{BotPath}\\{fileName}.csv"
  47.  
  48. if not os.path.exists(filePath):
  49. df.to_csv(filePath, index=False)
  50.  
  51. def WebhookURL():
  52. f = open(f"{pathlib.Path().resolve()}\\webhook.txt", "r")
  53. return f.readline()
  54.  
  55. # NOTIFICATIONS
  56. def Notification(notiType):
  57. if notiType == "email":
  58. key = "m"
  59. elif notiType == "captcha":
  60. key = "c"
  61. else:
  62. key = "n"
  63. print(f"\n\tCheck {notiType} to confirm!\n\tPress \"{key}\" to continue!")
  64. while True:
  65. if BasicBoard.is_pressed(key):
  66. break
  67.  
  68. # RANDOM STRINGS
  69. def RndString(length):
  70. return "".join(random.choices(string.ascii_letters + string.digits, k=length))
  71.  
  72. def RndPassword(length):
  73. return RndString(length)
  74.  
  75. def RndDomainEmail(domain):
  76. username = RndString(8)
  77. return f"{username}@{domain}"
  78.  
  79. # DATA INPUTS
  80. def GenerateOption(option):
  81. if option == "domain":
  82. email, username, password = Domain()
  83. GenAccount(email, username, password)
  84. elif option == "newAccount":
  85. email, username, password = OneAccount()
  86. GenAccount(email, username, password)
  87. else:
  88. emails, usernames, passwords = AccountsFromCSV()
  89. for i in range(len(emails)):
  90. print(f"\tGenerating account nr {i+1}")
  91. GenAccount(emails[i], usernames[i], passwords[i])
  92.  
  93. def OneAccount():
  94. email = input("\tEnter your email: ")
  95. username = email.split("@")[0]
  96. password = RndPassword(14)
  97. return email, username, password
  98.  
  99. def Domain():
  100. global DomainInput
  101. if DomainInput == "":
  102. DomainInput = input("\tEnter your domain: ")
  103. email = RndDomainEmail(DomainInput)
  104. else:
  105. email = RndDomainEmail(DomainInput)
  106. username = email.split("@")[0]
  107. password = RndPassword(14)
  108. return email, username, password
  109.  
  110. # WEBHOOK
  111. def WebhookSend(email, username, password, profLink):
  112. webhookUrl = WebhookURL()
  113. if webhookUrl == "INSTEAD OF THIS LINE PUT YOUR DISCORD WEBHOOK TO GET NOTIFICATIONS!" or webhookUrl == "":
  114. print("\tInvalid webhook, change in webhook.txt.\n\tContinue...")
  115. else:
  116. webhook = discord.SyncWebhook.from_url(webhookUrl)
  117. webhook.send(embed=DiscordEmbed(email, username, password, profLink))
  118.  
  119. def DiscordEmbed(email, username, password, profLink):
  120. embed = discord.Embed(
  121. title="New Steam Account",
  122. color=0x669900
  123. )
  124. embed.set_author(name="SAG - Steam Account Generator", url=BotUrl)
  125. embed.add_field(name="Username", value=f"{username}")
  126. embed.add_field(name="Password", value=f"||{password}||")
  127. embed.add_field(name="Email", value=f"{email}",inline=False)
  128. embed.add_field(name="Profile link", value=f"{profLink}",inline=False)
  129. embed.set_footer(text="Account generated using SAG bot by Lilkajt", icon_url=SteamIcon)
  130. return embed
  131.  
  132. # MESSAGE
  133. def MenuMessage():
  134. print("")
  135. print("--------------------------------------------------")
  136. print(f"| WELCOME TO STEAM-ACCOUNT-GENERATOR Version {Version} |")
  137. print("--------------------------------------------------")
  138. print("")
  139. messageList = [[1, "create accounts from file"], [2, "create new account each time"], [3, "create accounts using your domain"], [4, "Create example file"], [5, "HELP"], [6, "Contact info"]]
  140. column = ["Options", "Description"]
  141. df = pd.DataFrame(messageList, columns=column)
  142. print(df.to_string(index=False))
  143.  
  144. def Help():
  145. print("\n\tHELP")
  146. print("\tOption domain supports custom user domains")
  147.  
  148. def Contact():
  149. print("\n\tContact information")
  150. print("\tdiscord: lilkajt#6121")
  151.  
  152. # GENERATOR
  153. def GenAccount(email, username, password):
  154. time.sleep(np.random.uniform(0, 0.1))
  155. driver = webdriver.Chrome(options=ChromeOptions)
  156. driver.get(Url)
  157. time.sleep(6)
  158. driver.find_element(By.XPATH, '//*[@id="email"]').click()
  159. for x in email: driver.find_element(By.XPATH, '//*[@id="email"]').send_keys(x), time.sleep(np.random.uniform(0, 0.1))
  160. time.sleep(0.5)
  161. driver.find_element(By.XPATH, '//*[@id="reenter_email"]').click()
  162. for x in email: driver.find_element(By.XPATH, '//*[@id="reenter_email"]').send_keys(x), time.sleep(np.random.uniform(0, 0.1))
  163. time.sleep(0.5)
  164. driver.find_element(By.XPATH, '//*[@id="i_agree_check"]').click()
  165. Notification("captcha")
  166. print("\n\tCaptcha confirmed!")
  167. driver.find_element(By.XPATH, '//*[@id="createAccountButton"]').click()
  168. Notification("email")
  169. print("\n\tEmail confirmed!")
  170. # SameEmail(driver)
  171. time.sleep(2)
  172. driver.find_element(By.XPATH, '//*[@id="accountname"]').click()
  173. for x in username: driver.find_element(By.XPATH, '//*[@id="accountname"]').send_keys(x), time.sleep(np.random.uniform(0, 0.1))
  174. time.sleep(0.5)
  175. driver.find_element(By.XPATH, '//*[@id="password"]').click()
  176. for x in password: driver.find_element(By.XPATH, '//*[@id="password"]').send_keys(x), time.sleep(np.random.uniform(0, 0.1))
  177. time.sleep(0.5)
  178. driver.find_element(By.XPATH, '//*[@id="reenter_password"]').click()
  179. for x in password: driver.find_element(By.XPATH, '//*[@id="reenter_password"]').send_keys(x), time.sleep(np.random.uniform(0, 0.1))
  180. # username = NameCheck(driver, username)
  181. time.sleep(1)
  182. driver.find_element(By.XPATH, '//*[@id="createAccountButton"]').click()
  183. time.sleep(6)
  184. profLink = ExtractLink(driver)
  185. print("\tAccount successfully created")
  186. ExportCSV(email, username, password)
  187. WebhookSend(email, username, password, profLink)
  188. driver.close()
  189.  
  190. # Not working
  191. def SameEmail(driver,option=True):
  192. element = f"return document.querySelectorAll(\"button\")[2].textContent"
  193. element = driver.execute_script(element)
  194. if element == "Continue" and option == True:
  195. driver.execute_script("EmailConfirmedVerified( 0 );")
  196. else:
  197. print("\tWaiting for input...")
  198. input()
  199.  
  200. # Not working
  201. def NameCheck(driver, username):
  202. element = "return document.querySelectorAll(\".password_tag.warning\")[0].textContent"
  203. element = driver.execute_script(element)
  204. # print(f"name check script run element {element}")
  205. if element == "Not Available":
  206. time.sleep(1)
  207. newUsername = driver.execute_script("return document.querySelector(\"#suggested_name_1\").text")
  208. # newUsername = driver.find_element(By.XPATH, '//*[@id="suggested_name_1"]').text
  209. driver.find_element(By.ID, "suggested_name_1").click()
  210. print(f"\tName taken. Changing name.\n\tNew name {newUsername}")
  211. Notification("account name")
  212. return newUsername
  213. return username
  214.  
  215. def ExtractLink(driver):
  216. profLink = f"return document.querySelector(\"a\").getAttribute(\"href\")"
  217. profLink = driver.execute_script(profLink)
  218. return profLink
  219.  
  220. def ProgramMenu():
  221. ClearConsole
  222. MenuMessage()
  223. match (input("Input number you choose: ")):
  224. case "1":
  225. ClearConsole
  226. print("\tYou choose creating accounts from CSV file")
  227. GenerateOption("file_accounts")
  228. case "2":
  229. ClearConsole
  230. print("\tYou choose creating new accounts each time")
  231. for i in range(int(input("\tHow many accounts would you like to generate? "))):
  232. print(f"\tGenerating account nr {i+1}")
  233. GenerateOption("newAccount")
  234. case "3":
  235. ClearConsole
  236. print("\tYou choose creating accounts using your domain\t")
  237. for i in range(int(input("\tHow many accounts would you like to generate? "))):
  238. print(f"\tGenerating account nr {i+1}")
  239. GenerateOption("domain")
  240. case "4":
  241. ClearConsole
  242. print("\tCreating example file")
  243. ExampleFile(input("\tWhat file name do you want: "))
  244. print("\tDone! Check current folder")
  245. time.sleep(3)
  246. ProgramMenu()
  247. case "5":
  248. ClearConsole
  249. Help()
  250. time.sleep(5)
  251. ProgramMenu()
  252. case "6":
  253. ClearConsole
  254. Contact()
  255. time.sleep(5)
  256. ProgramMenu()
  257. case other:
  258. print(f"Incorrect input! {other}")
  259. print("Restarting!")
  260. time.sleep(5)
  261. ClearConsole
  262. ProgramMenu()
  263.  
  264. try:
  265. ProgramMenu()
  266. time.sleep(1)
  267. except Exception as err:
  268. print(err)
  269. print("Press any key to close the program...")
  270. input()
Advertisement
Add Comment
Please, Sign In to add comment