Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added the whitelist_wash function
  • Loading branch information
atucom committed Mar 29, 2018
commit e94c1abd1216dc5e15d02e7fc301e8f48e87cc3d
16 changes: 16 additions & 0 deletions lib/exploitation/exploiter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import lib.settings
import lib.output

def whitelist_wash(hosts, whitelist_file):
"""
remove IPs from hosts list that do not appear in WHITELIST_FILE
"""
whitelist_hosts = open(whitelist_file).readlines()
lib.output.info('Found {} entries in whitelist.txt, scrubbing'.format(str(len(whitelist_hosts))))
washed_hosts = []
#return supplied hosts if whitelist file is empty
if len(whitelist_hosts) == 0:
return hosts
else:
for host in hosts:
if host in whitelist_hosts:
washed_hosts.append(host)

return washed_hosts

class AutoSploitExploiter(object):

Expand Down