-
Notifications
You must be signed in to change notification settings - Fork 17
/
ac.py
221 lines (146 loc) · 6.55 KB
/
ac.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/usr/bin/python3
import sys , os , random , requests , time , pyperclip
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.proxy import Proxy , ProxyType
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from webdriver_manager.chrome import ChromeDriverManager
from fake_useragent import UserAgent
#color
class color:
PURPLE = '\033[95m'
GREEN = '\033[92m'
BOLD = '\033[1m'
CWHITE = '\33[37m'
print(color.BOLD)
#Fake useragent
options = Options()
ua = UserAgent()
userAgent = ua.random
options.add_argument(f'user-agent={userAgent}')
#Headless mode (set as true to use)
options.headless = False
#Don't close the browser
options.add_experimental_option("detach", True)
#Proxy (highly required)
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = "ip_addr:port"
prox.socks_proxy = "ip_addr:port"
prox.ssl_proxy = "ip_addr:port"
capabilities = webdriver.DesiredCapabilities.CHROME
#prox.add_to_capabilities(capabilities) # Remove '#' to use proxy
#webdriver
url = "https://www.instagram.com/accounts/emailsignup/"
CHROME_DIR = ""
browser = webdriver.Chrome(CHROME_DIR, options=options, desired_capabilities=capabilities)
print()
print( color.GREEN + "[+] " + color.CWHITE + "Using useragent as : " + userAgent)
#Open ig signup url
url = "https://www.instagram.com/accounts/emailsignup/"
browser.get(url)
#elements
time.sleep(3.517)
email = browser.find_element(By.CSS_SELECTOR, 'div.WZdjL:nth-child(4) > div:nth-child(1) > label:nth-child(1) > input:nth-child(2)')
fullname = browser.find_element(By.CSS_SELECTOR, 'div.WZdjL:nth-child(5) > div:nth-child(1) > label:nth-child(1) > input:nth-child(2)')
username = browser.find_element(By.CSS_SELECTOR, 'div.WZdjL:nth-child(6) > div:nth-child(1) > label:nth-child(1) > input:nth-child(2)')
Password = browser.find_element(By.CSS_SELECTOR, 'div.WZdjL:nth-child(7) > div:nth-child(1) > label:nth-child(1) > input:nth-child(2)')
signup_button = browser.find_element(By.CSS_SELECTOR, 'div.bkEs3:nth-child(1)')
# Create temporary email
browser.execute_script("window.open('');")
browser.switch_to.window(browser.window_handles[1])
browser.get("https://mail.tm")
time.sleep(6)
copy_button = browser.find_element(By.XPATH, """//*[@id="address"]""")
copy_button.click()
generated_email = pyperclip.paste()
print()
print( color.GREEN + "[!] " + color.CWHITE + "Generated Email : " + generated_email)
browser.switch_to.window(browser.window_handles[0])
#Create Random username
time.sleep(0.500)
username_file = open(os.getcwd() + "/usernames.txt", "r" )
lines = [line.rstrip() for line in username_file]
chose_random_username_list = random.sample(lines, k=1)
random_username_string = ''.join(chose_random_username_list)
random_username_number = str(random.randint(100000, 200000))
generated_random_username = random_username_string + random_username_number
print( color.GREEN + "[!] " + color.CWHITE +"Generated username = " + generated_random_username)
#Create random password to avoid detection (not really required)
time.sleep(0.500)
chose_random_password_list = random.sample(lines, k=1)
random_password_string = ''.join(chose_random_password_list)
random_password_number = str(random.randint(10000, 20000))
generated_random_password = random_password_string + random_password_number
print( color.GREEN + "[!] " + color.CWHITE +"Generated password = " + generated_random_password)
#Fields to use
my_email = generated_email
my_fullname = 'BOT KILLER'
my_username = generated_random_username
my_password = generated_random_password
#Fill the page
email.send_keys(my_email)
time.sleep(0.517)
fullname.send_keys(my_fullname)
time.sleep(0.312)
username.send_keys(my_username)
time.sleep(0.125)
Password.send_keys(generated_random_password)
time.sleep(2)
Password.send_keys(Keys.ENTER)
time.sleep(5)
#elements next page
birthday_month = browser.find_element(By.CSS_SELECTOR, '#react-root > section > main > div > div > div:nth-child(1) > div > div.qF0y9.Igw0E.IwRSH.eGOV_._4EzTm.bkEs3.DhRcB > div > div > span > span:nth-child(1) > select > option:nth-child(9)')
birthday_day = browser.find_element(By.CSS_SELECTOR, '#react-root > section > main > div > div > div:nth-child(1) > div > div.qF0y9.Igw0E.IwRSH.eGOV_._4EzTm.bkEs3.DhRcB > div > div > span > span:nth-child(2) > select > option:nth-child(25)')
birthday_year = browser.find_element(By.CSS_SELECTOR, '#react-root > section > main > div > div > div:nth-child(1) > div > div.qF0y9.Igw0E.IwRSH.eGOV_._4EzTm.bkEs3.DhRcB > div > div > span > span:nth-child(3) > select > option:nth-child(26)')
birthday_next_button = browser.find_element(By.CSS_SELECTOR, '#react-root > section > main > div > div > div:nth-child(1) > div > div.qF0y9.Igw0E.IwRSH.eGOV_._4EzTm.lC6p0.g6RW6 > button')
#Fill the page
birthday_month.click()
time.sleep(0.120)
birthday_day.click()
time.sleep(0.114)
birthday_year.click()
time.sleep(2)
birthday_next_button.click()
#Display countdown
browser.switch_to.window(browser.window_handles[1])
print()
print(color.GREEN + "[!] " + color.CWHITE + "Waiting for otp ")
print(color.GREEN + "[!] " + color.CWHITE + "Opening mail box in 15 seconds")
for remaining in range(15, 0, -1):
sys.stdout.write("\r")
sys.stdout.write("{:2d} seconds remaining.".format(remaining))
sys.stdout.flush()
time.sleep(1)
sys.stdout.write("\rComplete! \n")
browser.refresh()
time.sleep(2)
# otp page element
read_otp = browser.find_element(By.XPATH, '//*[@id="__layout"]/div/div[2]/main/div/div[2]/ul/li/a/div/div[1]/div[2]/div[2]/div/div[1]').text
# Read otp from mail
# Save response to response.Text
with open("response.text","w") as file:
file.write(str(read_otp))
read_otp_file = open("response.text")
lines = read_otp_file.readlines()
for line in lines:
my_otp = str(line[0:6])
print(color.GREEN + "[!] " + color.CWHITE + "OTP Recieved : " + my_otp)
# fill otp
browser.switch_to.window(browser.window_handles[0])
time.sleep(1)
fill_otp = browser.find_element(By.XPATH,'//*[@id="react-root"]/section/main/div/div/div[1]/div[2]/form/div/div[1]/input')
fill_otp.send_keys(my_otp)
time.sleep(2)
fill_otp.send_keys(Keys.ENTER)
# Write generated account
print(color.GREEN + '[!] ' + color.CWHITE + 'Saving account info as account_generated.txt ')
print()
with open("account_generated.txt","a+") as file:
file.write("\n")
file.write(my_email + " : " + my_password)