File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,27 @@ def check_directory(output_directory):
13
13
def load_targets (target_hosts , output_directory , quiet ):
14
14
if (os .path .isdir (target_hosts ) or os .path .isfile (target_hosts )):
15
15
return target_hosts
16
+ elif "-" in target_hosts :
17
+ expand_targets (target_hosts , output_directory )
18
+ return "targets.txt"
16
19
else :
17
20
return output_directory + "/targets.txt"
18
21
22
+ def expand_targets (target_hosts , output_directory ):
23
+ parts = target_hosts .split ("." )
24
+ target_list = []
25
+ print (parts )
26
+ for part in parts :
27
+ if "-" in part :
28
+ iprange = part .split ("-" )
29
+ print (iprange )
30
+ for i in range (int (iprange [0 ]), int (iprange [1 ])):
31
+ target_list .append (parts [0 ]+ "." + parts [1 ]+ "." + parts [2 ]+ "." + str (i ))
32
+ print (target_list )
33
+ with open (output_directory + "/targets.txt" , "w" ) as targets :
34
+ for target in target_list :
35
+ targets .write ("%s\n " % target )
36
+
19
37
20
38
def create_dir_structure (ip_address , output_directory ):
21
39
print ("[+] Creating directory structure for " + ip_address )
You can’t perform that action at this time.
0 commit comments