· 6 years ago · Dec 04, 2019, 09:56 PM
1import time
2
3import requests
4import os
5import random
6import string
7
8import lastnames
9import firstnames
10
11# todo adjust url
12url = "http://target.here"
13
14EMAILHOSTS = [
15 "@gmail.com",
16 "@yahoo.com",
17 "@hotmail.com",
18 "@mail.com",
19 "@freemail.com",
20]
21
22chars = string.ascii_letters + string.digits # + '!@#$%&*()'
23passwordSize = range(8, 10)
24
25
26class Names:
27 firstnames = firstnames.firstnames_list
28 lastnames = lastnames.lastnames_list
29
30
31def spam_datasets(num_of_datasets):
32 random.seed = (os.urandom(1024))
33 for i in range(num_of_datasets):
34 try:
35 first_name = random.choice(Names.firstnames)
36 last_name = random.choice(Names.lastnames)
37 digit = ''.join(random.choice(string.digits)) if random.randint(1,100) % 2 == 0 else ''
38 email = first_name.lower()\
39 + "." \
40 + last_name.lower() \
41 + digit\
42 + random.choice(EMAILHOSTS)
43 password = ''.join(random.choice(chars) for i in range(random.choice(passwordSize)))
44 phone = ''.join(str(random.randrange(10)) for i in range(10))
45 requests.post(url, allow_redirects=False, data={
46 # todo adjust here for target url fields
47 'first_name' : first_name,
48 'last_name' : last_name,
49 'email' : email,
50 'password' : password,
51 'phonecc' : ''.join(str(random.randrange(10)).join(str(random.randrange(10)))),
52 'phone' : phone,
53 })
54 print("Gesendet:" + email + "| password: " + password + " - minData= " + str(len(first_name) + len(last_name) + len(email) + len(password) + 2 + len(phone)) )
55 time.sleep(random.uniform(1.0, 3.0))
56 except Exception:
57 print("Some error occured, trying again in 1 second")
58 time.sleep(1)
59
60
61
62
63def main():
64 num_of_datasets_per_worker = 10000000
65 spam_datasets(num_of_datasets_per_worker)
66
67
68
69
70if __name__ == "__main__":
71 main()