Exemple #1
0
class TempEmail(object):
    def __init__(self):
        self.tm = TempMail()
        self.email = self.tm.get_email_address()

    # this method will wait the needed for us email
    # if you send number_of_email=3 , this method will
    # wait a third email and return link from it
    def get_link_from_email_by_number(self, number_of_email, number_of_link=1):
        delay = 5
        start_time = time.time()
        while True:
            time.sleep(delay)
            mail = self.tm.get_mailbox(self.email)
            current_time = time.time()
            end_time = current_time - start_time
            # if the letter doesnt come in 10 minutes function will return None
            if end_time > 600:
                print('Message hasn`t came more than 10 minutes')
                return None
            if isinstance(mail, list) and len(mail) == number_of_email:
                mail = self.tm.get_mailbox(self.email)[number_of_email - 1]
                html = mail.get('mail_text_only')
                parser = MyHTMLParser()
                parser.feed(html)
                return parser.result[number_of_link]
def mails(m):
    try:
        #initialize Temp-Male and read recieved Mails.
        mail = r.get('email:{}:mail'.format(str(m.from_user.id)))
        if not mail:
            bot.send_message(m.from_user.id,
                             '📧Make an email first.\nUse /newmail')
            return
        parts = mail.split('@')
        tm = TempMail(login=parts[0], domain='@' + parts[1])
        mails = tm.get_mailbox()
        if not mails:
            bot.send_message(m.from_user.id, '📭There is no email...')
        else:
            if 'error' in mails:
                bot.send_message(m.from_user.id, '📭There is no email...')
            else:
                print mails
                for i in mails:
                    bot.send_message(
                        m.from_user.id,
                        '📬Mail from: ' + i['mail_from'] + '\n\nSubject: ' +
                        i['mail_subject'] + '\n\nText: ' + i['mail_text'])
    except:
        bot.send_message(m.from_user.id, '📭There is no email...')
def mails(m):
    try:
        #initialize Temp-Male and read recieved Mails.
        mail = r.get('email:{}:mail'.format(str(m.from_user.id)))
        if not mail:
            bot.send_message(m.from_user.id,
                             '📧Faça um e-mail primeiro.\nUsar /newemail')
            return
        parts = mail.split('@')
        tm = TempMail(login=parts[0], domain='@' + parts[1])
        mails = tm.get_mailbox()
        if not mails:
            bot.send_message(m.from_user.id, '📭Não há e-mail...')
        else:
            if 'error' in mails:
                bot.send_message(m.from_user.id, '📭Não há e-mail...')
            else:
                print mails
                for i in mails:
                    bot.send_message(
                        m.from_user.id,
                        '📬E-mail de: ' + i['mail_from'] + '\n\nAssunto: ' +
                        i['mail_subject'] + '\n\nTexto: ' + i['mail_text'])
    except:
        bot.send_message(m.from_user.id, '📭Não há e-mail...')
Exemple #4
0
class TempEmail(object):
    def __init__(self):
        self.tm = TempMail()
        self.email = self.tm.get_email_address()

    def get_email_by_number(self, number_of_email):
        """
        interval of function checking mail
        if the interval will be to fast(small) like 0.5 seconds
        the server will return 429 error
        """
        delay = 5
        start_time = time.time()
        while True:
            time.sleep(delay)
            mail = self.tm.get_mailbox(self.email)
            current_time = time.time()
            end_time = current_time - start_time
            # if the letter doesnt come in 10 minutes function will return None
            if end_time > 600:
                print('Message hasn`t came more than 10 minutes')
                return None
            if isinstance(mail, list) and len(mail) == number_of_email:
                return mail[number_of_email - 1]
