-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsnapspam.py
247 lines (216 loc) · 7.46 KB
/
snapspam.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
import requests
import random
from imagetyperzapi4 import imagetyperzapi
import os
from re import sub
from decimal import Decimal
import threading
import time
from time import sleep
import urllib.parse
import sys
from urllib.parse import quote
headers = {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9",
"content-length": "2820",
"content-type": "multipart/form-data; boundary=----WebKitFormBoundary53f6Ua04sQBVQ5LA",
"origin": "https://help.snapchat.com",
"referer": "https://help.snapchat.com/",
"sec-ch-ua": "\"Google Chrome\";v=\"109\", \"Not)A;Brand\";v=\"99\", \"Chromium\";v=\"109\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
}
targets = []
emails = []
reasons = []
proxies = []
ita = None
threadNum = 1
goodReport = 0
badReport = 0
badCaptcha = 0
def report(email, reportee, reason, captcha):
body = """
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"key\"
ts-reported-content-2
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"answers\"
5153567363039232,5743597085261824
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"g-recaptcha-response\"
"""+captcha+"""
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"field-24380496\"
none
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"field-24335325\"
"""+email+"""
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"field-25326243\"
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"field-24380626\"
"""+reportee+"""
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"field-22808619\"
"""+reason+"""
------WebKitFormBoundary53f6Ua04sQBVQ5LA
Content-Disposition: form-data; name=\"tags\"
ts,viewed-story,cf-ts-content-story,ca-live-story,sca-safety-concern
------WebKitFormBoundary53f6Ua04sQBVQ5LA--
"""
encoded = urllib.parse.quote(body)
proxy = random.choice(proxies)
proxArr = proxy.split(":")
realStr = proxArr[-2]+":"+proxArr[-1]+"@"+proxArr[0]+":"+proxArr[1]
username = quote(proxArr[-2])
password = quote(proxArr[-1])
proxy = proxArr[0]
proxy_port = proxArr[1]
proxy_http = 'http://' + username + ':' + password + '@' + proxy + ':' + proxy_port
proxyes = {'all' : proxy_http}
response = requests.post("https://wassupsnap.appspot.com/en-us/api/v2/zendesk/send", headers=headers, data=body, proxies=proxyes)
if response.status_code == 200:
return True
else:
print(response.text)
return False
def loadAll():
global targets
global emails
global reasons
global proxies
try:
with open("targets.txt", "r") as f:
targets = [i.rstrip() for i in f.readlines()]
with open("emails.txt", "r") as f:
emails = [i.rstrip() for i in f.readlines()]
with open("reasons.txt", "r") as f:
reasons = [i.rstrip() for i in f.readlines()]
with open("proxies.txt", "r") as f:
proxies = [i.rstrip() for i in f.readlines()]
return True
except:
print("There was an error when loading the required files. Check that the following files exist: targets.txt, emails.txt, reasons.txt, proxies.txt, token.txt")
os.system('pause')
quit()
def initCaptcha():
try:
tokenfile = open("./token.txt", "r")
except:
print("An error has occurred while opening token.txt. Please check that token.txt is created and contains a valid token key.")
os.system('pause')
quit()
access_token = tokenfile.read()
global ita
try:
ita = imagetyperzapi.ImageTyperzAPI(access_token)
balance = ita.account_balance()
print("Connected to ImageTyperz successfully! Balance: {}".format(balance))
return True
except:
print("An error has occurred while connecting to ImageTyperz. Please check that token.txt is created and contains a valid token key.")
os.system('pause')
quit()
def getBalance():
balance = ita.account_balance()
value = Decimal(sub(r'[^\d.]', '', balance))
return value
def solveCaptcha():
try:
proxy = random.choice(proxies)
proxArr = proxy.split(":")
realStr = proxArr[-2]+":"+proxArr[-1]+"@"+proxArr[0]+":"+proxArr[1]
xhttpproxies = {
"all":"http://" + realStr,
#"https": "https://" + proxy
}
# captcha_params = {'page_url': "https://help.snapchat.com/hc/en-us/requests/new", 'sitekey': '6Ldt4CkUAAAAAJuBNvKkEcx7OcZFLfrn9cMkrXR8', "type": 2, 'proxy': xhttpproxies}
captcha_params = {'page_url': "https://help.snapchat.com/hc/en-us/requests/new", 'sitekey': '6Ldt4CkUAAAAAJuBNvKkEcx7OcZFLfrn9cMkrXR8', "type": 2}
captcha_id = ita.submit_recaptcha(captcha_params)
print("Submitted captcha!")
response = None
while not response:
sleep(10)
response = ita.retrieve_response(captcha_id)
answer = response['Response']
print("Answer received!")
return (True, answer)
except Exception as e:
global badCaptcha
badCaptcha+=1
print(e)
print("An error has occurred in solveCaptcha")
return (False, None)
def child():
global badCaptcha
global badReport
global goodReport
captchaRes = solveCaptcha()
if captchaRes[0] == False:
badCaptcha+=1
print("Didn't get captcha result.")
else:
email = random.choice(emails)
target = random.choice(targets)
reason = random.choice(reasons)
result = report(email, target, reason, captchaRes[1])
if result == True:
goodReport += 1
print("REPORT SENT! {} @ {} for {}".format(email, target, reason))
else:
badReport +=1
print("Report failed. {} @ {} for {}".format(email, target, reason))
def startThread():
if (threading.active_count() < int(threadNum)):
new_thread = threading.Thread(target=child)
new_thread.start()
# else:
# time.sleep(2)
# startThread()
def runner():
while getBalance() > 2:
if (threading.active_count() < int(threadNum)):
updateTitle()
startThread()
def startup():
if loadAll() != True:
print("Error in loadAll")
quit()
if initCaptcha() != True:
print("Error in initCaptcha")
quit()
if getBalance() < 2:
print("Put some money in your captcha!")
quit()
if promptThreads() != True:
print("Error in promptThreads")
quit()
runner()
def promptThreads():
global threadNum
give = input("Enter the amount of threads: ")
if len(give) < 1 or give.isnumeric() == False:
print("Not a valid number!")
promptThreads()
else:
threadNum = int(give)
return True
def setTitle(title):
try:
os.system("title "+title)
except:
pass
try:
sys.stdout.write("\x1b]2;"+title+"\x07")
except:
pass
def updateTitle():
title = "[SNAPSPAM] SENT: {} FAILED: {} CAPTCHERR: {} BAL: {} THREADS: {}".format(goodReport, badReport, badCaptcha, getBalance(), threadNum)
setTitle(title)
startup()