1- from bugscanx .utils .prompts import get_input , get_confirm , is_cidr
1+ from bugscanx .utils .prompts import get_input , get_confirm
22from bugscanx .utils .cidr import read_cidrs_from_file
33
44
@@ -10,25 +10,23 @@ def get_common_inputs():
1010 default_filename = "results.txt"
1111 output = get_input (
1212 "Enter output filename" ,
13- default = default_filename ,
14- validate_input = False
13+ default = default_filename
1514 )
1615 threads = get_input (
1716 "Enter threads" ,
18- "number" ,
19- default = "50" ,
20- allow_comma_separated = False
17+ validators = "number" ,
18+ default = "50"
2119 )
2220 return output , threads
2321
2422
2523def get_host_input ():
26- filename = get_input ("Enter filename" , "file" , mandatory = False )
24+ filename = get_input ("Enter filename" , input_type = "file" , validators = "file" , mandatory = False )
2725 if not filename :
28- cidr = get_input ("Enter CIDR range(s)" , validators = [ is_cidr ] , mandatory = False )
26+ cidr = get_input ("Enter CIDR range(s)" , validators = "cidr" , mandatory = False )
2927 if not cidr :
3028 cidr_file = get_input (
31- "Enter CIDR file" , "file" )
29+ "Enter CIDR file" , input_type = "file" )
3230 cidr = read_cidrs_from_file (cidr_file ) if cidr_file else None
3331 return None , cidr
3432 return filename , None
@@ -39,12 +37,12 @@ def get_input_direct(no302=False):
3937 if filename is None and cidr is None :
4038 return None , None , None
4139
42- port_list = get_input ("Enter port(s)" , "number" , default = "80" ).split (',' )
43- timeout = get_input ("Enter timeout (seconds)" , "number" , default = "3" )
40+ port_list = get_input ("Enter port(s)" , validators = "number" , default = "80" ).split (',' )
41+ timeout = get_input ("Enter timeout (seconds)" , validators = "number" , default = "3" )
4442 output , threads = get_common_inputs ()
4543 method_list = get_input (
4644 "Select HTTP method(s)" ,
47- "choice" ,
45+ input_type = "choice" ,
4846 multiselect = True ,
4947 choices = [
5048 "GET" , "HEAD" , "POST" , "PUT" ,
@@ -94,8 +92,8 @@ def get_input_proxy():
9492 "Upgrade: websocket[crlf][crlf]"
9593 )
9694 payload = get_input ("Enter payload" , default = default_payload )
97- port_list = get_input ("Enter port(s)" , "number" , default = "80" ).split (',' )
98- output , threads = get_common_inputs (filename or cidr )
95+ port_list = get_input ("Enter port(s)" , validators = "number" , default = "80" ).split (',' )
96+ output , threads = get_common_inputs ()
9997
10098 if cidr :
10199 try :
@@ -128,11 +126,11 @@ def get_input_proxy2():
128126 if filename is None and cidr is None :
129127 return None , None , None
130128
131- port_list = get_input ("Enter port(s)" , "number" , default = "80" ).split (',' )
132- output , threads = get_common_inputs (filename or cidr )
129+ port_list = get_input ("Enter port(s)" , validators = "number" , default = "80" ).split (',' )
130+ output , threads = get_common_inputs ()
133131 method_list = get_input (
134132 "Select HTTP method(s)" ,
135- "choice" ,
133+ input_type = "choice" ,
136134 multiselect = True ,
137135 choices = [
138136 "GET" , "HEAD" , "POST" , "PUT" ,
@@ -180,7 +178,7 @@ def get_input_ssl():
180178 if filename is None and cidr is None :
181179 return None , None , None
182180
183- output , threads = get_common_inputs (filename or cidr )
181+ output , threads = get_common_inputs ()
184182
185183 if cidr :
186184 try :
@@ -207,8 +205,8 @@ def get_input_ping():
207205 if filename is None and cidr is None :
208206 return None , None , None
209207
210- port_list = get_input ("Enter port(s)" , "number" , default = "443" ).split (',' )
211- output , threads = get_common_inputs (filename or cidr )
208+ port_list = get_input ("Enter port(s)" , validators = "number" , default = "443" ).split (',' )
209+ output , threads = get_common_inputs ()
212210
213211 if cidr :
214212 try :
0 commit comments