Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hackerxphantom
GitHub Repository: hackerxphantom/X_BOMB
Path: blob/main/bomber.py
3 views
1
#!/usr/bin/python
2
# -*- coding: UTF-8 -*-
3
4
import os
5
import shutil
6
import sys
7
import subprocess
8
import string
9
import random
10
import json
11
import re
12
import time
13
import argparse
14
import zipfile
15
from io import BytesIO
16
17
from concurrent.futures import ThreadPoolExecutor, as_completed
18
19
from utils.decorators import MessageDecorator
20
from utils.provider import APIProvider
21
22
try:
23
import requests
24
from colorama import Fore, Style
25
except ImportError:
26
print("\tSome dependencies could not be imported (possibly not installed)")
27
print(
28
"Type `pip3 install -r requirements.txt` to "
29
" install all required packages")
30
sys.exit(1)
31
32
33
def readisdc():
34
with open("isdcodes.json") as file:
35
isdcodes = json.load(file)
36
return isdcodes
37
38
39
def get_version():
40
try:
41
return open(".version", "r").read().strip()
42
except Exception:
43
return '1.0'
44
45
46
def clr():
47
if os.name == "nt":
48
os.system("cls")
49
else:
50
os.system("clear")
51
52
53
def bann_text():
54
clr()
55
logo = """
56
57
$$\ $$\ $$$$$$$\ $$$$$$\ $$\ $$\ $$$$$$$\
58
$$ | $$ | $$ __$$\ $$ __$$\ $$$\ $$$ |$$ __$$\
59
\$$\ $$ | $$ | $$ |$$ / $$ |$$$$\ $$$$ |$$ | $$ |
60
\$$$$ / $$$$$$$\ |$$ | $$ |$$\$$\$$ $$ |$$$$$$$\ |
61
$$ $$< $$ __$$\ $$ | $$ |$$ \$$$ $$ |$$ __$$\
62
$$ /\$$\ $$ | $$ |$$ | $$ |$$ |\$ /$$ |$$ | $$ |
63
$$ / $$ | $$$$$$$ | $$$$$$ |$$ | \_/ $$ |$$$$$$$ |
64
\__| \__|$$$$$$\\_______/ \______/ \__| \__|\_______/
65
\______|
66
67
"""
68
if ASCII_MODE:
69
logo = ""
70
version = "Version: "+__VERSION__
71
contributors = "Contributors: "+" ".join(__CONTRIBUTORS__)
72
print(random.choice(ALL_COLORS) + logo + RESET_ALL)
73
mesgdcrt.SuccessMessage(version)
74
mesgdcrt.SectionMessage(contributors)
75
print()
76
77
78
def check_intr():
79
try:
80
requests.get("https://motherfuckingwebsite.com")
81
except Exception:
82
bann_text()
83
mesgdcrt.FailureMessage("Poor internet connection detected")
84
sys.exit(2)
85
86
87
def format_phone(num):
88
num = [n for n in num if n in string.digits]
89
return ''.join(num).strip()
90
91
92
def do_zip_update():
93
success = False
94
if DEBUG_MODE:
95
zip_url = "https://github.com/XPH4N70M/X_BOMB/archive/dev.zip"
96
dir_name = "X_BOMB-dev"
97
else:
98
zip_url = "https://github.com/XPH4N70M/X_BOMB/archive/master.zip"
99
dir_name = "X_BOMB-master"
100
print(ALL_COLORS[0]+"Downloading ZIP ... "+RESET_ALL)
101
response = requests.get(zip_url)
102
if response.status_code == 200:
103
zip_content = response.content
104
try:
105
with zipfile.ZipFile(BytesIO(zip_content)) as zip_file:
106
for member in zip_file.namelist():
107
filename = os.path.split(member)
108
if not filename[1]:
109
continue
110
new_filename = os.path.join(
111
filename[0].replace(dir_name, "."),
112
filename[1])
113
source = zip_file.open(member)
114
target = open(new_filename, "wb")
115
with source, target:
116
shutil.copyfileobj(source, target)
117
success = True
118
except Exception:
119
mesgdcrt.FailureMessage("Error occured while extracting !!")
120
if success:
121
mesgdcrt.SuccessMessage("X_BOMB was updated to the latest version")
122
mesgdcrt.GeneralMessage(
123
"Please run the script again to load the latest version")
124
else:
125
mesgdcrt.FailureMessage("Unable to update X_bomb.")
126
mesgdcrt.WarningMessage(
127
"Grab The Latest one From https://github.com/XPH4N70M/X_BOMB.git")
128
129
sys.exit()
130
131
132
def do_git_update():
133
success = False
134
try:
135
print(ALL_COLORS[0]+"UPDATING "+RESET_ALL, end='')
136
process = subprocess.Popen("git checkout . && git pull ",
137
shell=True,
138
stdout=subprocess.PIPE,
139
stderr=subprocess.STDOUT)
140
while process:
141
print(ALL_COLORS[0]+'.'+RESET_ALL, end='')
142
time.sleep(1)
143
returncode = process.poll()
144
if returncode is not None:
145
break
146
success = not process.returncode
147
except Exception:
148
success = False
149
print("\n")
150
151
if success:
152
mesgdcrt.SuccessMessage("X_BOMB was updated to the latest version")
153
mesgdcrt.GeneralMessage(
154
"Please run the script again to load the latest version")
155
else:
156
mesgdcrt.FailureMessage("Unable to update X_BOMB.")
157
mesgdcrt.WarningMessage("Make Sure To Install 'git' ")
158
mesgdcrt.GeneralMessage("Then run command:")
159
print(
160
"git checkout . && "
161
"git pull https://github.com/XPH4N70M/X_BOMB.git HEAD")
162
sys.exit()
163
164
165
def update():
166
if shutil.which('git'):
167
do_git_update()
168
else:
169
do_zip_update()
170
171
172
def check_for_updates():
173
if DEBUG_MODE:
174
mesgdcrt.WarningMessage(
175
"DEBUG MODE Enabled! Auto-Update check is disabled.")
176
return
177
mesgdcrt.SectionMessage("Checking for updates")
178
fver = requests.get(
179
"https://raw.githubusercontent.com/XPH4N70M/X_BOMB/master/.version"
180
).text.strip()
181
if fver != __VERSION__:
182
mesgdcrt.WarningMessage("An update is available")
183
mesgdcrt.GeneralMessage("Starting update...")
184
update()
185
else:
186
mesgdcrt.SuccessMessage("X_BOMB is up-to-date")
187
mesgdcrt.GeneralMessage("Starting X_BOMB")
188
189
190
def notifyen():
191
try:
192
if DEBUG_MODE:
193
url = "https://github.com/XPH4N70M/X_BOMB/raw/dev/.notify"
194
else:
195
url = "https://github.com/XPH4N70M/X_BOMB/raw/master/.notify"
196
noti = requests.get(url).text.upper()
197
if len(noti) > 10:
198
mesgdcrt.SectionMessage("NOTIFICATION: " + noti)
199
print()
200
except Exception:
201
pass
202
203
204
def get_phone_info():
205
while True:
206
target = ""
207
cc = input(mesgdcrt.CommandMessage(
208
"Enter your country code (Without +): "))
209
cc = format_phone(cc)
210
if not country_codes.get(cc, False):
211
mesgdcrt.WarningMessage(
212
"The country code ({cc}) that you have entered"
213
" is invalid or unsupported".format(cc=cc))
214
continue
215
target = input(mesgdcrt.CommandMessage(
216
"Enter the target number: +" + cc + " "))
217
target = format_phone(target)
218
if ((len(target) <= 6) or (len(target) >= 12)):
219
mesgdcrt.WarningMessage(
220
"The phone number ({target})".format(target=target) +
221
"that you have entered is invalid")
222
continue
223
return (cc, target)
224
225
226
def get_mail_info():
227
mail_regex = r'^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
228
while True:
229
target = input(mesgdcrt.CommandMessage("Enter target mail: "))
230
if not re.search(mail_regex, target, re.IGNORECASE):
231
mesgdcrt.WarningMessage(
232
"The mail ({target})".format(target=target) +
233
" that you have entered is invalid")
234
continue
235
return target
236
237
238
def pretty_print(cc, target, success, failed):
239
requested = success+failed
240
mesgdcrt.SectionMessage("Bombing is in progress - Please be patient")
241
mesgdcrt.GeneralMessage(
242
"Please stay connected to the internet during bombing")
243
mesgdcrt.GeneralMessage("Target : " + cc + " " + target)
244
mesgdcrt.GeneralMessage("Sent : " + str(requested))
245
mesgdcrt.GeneralMessage("Successful : " + str(success))
246
mesgdcrt.GeneralMessage("Failed : " + str(failed))
247
mesgdcrt.WarningMessage(
248
"This tool was made for fun and research purposes only")
249
mesgdcrt.SuccessMessage("X_BOMB was created by XPH4N70M X PHANTOM")
250
251
252
def workernode(mode, cc, target, count, delay, max_threads):
253
254
api = APIProvider(cc, target, mode, delay=delay)
255
clr()
256
mesgdcrt.SectionMessage("Gearing up the Bomber - Please be patient")
257
mesgdcrt.GeneralMessage(
258
"Please stay connected to the internet during bombing")
259
mesgdcrt.GeneralMessage("API Version : " + api.api_version)
260
mesgdcrt.GeneralMessage("Target : " + cc + target)
261
mesgdcrt.GeneralMessage("Amount : " + str(count))
262
mesgdcrt.GeneralMessage("Threads : " + str(max_threads) + " threads")
263
mesgdcrt.GeneralMessage("Delay : " + str(delay) +
264
" seconds")
265
mesgdcrt.WarningMessage(
266
"This tool was made for fun and research purposes only")
267
print()
268
input(mesgdcrt.CommandMessage(
269
"Press [CTRL+Z] to suspend the bomber or [ENTER] to resume it"))
270
271
if len(APIProvider.api_providers) == 0:
272
mesgdcrt.FailureMessage("Your country/target is not supported yet")
273
mesgdcrt.GeneralMessage("Feel free to reach out to us")
274
input(mesgdcrt.CommandMessage("Press [ENTER] to exit"))
275
bann_text()
276
sys.exit()
277
278
success, failed = 0, 0
279
while success < count:
280
with ThreadPoolExecutor(max_workers=max_threads) as executor:
281
jobs = []
282
for i in range(count-success):
283
jobs.append(executor.submit(api.hit))
284
285
for job in as_completed(jobs):
286
result = job.result()
287
if result is None:
288
mesgdcrt.FailureMessage(
289
"Bombing limit for your target has been reached")
290
mesgdcrt.GeneralMessage("Try Again Later !!")
291
input(mesgdcrt.CommandMessage("Press [ENTER] to exit"))
292
bann_text()
293
sys.exit()
294
if result:
295
success += 1
296
else:
297
failed += 1
298
clr()
299
pretty_print(cc, target, success, failed)
300
print("\n")
301
mesgdcrt.SuccessMessage("Bombing completed!")
302
time.sleep(1.5)
303
bann_text()
304
sys.exit()
305
306
307
def selectnode(mode="sms"):
308
mode = mode.lower().strip()
309
try:
310
clr()
311
bann_text()
312
check_intr()
313
check_for_updates()
314
notifyen()
315
316
max_limit = {"sms": 500, "call": 15, "mail": 200}
317
cc, target = "", ""
318
if mode in ["sms", "call"]:
319
cc, target = get_phone_info()
320
if cc != "91":
321
max_limit.update({"sms": 100})
322
elif mode == "mail":
323
target = get_mail_info()
324
else:
325
raise KeyboardInterrupt
326
327
limit = max_limit[mode]
328
while True:
329
try:
330
message = ("Enter number of {type}".format(type=mode.upper()) +
331
" to send (Max {limit}): ".format(limit=limit))
332
count = int(input(mesgdcrt.CommandMessage(message)).strip())
333
if count > limit or count == 0:
334
mesgdcrt.WarningMessage("You have requested " + str(count)
335
+ " {type}".format(
336
type=mode.upper()))
337
mesgdcrt.GeneralMessage(
338
"Automatically capping the value"
339
" to {limit}".format(limit=limit))
340
count = limit
341
delay = float(input(
342
mesgdcrt.CommandMessage("Enter delay time (in seconds): "))
343
.strip())
344
# delay = 0
345
max_thread_limit = (count//10) if (count//10) > 0 else 1
346
max_threads = int(input(
347
mesgdcrt.CommandMessage(
348
"Enter Number of Thread (Recommended: {max_limit}): "
349
.format(max_limit=max_thread_limit)))
350
.strip())
351
max_threads = max_threads if (
352
max_threads > 0) else max_thread_limit
353
if (count < 0 or delay < 0):
354
raise Exception
355
break
356
except KeyboardInterrupt as ki:
357
raise ki
358
except Exception:
359
mesgdcrt.FailureMessage("Read Instructions Carefully !!!")
360
print()
361
362
workernode(mode, cc, target, count, delay, max_threads)
363
except KeyboardInterrupt:
364
mesgdcrt.WarningMessage("Received INTR call - Exiting...")
365
sys.exit()
366
367
368
mesgdcrt = MessageDecorator("icon")
369
if sys.version_info[0] != 3:
370
mesgdcrt.FailureMessage("X_BOMB will work only in Python v3")
371
sys.exit()
372
373
try:
374
country_codes = readisdc()["isdcodes"]
375
except FileNotFoundError:
376
update()
377
378
379
__VERSION__ = get_version()
380
__CONTRIBUTORS__ = ['XPH4N70M', 'X PHANTOM']
381
382
ALL_COLORS = [Fore.GREEN, Fore.RED, Fore.YELLOW, Fore.BLUE,
383
Fore.MAGENTA, Fore.CYAN, Fore.WHITE]
384
RESET_ALL = Style.RESET_ALL
385
386
ASCII_MODE = False
387
DEBUG_MODE = False
388
389
description = """X_BOMB - Your Friendly Spammer Application
390
391
X_BOMB can be used for many purposes which incudes -
392
\t Exposing the vulnerable APIs over Internet
393
\t Friendly Spamming
394
\t Testing Your Spam Detector and more ....
395
396
X_BOMB is not intented for malicious uses.
397
"""
398
399
parser = argparse.ArgumentParser(description=description,
400
epilog='Coded by X PHANTOM (PH4N7OM) !!!')
401
parser.add_argument("-sms", "--sms", action="store_true",
402
help="start X_BOMB with SMS Bomb mode")
403
parser.add_argument("-call", "--call", action="store_true",
404
help="start X_BOMB with CALL Bomb mode")
405
parser.add_argument("-mail", "--mail", action="store_true",
406
help="start X_BOMB with MAIL Bomb mode")
407
parser.add_argument("-ascii", "--ascii", action="store_true",
408
help="show only characters of standard ASCII set")
409
parser.add_argument("-u", "--update", action="store_true",
410
help="update X_BOMB")
411
parser.add_argument("-c", "--contributors", action="store_true",
412
help="show current X_BOMB contributors")
413
parser.add_argument("-v", "--version", action="store_true",
414
help="show current X_BOMB version")
415
416
417
if __name__ == "__main__":
418
args = parser.parse_args()
419
if args.ascii:
420
ASCII_MODE = True
421
mesgdcrt = MessageDecorator("stat")
422
if args.version:
423
print("Version: ", __VERSION__)
424
elif args.contributors:
425
print("Contributors: ", " ".join(__CONTRIBUTORS__))
426
elif args.update:
427
update()
428
elif args.mail:
429
selectnode(mode="mail")
430
elif args.call:
431
selectnode(mode="call")
432
elif args.sms:
433
selectnode(mode="sms")
434
else:
435
choice = ""
436
avail_choice = {
437
"1": "SMS",
438
"2": "CALL",
439
"3": "MAIL"
440
}
441
try:
442
while (choice not in avail_choice):
443
clr()
444
bann_text()
445
print("Available Options:\n")
446
for key, value in avail_choice.items():
447
print("[ {key} ] {value} BOMB".format(key=key,
448
value=value))
449
print()
450
choice = input(mesgdcrt.CommandMessage("Enter Choice : "))
451
selectnode(mode=avail_choice[choice].lower())
452
except KeyboardInterrupt:
453
mesgdcrt.WarningMessage("Received INTR call - Exiting...")
454
sys.exit()
455
sys.exit()
456
457