Skip to content

Instantly share code, notes, and snippets.

@mauro-balades
Last active May 14, 2023 07:05
Show Gist options
  • Save mauro-balades/94121f3e511faca57fd7783af7bcb7da to your computer and use it in GitHub Desktop.
Save mauro-balades/94121f3e511faca57fd7783af7bcb7da to your computer and use it in GitHub Desktop.
Create infinite accounts with logbug
from selenium import webdriver
import undetected_chromedriver as uc
import random
import string
import csv
from time import sleep
def id_generator(size=50, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
accounts = {}
options = uc.ChromeOptions()
options.headless = True
options.binary_location = "/usr/bin/chromedriver"
driver = uc.Chrome(use_subprocess=True, options=options)
driver.get("http://thelogbug.com/components/auth/signup.php")
sleep(10)
try:
while True:
chars = id_generator(50)
email = id_generator(10) + "@" + id_generator(10) + "." + id_generator(10)
driver.find_element("xpath", '//*[@id="signup-form"]/form/div[1]/input').send_keys(chars) # name
driver.find_element("xpath", '//*[@id="signup-form"]/form/div[2]/input').send_keys(email) # email
driver.find_element("xpath", '//*[@id="signup-form"]/form/div[3]/input').send_keys(chars) # username
driver.find_element("xpath", '//*[@id="signup-form"]/form/div[4]/input').send_keys(chars) # password
driver.find_element("xpath", '//*[@id="signup-form"]/form/div[5]/input').click() # hit login button
driver.find_element("xpath", '//*[@id="signup-link"]/p/a').click() # register a new account
accounts[chars] = email
except KeyboardInterrupt:
with open('accounts.csv', 'w', newline='') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=' ',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
for k,v in accounts.items():
spamwriter.writerow([k, v])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment