-
Notifications
You must be signed in to change notification settings - Fork 0
/
bomber.py
779 lines (393 loc) · 15.8 KB
/
bomber.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import shutil
import sys
import subprocess
import string
import random
import json
import re
import time
import argparse
import zipfile
from io import BytesIO
from concurrent.futures import ThreadPoolExecutor, as_completed
from utils.decorators import MessageDecorator
from utils.provider import APIProvider
try:
import requests
from colorama import Fore, Style
except ImportError:
print("\tSome dependencies could not be imported (possibly not installed)")
print(
"Type `pip3 install -r requirements.txt` to "
" install all required packages")
sys.exit(1)
def readisdc():
with open("isdcodes.json") as file:
isdcodes = json.load(file)
return isdcodes
def get_version():
try:
return open(".version", "r").read().strip()
except Exception:
return '1.0'
def clr():
if os.name == "nt":
os.system("cls")
else:
os.system("clear")
def bann_text():
clr()
logo = """
ooooo ooo oooooooooo. .oooooo. ooo ooooo oooooooooo.
`888b. `8' `888' `Y8b d8P' `Y8b `88. .888' `888' `Y8b
8 `88b. 8 888 888 888 888 888b d'888 888 888
8 `88b. 8 888oooo888' 888 888 8 Y88. .P 888 888oooo888'
8 `88b.8 888 `88b 888 888 8 `888' 888 888 `88b
8 `888 888 .88P `88b d88' 8 Y 888 888 .88P
o8o `8 ooooooooooo o888bood8P' `Y8bood8P' o8o o888o o888bood8P'
"""
if ASCII_MODE:
logo = ""
version = "Version: "+__VERSION__
contributors = "Contributors: "+" ".join(__CONTRIBUTORS__)
print(random.choice(ALL_COLORS) + logo + RESET_ALL)
mesgdcrt.SuccessMessage(version)
mesgdcrt.SectionMessage(contributors)
print()
def check_intr():
try:
requests.get("https://motherfuckingwebsite.com")
except Exception:
bann_text()
mesgdcrt.FailureMessage("Poor internet connection detected")
sys.exit(2)
def format_phone(num):
num = [n for n in num if n in string.digits]
return ''.join(num).strip()
def do_zip_update():
success = False
if DEBUG_MODE:
zip_url = "https://github.com/N17R0-HACKERS/N_BOMB/archive/dev.zip"
dir_name = "N_BOMB-dev"
else:
zip_url = "https://github.com/N17R0-HACKERS/N_BOMB/archive/master.zip"
dir_name = "N_BOMB-master"
print(ALL_COLORS[0]+"Downloading ZIP ... "+RESET_ALL)
response = requests.get(zip_url)
if response.status_code == 200:
zip_content = response.content
try:
with zipfile.ZipFile(BytesIO(zip_content)) as zip_file:
for member in zip_file.namelist():
filename = os.path.split(member)
if not filename[1]:
continue
new_filename = os.path.join(
filename[0].replace(dir_name, "."),
filename[1])
source = zip_file.open(member)
target = open(new_filename, "wb")
with source, target:
shutil.copyfileobj(source, target)
success = True
except Exception:
mesgdcrt.FailureMessage("Error occured while extracting !!")
if success:
mesgdcrt.SuccessMessage("N_BOMB was updated to the latest version")
mesgdcrt.GeneralMessage(
"Please run the script again to load the latest version")
else:
mesgdcrt.FailureMessage("Unable to update N_BOMB.")
mesgdcrt.WarningMessage(
"Grab The Latest one From https://github.com/N17R0-HACKERS/N_BOMB.git")
sys.exit()
def do_git_update():
success = False
try:
print(ALL_COLORS[0]+"UPDATING "+RESET_ALL, end='')
process = subprocess.Popen("git checkout . && git pull ",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
while process:
print(ALL_COLORS[0]+'.'+RESET_ALL, end='')
time.sleep(1)
returncode = process.poll()
if returncode is not None:
break
success = not process.returncode
except Exception:
success = False
print("\n")
if success:
mesgdcrt.SuccessMessage("N_BOMB was updated to the latest version")
mesgdcrt.GeneralMessage(
"Please run the script again to load the latest version")
else:
mesgdcrt.FailureMessage("Unable to update N_BOMB.")
mesgdcrt.WarningMessage("Make Sure To Install 'git' ")
mesgdcrt.GeneralMessage("Then run command:")
print(
"git checkout . && "
"git pull https://github.com/N17R0-HACKERS/N_BOMB.git HEAD")
sys.exit()
def update():
if shutil.which('git'):
do_git_update()
else:
do_zip_update()
def check_for_updates():
if DEBUG_MODE:
mesgdcrt.WarningMessage(
"DEBUG MODE Enabled! Auto-Update check is disabled.")
return
mesgdcrt.SectionMessage("Checking for updates")
fver = requests.get(
"https://raw.githubusercontent.com/N17R0-HACKERS/N_BOMB/master/.version"
).text.strip()
if fver != __VERSION__:
mesgdcrt.WarningMessage("An update is available")
mesgdcrt.GeneralMessage("Starting update...")
update()
else:
mesgdcrt.SuccessMessage("N_BOMB is up-to-date")
mesgdcrt.GeneralMessage("Starting N_BOMB")
def notifyen():
try:
if DEBUG_MODE:
url = "https://github.com/N17R0HACKERS/N_BOMB/raw/dev/.notify"
else:
url = "https://github.com/N17R0HACKERS/N_BOMB/raw/master/.notify"
noti = requests.get(url).text.upper()
if len(noti) > 10:
mesgdcrt.SectionMessage("NOTIFICATION: " + noti)
print()
except Exception:
pass
def get_phone_info():
while True:
target = ""
cc = input(mesgdcrt.CommandMessage(
"Enter your country code (Without +): "))
cc = format_phone(cc)
if not country_codes.get(cc, False):
mesgdcrt.WarningMessage(
"The country code ({cc}) that you have entered"
" is invalid or unsupported".format(cc=cc))
continue
target = input(mesgdcrt.CommandMessage(
"Enter the target number: +" + cc + " "))
target = format_phone(target)
if ((len(target) <= 6) or (len(target) >= 12)):
mesgdcrt.WarningMessage(
"The phone number ({target})".format(target=target) +
"that you have entered is invalid")
continue
return (cc, target)
def get_mail_info():
mail_regex = r'^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
while True:
target = input(mesgdcrt.CommandMessage("Enter target mail: "))
if not re.search(mail_regex, target, re.IGNORECASE):
mesgdcrt.WarningMessage(
"The mail ({target})".format(target=target) +
" that you have entered is invalid")
continue
return target
def pretty_print(cc, target, success, failed):
requested = success+failed
mesgdcrt.SectionMessage("Bombing is in progress - Please be patient")
mesgdcrt.GeneralMessage(
"Please stay connected to the internet during bombing")
mesgdcrt.GeneralMessage("Target : " + cc + " " + target)
mesgdcrt.GeneralMessage("Sent : " + str(requested))
mesgdcrt.GeneralMessage("Successful : " + str(success))
mesgdcrt.GeneralMessage("Failed : " + str(failed))
mesgdcrt.WarningMessage(
"This tool was made for fun and research purposes only")
mesgdcrt.SuccessMessage("N_BOMB was created by N17R0-HACKERS (WHOAMI)")
def workernode(mode, cc, target, count, delay, max_threads):
api = APIProvider(cc, target, mode, delay=delay)
clr()
mesgdcrt.SectionMessage("Gearing up the Bomber - Please be patient")
mesgdcrt.GeneralMessage(
"Please stay connected to the internet during bombing")
mesgdcrt.GeneralMessage("API Version : " + api.api_version)
mesgdcrt.GeneralMessage("Target : " + cc + target)
mesgdcrt.GeneralMessage("Amount : " + str(count))
mesgdcrt.GeneralMessage("Threads : " + str(max_threads) + " threads")
mesgdcrt.GeneralMessage("Delay : " + str(delay) +
" seconds")
mesgdcrt.WarningMessage(
"This tool was made for fun and research purposes only")
print()
input(mesgdcrt.CommandMessage(
"Press [CTRL+Z] to suspend the bomber or [ENTER] to resume it"))
if len(APIProvider.api_providers) == 0:
mesgdcrt.FailureMessage("Your country/target is not supported yet")
mesgdcrt.GeneralMessage("Feel free to reach out to us")
input(mesgdcrt.CommandMessage("Press [ENTER] to exit"))
bann_text()
sys.exit()
success, failed = 0, 0
while success < count:
with ThreadPoolExecutor(max_workers=max_threads) as executor:
jobs = []
for i in range(count-success):
jobs.append(executor.submit(api.hit))
for job in as_completed(jobs):
result = job.result()
if result is None:
mesgdcrt.FailureMessage(
"Bombing limit for your target has been reached")
mesgdcrt.GeneralMessage("Try Again Later !!")
input(mesgdcrt.CommandMessage("Press [ENTER] to exit"))
bann_text()
sys.exit()
if result:
success += 1
else:
failed += 1
clr()
pretty_print(cc, target, success, failed)
print("\n")
mesgdcrt.SuccessMessage("Bombing completed!")
time.sleep(1.5)
bann_text()
sys.exit()
def selectnode(mode="sms"):
mode = mode.lower().strip()
try:
clr()
bann_text()
check_intr()
check_for_updates()
notifyen()
max_limit = {"sms": 500, "call": 15, "mail": 200}
cc, target = "", ""
if mode in ["sms", "call"]:
cc, target = get_phone_info()
if cc != "91":
max_limit.update({"sms": 100})
elif mode == "mail":
target = get_mail_info()
else:
raise KeyboardInterrupt
limit = max_limit[mode]
while True:
try:
message = ("Enter number of {type}".format(type=mode.upper()) +
" to send (Max {limit}): ".format(limit=limit))
count = int(input(mesgdcrt.CommandMessage(message)).strip())
if count > limit or count == 0:
mesgdcrt.WarningMessage("You have requested " + str(count)
+ " {type}".format(
type=mode.upper()))
mesgdcrt.GeneralMessage(
"Automatically capping the value"
" to {limit}".format(limit=limit))
count = limit
delay = float(input(
mesgdcrt.CommandMessage("Enter delay time (in seconds): "))
.strip())
# delay = 0
max_thread_limit = (count//10) if (count//10) > 0 else 1
max_threads = int(input(
mesgdcrt.CommandMessage(
"Enter Number of Thread (Recommended: {max_limit}): "
.format(max_limit=max_thread_limit)))
.strip())
max_threads = max_threads if (
max_threads > 0) else max_thread_limit
if (count < 0 or delay < 0):
raise Exception
break
except KeyboardInterrupt as ki:
raise ki
except Exception:
mesgdcrt.FailureMessage("Read Instructions Carefully !!!")
print()
workernode(mode, cc, target, count, delay, max_threads)
except KeyboardInterrupt:
mesgdcrt.WarningMessage("Received INTR call - Exiting...")
sys.exit()
mesgdcrt = MessageDecorator("icon")
if sys.version_info[0] != 3:
mesgdcrt.FailureMessage("N_BOMB will work only in Python v3")
sys.exit()
try:
country_codes = readisdc()["isdcodes"]
except FileNotFoundError:
update()
__VERSION__ = get_version()
__CONTRIBUTORS__ = ['N17R0-HACKERS', 'WHOAMI']
ALL_COLORS = [Fore.GREEN, Fore.RED, Fore.YELLOW, Fore.BLUE,
Fore.MAGENTA, Fore.CYAN, Fore.WHITE]
RESET_ALL = Style.RESET_ALL
ASCII_MODE = False
DEBUG_MODE = False
description = """N_BOMB - Your Friendly Spammer Application
N_BOMB can be used for many purposes which incudes -
\t Exposing the vulnerable APIs over Internet
\t Friendly Spamming
\t Testing Your Spam Detector and more ....
N_BOMB is not intented for malicious uses.
"""
parser = argparse.ArgumentParser(description=description,
epilog='Coded by N17R0-HACKERS (WHOAMI) !!!')
parser.add_argument("-sms", "--sms", action="store_true",
help="start N_BOMB with SMS Bomb mode")
parser.add_argument("-call", "--call", action="store_true",
help="start N_BOMB with CALL Bomb mode")
parser.add_argument("-mail", "--mail", action="store_true",
help="start N_BOMB with MAIL Bomb mode")
parser.add_argument("-ascii", "--ascii", action="store_true",
help="show only characters of standard ASCII set")
parser.add_argument("-u", "--update", action="store_true",
help="update N_BOMB")
parser.add_argument("-c", "--contributors", action="store_true",
help="show current N_BOMB contributors")
parser.add_argument("-v", "--version", action="store_true",
help="show current N_BOMB version")
if __name__ == "__main__":
args = parser.parse_args()
if args.ascii:
ASCII_MODE = True
mesgdcrt = MessageDecorator("stat")
if args.version:
print("Version: ", __VERSION__)
elif args.contributors:
print("Contributors: ", " ".join(__CONTRIBUTORS__))
elif args.update:
update()
elif args.mail:
selectnode(mode="mail")
elif args.call:
selectnode(mode="call")
elif args.sms:
selectnode(mode="sms")
else:
choice = ""
avail_choice = {
"1": "SMS",
"2": "CALL",
"3": "MAIL"
}
try:
while (choice not in avail_choice):
clr()
bann_text()
print("Available Options:\n")
for key, value in avail_choice.items():
print("[ {key} ] {value} BOMB".format(key=key,
value=value))
print()
choice = input(mesgdcrt.CommandMessage("Enter Choice : "))
selectnode(mode=avail_choice[choice].lower())
except KeyboardInterrupt:
mesgdcrt.WarningMessage("Received INTR call - Exiting...")
sys.exit()
sys.exit()