class YourserverBuyer(VPSBuyer):
    """
    This class orders a VPS from yourserver.se
    """
    def __init__(self, email="", password=""):
        """
        Initializes an YourserverBuyer with the given email and password.
        email -- The email address to use.
        password -- The password to use for creating an account.
        """
        self.tm = TempMail()
        if email == "":
            email = self.tm.get_email_address()
        super(YourserverBuyer, self).__init__(email, password, "root", BogusFormBuilder().getRNString(30))


    def buy(self):
        """
        Walks through the entire process of buying a VPS from Yourserver.
        Returns True if it succeeded, returns False otherwise.
        """
        succeeded = self.placeOrder() # places the order
        if not succeeded:
            return False
        time.sleep(30) # Wait for half a minute so Yourserver can process the payment
        succeeded = self.getSSHInfo(self.SSHPassword)
        return succeeded

    def placeOrder(self):
        """Places an order on Yourserver for a new VPS."""
        try:
            self.spawnBrowser()
            self.driver.get("https://www.yourserver.se/cart.php?a=confproduct&i=0")
            self.driver.find_element_by_css_selector('.ordernow').click()
            self.driver.implicitly_wait(5)
            self.chooseSelectElement("configoption[2]", "Ubuntu 14.04")

            self.driver.find_element_by_css_selector('.checkout').click()
            self.driver.implicitly_wait(10)
            time.sleep(5)
            self._fill_in_form()
            self.driver.find_element_by_css_selector('.ordernow').click()
            
            print("Email used: " + self.email)
            print("Password used: " + self.password)
            print("SSHPassword to be used: " + self.SSHPassword)
            print("SSHUsername to be used: " + self.SSHUsername)
            
            try:
                self.driver.find_element_by_css_selector('input[value="Pay Now"]').click()
            except Exception as e:
                print("Warning: Pay now button not found")

            paymentSucceeded = self._pay()
            if not paymentSucceeded:
                return False

            # Wait for the transaction to be accepted
            wait = ui.WebDriverWait(self.driver, 666)
            wait.until(lambda driver: driver.find_element_by_css_selector('.payment--paid'))

            time.sleep(60)

            emails = self.tm.get_mailbox(self.email)
            mails_html = emails[0][u'mail_html'] + emails[1][u'mail_html']
            #print(mails_html)

            verify_url = mails_html.split('clicking the link below:<br>\n<a href=\'')[1].split('\'')[0]
            print("verify URL: " +verify_url)

            password = mails_html.split('Password: '******'\n')[0]
            self.password = password[:-2] # Split off the last two characters of the password, those are empty characters that aren't part of the password
            print("password used: " + self.password)

            self.driver.get(verify_url)

            time.sleep(10)
            self.closeBrowser()


        except Exception as e:
            print("Could not complete the transaction because an error occurred:")
            print(e)
            self.closeBrowser()
            return False
            #raise # Raise the exception that brought you here

        return True


    def _fill_in_form(self):
        """Fills the form with values."""
        print(self.generator.getFirstName())
        self.fillInElement('firstname', self.generator.getFirstName())
        self.fillInElement('lastname', self.generator.getSurname())
        self.fillInElement('email', self.email)

    def _pay(self):
        bitcoinAmount = self.driver.find_element_by_css_selector(".ng-binding.payment__details__instruction__btc-amount").text
        toWallet = self.driver.find_element_by_css_selector(".payment__details__instruction__btc-address.ng-binding").text
        print("amount: " + bitcoinAmount)
        print("to wallet: " + toWallet)
        wallet = Wallet()
        return wallet.payToAutomatically(toWallet, bitcoinAmount)

    def getSSHInfo(self, SSHPassword=''):
        """
        Retrieves the SSH login information for our bought VPS.
        SSHPassword -- The password to use for sshconnections. (Default is '')
        """
        if SSHPassword != '':
            self.SSHPassword = SSHPassword
        try:
            self.spawnBrowser()
            self.driver.get("https://www.yourserver.se/portal/clientarea.php")
            self._login()
            self.driver.get("https://www.yourserver.se/portal/clientarea.php?action=emails")


            action = self.driver.find_element_by_css_selector('.btn.btn-info').get_attribute('onclick')
            email_url = "https://www.yourserver.se/portal/viewemail.php?id=" + action.split('?id=')[1].split('\'')[0]
            self.driver.get(email_url)

            self._extract_information()
            self.closeBrowser()
        except Exception as e:
            print("Could not complete the transaction because an error occurred:")
            print(e)
            #raise # Raise the exception that brought you here
            self.closeBrowser()
            return False
        return True

    def _login(self):
        """login on the website of Yourserver."""
        self.fillInElement('username', self.email)
        self.fillInElement('password', self.password)
        self.driver.find_elements_by_name('rememberme').pop().click()
        self.driver.find_element_by_id('login').click()

    def _extract_information(self):
        """
        Extract the IP address and SSH Password.
        The values can then be found in self.SSHPassword and self.IP.
        """
        email = self.driver.find_element_by_css_selector(".popupcontainer").text
        lines = email.split('\n')
        self.IP = lines[4].split(': ')[1]
        self.SSHPassword = lines[7].split(': ')[1]
