File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,22 @@ def whitelist_wash(hosts, whitelist_file):
1616 """
1717 remove IPs from hosts list that do not appear in WHITELIST_FILE
1818 """
19- whitelist_hosts = [x .strip () for x in open (whitelist_file ).readlines () if x .strip ()]
20- lib .output .info ('Found {} entries in whitelist.txt, scrubbing' .format (str (len (whitelist_hosts ))))
21- washed_hosts = []
22- # return supplied hosts if whitelist file is empty
23- if len (whitelist_hosts ) == 0 :
24- return hosts
25- else :
26- for host in hosts :
27- if host .strip () in whitelist_hosts :
28- washed_hosts .append (host )
19+ try :
20+ whitelist_hosts = [x .strip () for x in open (whitelist_file ).readlines () if x .strip ()]
21+ lib .output .info ('Found {} entries in whitelist.txt, scrubbing' .format (str (len (whitelist_hosts ))))
22+ washed_hosts = []
23+ # return supplied hosts if whitelist file is empty
24+ if len (whitelist_hosts ) == 0 :
25+ return hosts
26+ else :
27+ for host in hosts :
28+ if host .strip () in whitelist_hosts :
29+ washed_hosts .append (host )
2930
30- return washed_hosts
31+ return washed_hosts
32+ except Exception :
33+ lib .output .warning ("unable to whitewash host list, does the file exist?" )
34+ return hosts
3135
3236
3337class AutoSploitExploiter (object ):
You can’t perform that action at this time.
0 commit comments