qwiklabs: fully create a qwiklabs account

Solving 2(!) Captchas!
+ some bonus activated/unactivated standard-password accounts created during the tests
master
EmaMaker 2021-08-25 21:36:50 +02:00
parent 30a4e89c27
commit cba3131dbf
7 changed files with 89 additions and 37 deletions

View File

@ -1 +1,19 @@
ryysw0@1secmail.net:hellogoodbye
# '!' before an email address means it still needs to be activated. Password is 'hellogoodbye' when not specified
06prgzamm96@esiix.com
jhv8mtemi@esiix.com
6bgfngq6@yoggm.com
fohxil@xojxe.com
b4d0o0y5pg@esiix.com
i3z8qtab@xojxe.com
l5wbup@1secmail.com
! ryysw0@1secmail.net
! m5l7868ar@wwjmp.com
! m5i8g3@1secmail.com
! ue8oqa0lf0j@1secmail.net
! 17k2l9@1secmail.com
! 08hyvaejbr@xojxe.com
! c5xm6j@1secmail.net
! mud0ud@esiix.com
! t788egrvdp@wwjmp.com

View File

@ -1,21 +1,17 @@
from ngrok import ngrok
from colab import colab
import time
from qwiklabs import delete_account
from qwiklabs import delete_account, create_account
def start_proxy_get_ip():
c = colab.ColabGist('https://colab.research.google.com/gist/EmaMaker/4e1478c9913a2df58fc1b8ff422fa161/proxy.ipynb', ('giangillo.rossi@gmail.com', 'emamaker02'), minutes=3)
c.run()
time.sleep(120)
n = ngrok.Ngrok()
n.start_browser()
n.access_ngrok()
print(n.get_proxy_ip())
def delete_qwiklabs_account():
d = delete_account.QL_DeleteAccount(False, ("cicekaj673@fada55.com", "hellogoodbye"))
d.delete_account()
delete_qwiklabs_account()
def create_qwiklabs_account():
# m = create_account.TempMail(False)
# print(m.get_new_temp_mail())
c = create_account.QL_CreateACcount()
c.create_account()
create_qwiklabs_account()

View File