def nessus_activation():
    tmp = TempMail()
    email = tmp.get_email_address()
    print("Your Temp mail address is successfully created!")
    print("Email Address: " + email)
    # print tmp.get_mailbox(email)
    #Nessus Registeration Form
    print("\033[1;32;10mNessus Registeration Form \033[1;32;0m")
    ht = requests.get("https://www.tenable.com/products/nessus-home")
    bs = BeautifulSoup(ht.text, 'html.parser')
    for link in bs.findAll("input", {"name": "token"}):
        if 'name' in link.attrs:
            tkn = link.attrs['value']
        else:
            print("not found")
    fname = raw_input("First Name:")
    lname = raw_input("Last Name:")
    # nes_email=raw_input("Email:")
    params = {
        "first_name": fname,
        "last_name": lname,
        "email": email,
        "country": "IN",
        "Accept": "Agree",
        "robot": "human",
        "type": "homefeed",
        "token": tkn,
        "submit": "Register"
    }
    r = requests.post("https://www.tenable.com/products/nessus-home",
                      data=params)
    if r.status_code == 200:
        bs = BeautifulSoup(r.text, 'html.parser')
        keyword = bs.find("title").get_text()
        success = keyword.split('|')
        if str(success[0]
               [:-1]) == 'Thank You for Registering for Nessus Home!':
            print('\033[1;32;10m' + str(success[0][:-1]) + '\033[1;32;0m')
            while True:
                if tmp.get_mailbox(email):
                    for emails in tmp.get_mailbox(email):
                        if emails[
                                'mail_subject'] == 'Tenable Nessus Home Activation Code':
                            message = emails['mail_text']
                            receive = raw_input(
                                "To check for Nessus Activation Code in Inbox, press enter"
                            )
                            regex = r"\w{4}(?:-\w{4}){4}"
                            activation_code = re.search(regex, message)
                            print(
                                '\033[1;32;10mNessus Activation Code is:\033[1;32;0m'
                                + activation_code.group())
                            sys.exit()
                else:
                    print('There are no emails yet....')

        elif bs.find('span', {"style": "color:#FF0000;"}).get_text():
            os.system('clear')
            # print('\033[1;31;10m'+bs.find('span',{"style":"color:#FF0000;"}).get_text()+'\033[1;31;0m')
            print(
                '\033[1;31;10m Sorry, This Email Address is already Registered for Nessus Activation Code\033[1;31;0m'
            )
            print("Wait..Regenerating new Temp email address")
            nessus_activation()
    else:
        print("something went wrong with the request")
        sys.exit()
			"Connection": "keep-alive",
			"Referer": "https://club.pokemon.com/us/pokemon-trainer-club/parents/sign-up",
			"Upgrade-Insecure-Requests": "1",
			"User-Agent": "%s" % ua,
		},
	)
	
	if created:
		print 'Waiting on getting mail...'
		time.sleep(5)
		
		mail = False
		tries = 1

		while not mail and tries < 6:
			mail = tm.get_mailbox()
			try:
				print 'Attempt %s.' % tries
				bs = BeautifulSoup(mail[0]['mail_html'])
				mail = True

				activation_url = bs.find_all('a')[1]['href']

				print 'Activating account...'

				r = requests.get(activation_url)
				if 'Thank you for signing up!' in r.text:
					print "Account activated!"

					if os.path.exists("verified.txt"):
						f = open('./output/verified.txt', 'a+b')
