-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
145 lines (144 loc) · 5.82 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
#!/usr/bin/python
#.------..------..------..------..------.
#|S.--. ||L.--. ||3.--. ||4.--. ||K.--. |
#| :/\: || :/\: || :(): || :/\: || :/\: |
#| :\/: || (__) || ()() || :\/: || :\/: |
#| '--'S|| '--'L|| '--'3|| '--'4|| '--'K|
#`------'`------'`------'`------'`------'
#https://twitter.com/SL34K
#https://github.com/SL34K
#00110001 00111001
#00110000 00110011
#00110001 00111000
#########################################
import requests, datetime, json, time, string, names
from bs4 import BeautifulSoup
from random import getrandbits,choice,randint
x = 0
def solution(apikey,sitekey,form):
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Getting captcha solution"))
url="http://2captcha.com/in.php?key={}&method=userrecaptcha&googlekey={}&pageurl={}".format(apikey,sitekey,form)
resp = requests.get(url)
if resp.text[0:2] != 'OK':
quit('Error. Captcha is not received')
captcha_id = resp.text[3:]
fetch_url = "http://2captcha.com/res.php?key={}&action=get&id={}".format(apikey,captcha_id)
for i in range(1, 20):
time.sleep(5) # wait 5 sec.
resp = requests.get(fetch_url)
if resp.text[0:2] == 'OK':
break
captchasolution = resp.text[3:]
return captchasolution
def session():
sesh = requests.session()
sesh.headers = {
'Origin':'https://www.subtypestore.com',
'Referer':'https://www.subtypestore.com/sean/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36'
}
sesh.headers.update()
return sesh
def proxysession(proxy):
ip,port,username,password = proxy.split(":")
formattedProxy = (username+':'+password+'@'+ip+':'+port)
proxies = {'http': 'http://'+formattedProxy}
proxies = {'https': 'https://'+formattedProxy}
sesh = requests.Session()
sesh.proxies = proxies
sesh.headers = {
'Origin':'https://www.subtypestore.com',
'Referer':'https://www.subtypestore.com/sean/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36'
}
sesh.headers.update()
return sesh
def main():
global x
with open('config.json') as json_data_file:
data = json.load(json_data_file)
catchalldomain = data['settings']['catchalldomain']
randomnames = data['settings']['randomnames']
setname = data['settings']['setname']
signupdelay = int(data['settings']['signupdelay'])
randomsizes = data['settings']['randomsizes']
size = data['settings']['size']
postcode = data['settings']['postcode']
phone = data['settings']['phone']
sitekey = data['settings']['sitekey']
apikey = data['settings']['2captchaapikey']
proxyuse = data['settings']['useproxy']
proxy = data['settings']['proxy']
form = data['settings']['form']
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: @SL34K's Subtype Raffle BOT V1.1"))
print (now.strftime("%H:%M:%S:%f: Starting bot"))
entries = str(input (now.strftime("%H:%M:%S:%f: How many times do you wish to enter?: ")))
x = int(x)
while int(entries) > x:
x = run(catchalldomain,randomnames,setname,randomsizes,size,postcode,phone,sitekey,apikey,proxyuse,proxy,form)
time.sleep(signupdelay)
def run(catchalldomain,randomnames,setname,randomsizes,size,postcode,phone,sitekey,apikey,proxyuse,proxy,form):
if proxyuse == 'True':
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Proxy use: True"))
print (now.strftime("%H:%M:%S:%f: Proxy "+proxy))
sesh = proxysession(proxy)
else:
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Proxy use: False"))
sesh = session()
if randomnames == 'True':
first = names.get_first_name()
last = names.get_last_name()
name = first+' '+last
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Using random names"))
randomletters = "".join(choice(string.ascii_letters) for x in range(randint(1, 4)))
username = randomletters+first+randomletters
email = username+'@'+catchalldomain
else:
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Using setname: "+setname))
randomletters = "".join(choice(string.ascii_letters) for x in range(randint(1, 4)))
username = randomletters+name
email = username+'@'+catchalldomain
if randomsizes == 'True':
size = (randint(8, 28))/2
x = signup(sesh,form,apikey,sitekey,phone,postcode,size,name,email)
return x
def signup(sesh,form,apikey,sitekey,phone,postcode,size,name,email):
global x
x = int(x)
capsolution = solution(apikey,sitekey,form)
token = sesh.get(form)
soup = BeautifulSoup(token.content,'html.parser')
token = soup.find('input', {'name': 'state_3'}).get('value')
data = {
"input_9":name,
"input_4":email,
"input_3":phone,
"input_6":size,
"input_7":postcode,
"g-recaptcha-response":capsolution,
"is_submit_3":"1",
"gform_submit":"3",
"gform_unique_id":"",
"state_3":token,
"gform_target_page_number_3":"0",
"gform_source_page_number_3":"1",
"gform_field_values":"",
}
signup = sesh.post(form,data=data)
soup = BeautifulSoup(signup.content,'html.parser')
test = soup.find('h1', class_='entry-title center spacelarge').text
if 'Thank You' in test:
now = datetime.datetime.now()
print (now.strftime("%H:%M:%S:%f: Entered: "+email))
x = x+1
return x
else:
print("Error entering")
return x
main()