@ -27,6 +27,7 @@ class QL_CreateACcount:
self.temp_mail_address = self.temp_mail.get_new_temp_mail()
self.sign_up()
self.accept_eula()
print("Account created!".format(self.info, self.temp_mail_address))
@ -46,32 +47,39 @@ class QL_CreateACcount:
browser_manager.inputText(self.driver, By.CSS_SELECTOR, "#user_company_name", self.info[2], after_delay=1.5)
browser_manager.inputText(self.driver, By.CSS_SELECTOR, "#user_password", "hellogoodbye", after_delay=1.5)
browser_manager.inputText(self.driver, By.CSS_SELECTOR, "#user_password_confirmation", "hellogoodbye", after_delay=1.5)
time.sleep(5)
time.sleep(10)
self.resolve_captcha('/html/body/div[1]/div[1]/div[2]/form[2]/div[8]/div/div/iframe', "recaptcha-checkbox", "/html/body/div[4]/div[4]", "recaptcha-audio-button")
self.resolve_captcha()
time.sleep(5)
self.driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[2]/form[2]/div[9]/button').click()
def resolve_captcha(self):
def resolve_captcha(self, frame1_xpath, checkbox_classname, frame2_container_xpath, audio_id):
# switch to recaptcha frame
# frames = self.driver.find_elements_by_tag_name("iframe")
# self.driver.switch_to.frame(frames[0])
self.driver.switch_to.frame(self.driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[2]/form[2]/div[8]/div/div/iframe'))
self.driver.switch_to.frame(self.driver.find_element_by_xpath(frame1_xpath))
browser_manager.delay(self.driver)
# click on checkbox to activate recaptcha
self.driver.find_element_by_class_name("recaptcha-checkbox").click()
self.driver.find_element_by_class_name(checkbox_classname).click()
# switch to recaptcha audio control frame
self.driver.switch_to.default_content()
frames = self.driver.find_element_by_xpath("/html/body/div[4]/div[4]").find_elements_by_tag_name("iframe")
frame2_container = browser_manager.waitForElement(self.driver, By.XPATH, frame2_container_xpath)
# Sometimes the captcha gets accepted right away
if frame2_container is False:
return
frames = frame2_container.find_elements_by_tag_name("iframe")
self.driver.switch_to.frame(frames[0])
browser_manager.delay(self.driver)
# click on audio challenge
self.driver.find_element_by_id("recaptcha-audio-button").click()
self.driver.find_element_by_id(audio_id).click()
# switch to recaptcha audio challenge frame
self.driver.switch_to.default_content()
frames = self.driver.find_elements_by_tag_name("iframe")
@ -113,8 +121,21 @@ class QL_CreateACcount:
def accept_eula(self):
self.driver.get(self.temp_mail.get_confirmation_link())
time.sleep(5)
#insert password
browser_manager.inputText(self.driver, By.CSS_SELECTOR, "#user_password", "hellogoodbye + \n", after_delay=1.5)
browser_manager.inputText(self.driver, By.CSS_SELECTOR, "#user_password", "hellogoodbye", after_delay=1.5)
browser_manager.clickButton(self.driver, By.XPATH, "/html/body/div[2]/div[1]/div[2]/form/div[4]/button")
time.sleep(10)
browser_manager.clickButton(self.driver, By.XPATH, '/html/body/div[2]/div/button')
time.sleep(2)
self.resolve_captcha('/html/body/div[1]/form/div/div/div/div/div/iframe', "recaptcha-checkbox", "/html/body/div[4]/div[4]", "recaptcha-audio-button")
time.sleep(5)
browser_manager.clickButton(self.driver, By.XPATH, '/html/body/div[1]/form/input[5]')
time.sleep(1000)
@ -154,18 +175,25 @@ class TempMail:
return self.email
# Wait for qwiklabs confirmation email to arrive, click it
def accept_eula(self):
fetched_msg = requests.get('https://www.1secmail.com/api/v1/?action=getMessages&login=' + self.email.split('@')[0] + '&domain='+self.email.split('@')[1], proxies=self.proxyDict)
msg_id = requests[0]['id']
email = requests.get('https://www.1secmail.com/api/v1/?action=readMessage&login=' + self.email.split('@')[0] + '&domain='+self.email.split('@')[1] + '&id=' + str(id_msg))
def get_confirmation_link(self):
arrived = False
while arrived == False:
print('Waiting for confirmation email')
fetched_msg = requests.get('https://www.1secmail.com/api/v1/?action=getMessages&login=' + self.email.split('@')[0] + '&domain='+self.email.split('@')[1], proxies=self.proxyDict)
arrived = fetched_msg.text != '[]'
time.sleep(2)
print('Email arrived')
msg_id = fetched_msg.json()[0]['id']
email = requests.get('https://www.1secmail.com/api/v1/?action=readMessage&login=' + self.email.split('@')[0] + '&domain='+self.email.split('@')[1] + '&id=' + str(msg_id))
body = email.json()['body']
soup = BeautifulSoup(body, 'html.parser')
soup = soup.prettify()
a = ""
for link in soup.find_all('a'):
if 'confirmation' in link.get('href'):
a = link.get('href')
print("Here's the confirmation link " + a)
return a

View File

@ -15,20 +15,30 @@ import random
import requests
def waitForElement(browser, by, selector, timeout=5, after_delay=0):
return WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector)))
try:
return WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector)))
except:
return False
def clickButton(browser, by, selector, timeout=5, after_delay=1.5):
WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector))).click()
time.sleep(after_delay)
try:
WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector))).click()
time.sleep(after_delay)
except:
return False
def inputText(browser, by, selector, text, timeout=5, interval=0.2, after_delay=0):
element = WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector)))
for i in text:
element.send_keys(i)
time.sleep(interval)
time.sleep(after_delay)
try:
element = WebDriverWait(browser, timeout).until(EC.element_to_be_clickable((by, selector)))
for i in text:
element.send_keys(i)
time.sleep(interval)
time.sleep(after_delay)
except:
return False
# A lifesaver: https://stackoverflow.com/questions/36141681/does-anybody-know-how-to-identify-shadow-dom-web-elements-using-selenium-webdriv
def select_shadow_element_by_css_selector(browser, selector):