Exemple #8
0
#!/bin/env/python

from tempmail import TempMail

tm = TempMail()
email = '*****@*****.**'
print tm.get_mailbox()
Exemple #9
0
def get_mail():
    tm = TempMail()
    email = tm.get_email_address()  # [email protected]  создаем почту
    key = tm.get_mailbox(email)  # list of emails получаем письма из почты
Exemple #10
0
def CreateAcc():
	os.system('cls')
	print 'Snow - PKGO Account Creator v0.1 \n\n\n'
	my_pw = "teste123"
	#1st Step - DOB/Country
	signup_url = "https://club.pokemon.com/us/pokemon-trainer-club/sign-up/"
	client = requests.Session()
	client.get(signup_url)
	csrftoken = client.cookies['csrftoken'] #pegar o token para passar no post

	#Payload e Post
	sign_up_parameters = {'csrfmiddlewaretoken' : csrftoken,'dob' : "1990-01-01",'country' : "US"	}							
	headers = {'Referer' : signup_url}
	signup_response = client.post(signup_url, data=sign_up_parameters, headers=headers,cookies=client.cookies) #preenche DOB + country
	print 'Filling > Date of Birthday: ' +  sign_up_parameters["dob"] + ' ,Country: ' +  sign_up_parameters["country"]
	

	#2nd Step - validando username
	verify_user_url = "https://club.pokemon.com/api/signup/verify-username"
	client.get(verify_user_url)
	name = raw_input("Username: "******" is available"



	#3rd Step - registrando a conta
	final_signup_url = "https://club.pokemon.com/us/pokemon-trainer-club/parents/sign-up"
	client.get(final_signup_url)
	myemail = name + '@extremail.ru' #https://api.temp-mail.ru/request/domains/


	
	final_sign_up_parameters = {'csrfmiddlewaretoken':csrftoken, 'username':name, 'password':my_pw, 'confirm_password':my_pw, 'email':myemail, 'confirm_email':myemail,
								'public_profile_opt_in':'False','screen_name':'','terms':'on'}		
	headers = {'Referer' : final_signup_url}
	verify_response =client.post(final_signup_url, data=final_sign_up_parameters, headers=headers,cookies=client.cookies) #valida o username	
	print 'Account created!'


	#3rd Step - Get Activation Link
	print 'Looking for activation e-mail...'
	tm = TempMail(login=name, domain='@extremail.ru')
	temp_mail_box =  tm.get_mailbox() #pegando a cx de email
	lastemail = -1
	for emails in temp_mail_box: #vamos buscar o ultimo email do dest especifico
		if "*****@*****.**" in emails["mail_from"]:
			lastemail += 1
			
	html_content =  temp_mail_box[lastemail]["mail_html"] #pegar o html(em unicode)
	soup = BeautifulSoup(html_content, 'html.parser') #unicode -> html
	for link in soup.find_all('a'): #buscar todos links e ver se contem activated
		activation_link = str(link.get('href'))
		if "activated" in activation_link:
			email_arrived = True
			print "Activation link found: " + activation_link

				
			
	#4th Step - Activate Account
	activate_status = False
	while not activate_status:
		f = requests.get(activation_link)
		with open("test.txt", "w") as myfile:
			myfile.write(f.content)
		if ("activated" in f.content) or ("Your account is now active" in f.content):
			activate_status = True
			print "Account is now validated!"
			with open("Accounts.txt", "a") as myfile:
				myfile.write(name + ":" + my_pw + "\n")
				return True
		else:
			print 'Trying to validate account....'
Exemple #11
0
#!/bin/env/python

from tempmail import TempMail
tm = TempMail()
email = '*****@*****.**'
print tm.get_mailbox(email)