Skip to content

Commit

Permalink
Merge pull request #157 from ChrisTruncer/fix_ctargets
Browse files Browse the repository at this point in the history
createtargets correctly parses all services
  • Loading branch information
ChrisTruncer committed Oct 4, 2015
2 parents f06e727 + 31c15b4 commit 348b805
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[10.3.2015]
Updated...: User output changed to reflect the fact EyeWitness scans services, not hosts. Thanks @digininja
Updated...: Create targets now correctly parses for rdp, vnc, and web, not only web. Thanks @digininja for letting us know!

[6.25.2015]
Fixed.....: Fixed search page links
Expand Down
22 changes: 18 additions & 4 deletions modules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def target_creator(command_line_object):
List: Hosts detected for VNC
"""
if command_line_object.createtargets is not None:
print "Creating text file containing all web servers..."
print "Creating target file for specified services..."

urls = []
rdp = []
Expand Down Expand Up @@ -143,11 +143,25 @@ def target_creator(command_line_object):
urls.append(urlBuild)
num_urls += 1

if command_line_object.createtargets is not None:
with open(command_line_object.createtargets, 'w') as target_file:
if command_line_object.createtargets is not None and command_line_object.web:
with open('web_' + command_line_object.createtargets, 'w') as target_file:
for item in urls:
target_file.write(item + '\n')
print "Target file created (" + command_line_object.createtargets + ").\n"
print "Target file created (web_" + command_line_object.createtargets + ").\n"
sys.exit()

if command_line_object.createtargets is not None and command_line_object.rdp:
with open('rdp_' + command_line_object.createtargets, 'w') as target_file:
for item in rdp:
target_file.write(item + '\n')
print "Target file created (rdp_" + command_line_object.createtargets + ").\n"
sys.exit()

if command_line_object.createtargets is not None and command_line_object.vnc:
with open('vnc_' + command_line_object.createtargets, 'w') as target_file:
for item in vnc:
target_file.write(item + '\n')
print "Target file created (vnc_" + command_line_object.createtargets + ").\n"
sys.exit()
return urls, rdp, vnc

Expand Down

0 comments on commit 348b805

Please sign in to comment.