File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
import sys
3
3
4
4
# Check if the file path is provided as a command-line argument
5
- if len (sys .argv ) != 2 :
6
- print ("Usage: python3 scope.py <path_to_subdomain.txt>" )
5
+ if len (sys .argv ) < 2 :
6
+ print ("Usage: python3 scope.py <path_to_subdomain.txt> [thread_rate] " )
7
7
sys .exit (1 )
8
8
9
9
# Get the path to subdomain.txt from command-line arguments
10
10
file_path = sys .argv [1 ]
11
11
12
+ # Get the thread rate if provided, else set default to 1
13
+ thread_rate = int (sys .argv [2 ]) if len (sys .argv ) > 2 else 1
14
+
15
+ # Validate the thread rate
16
+ if not (1 <= thread_rate <= 100 ):
17
+ print ("Thread rate must be between 1 and 100." )
18
+ sys .exit (1 )
19
+
12
20
# Load subdomains from the specified file
13
21
try :
14
22
with open (file_path , "r" ) as file :
You can’t perform that action at this time.
0 commit comments