-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.py
227 lines (170 loc) · 6.62 KB
/
main.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
222
223
224
225
226
227
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
import requests
import os
from lxml.html import fromstring
from random import randint, uniform, shuffle, choice
from time import sleep
from password_generator import PasswordGenerator
from selenium_stealth import stealth
from faker import Faker
from fake_headers import Headers
import platform
def Type_Me(element: WebElement, text: str):
for character in text:
element.send_keys(character)
sleep(uniform(.07, .15))
def Fetch_Proxies():
url = 'https://sslproxies.org/'
response = requests.get(url)
parser = fromstring(response.text)
proxies_list = list()
for i in parser.xpath('//tbody/tr')[:100]:
if i.xpath('.//td[7][contains(text(),"yes")]'):
proxy = ":".join([i.xpath('.//td[1]/text()')[0], i.xpath('.//td[2]/text()')[0]])
proxies_list.append(proxy)
shuffle(proxies_list)
return proxies_list
def Get_Valid_Proxy(proxies_list):
header = Headers(
headers=False
).generate()
agent = header['User-Agent']
headers = {
'User-Agent': f'{agent}',
}
url = 'http://icanhazip.com'
while(True):
proxy = choice(proxies_list)
proxies = {
'http': f'http://{proxy}',
'https': f'https://{proxy}',
}
try:
response = requests.get(url , headers=headers, proxies=proxies, timeout=1)
if(response.status_code == 200):
return proxy
except:
continue
def Generate_Proxy():
proxies_list = Fetch_Proxies()
proxy = Get_Valid_Proxy(proxies_list)
return proxy
def Prepare_Env(proxy):
OSNAME = platform.system()
if OSNAME == 'Linux':
OSNAME = 'lin'
elif OSNAME == 'Darwin':
OSNAME = 'mac'
elif OSNAME == 'Windows':
OSNAME = 'win'
header = Headers(
browser="chrome",
os=OSNAME,
headers=False
).generate()
agent = header['User-Agent']
path = os.path.dirname('./NopeCHA-CAPTCHA-Solver/manifest.json')
options = uc.ChromeOptions()
options.add_argument('--start-maximized')
options.add_argument('--disable-popup-blocking')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-web-security')
options.add_argument('--no-sandbox')
options.add_argument('--log-level=3')
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_argument(f'--user-agent={agent}')
options.add_argument(f'--proxy-server=http://{proxy}')
options.add_argument(f"--load-extension={path}")
driver = uc.Chrome(options=options)
driver.delete_all_cookies()
stealth(driver,
languages=["en-US", "en"],
vendor="Google Inc.",
platform="Win32",
webgl_vendor="Intel Inc.",
renderer="Intel Iris OpenGL Engine",
fix_hairline=True,
)
return driver
def Generate_Account_Details():
fake = Faker()
pw = PasswordGenerator()
pw.minlen = 9
pw.maxlen = 26
password = pw.generate()
username = fake.user_name()+'00'+str(randint(1, 1000))
firstname = fake.first_name()
lastname = fake.last_name()
birth_day = str(randint(1, 28))
birth_month = str(randint(1, 12))
birth_year = str(randint(1960, 2006))
return password, username, firstname, lastname, birth_day, birth_month, birth_year
def Create_Outlook_Account(driver: uc.Chrome, password, username, firstname, lastname, birth_day, birth_month, birth_year):
driver.get('https://outlook.live.com/owa/?nlp=1&signup=1')
field = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="MemberName"]')))
Type_Me(field, username)
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="iSignupAction"]')))
button.click()
field = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="PasswordInput"]')))
Type_Me(field, password)
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="iOptinEmail"]')))
button.click()
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="iSignupAction"]')))
button.click()
field = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="FirstName"]')))
Type_Me(field, firstname)
field = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="LastName"]')))
Type_Me(field, lastname)
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="iSignupAction"]')))
button.click()
country = Select(wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="Country"]'))))
country.select_by_value('US')
sleep(1)
country = Select(wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="BirthMonth"]'))))
country.select_by_value(birth_month)
sleep(1)
country = Select(wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="BirthDay"]'))))
country.select_by_value(birth_day)
sleep(1)
field = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="BirthYear"]')))
Type_Me(field, birth_year)
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="iSignupAction"]')))
button.click()
try:
wait.until(EC.title_contains('Microsoft account'))
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="KmsiCheckboxField"]')))
button.click()
button = wait.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="idSIButton9"]')))
button.click()
except Exception as ex:
print(ex.msg)
try:
wait.until(EC.title_contains('Outlook'))
print('Outlook Account Created Successfully xD!')
with open('account.txt', 'w') as f:
f.write(f"Email: {username}@outlook.com\n")
f.write(f"Password: {password}\n")
f.close()
return False
except Exception as ex:
print(ex.msg)
driver.close()
if __name__ == "__main__":
while(True):
try:
proxy = Generate_Proxy()
driver = Prepare_Env(proxy)
wait = WebDriverWait(driver, 10)
password, username, firstname, lastname, day, month, year = Generate_Account_Details()
Create_Outlook_Account(driver, password, username, firstname, lastname, day, month, year)
driver.close()
break
except Exception as ex:
print(ex.msg)
driver.close()
continue