Skip to content

Instantly share code, notes, and snippets.

@AustinSturm
Created July 25, 2018 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AustinSturm/5dccc8c7590323f607ae81f14ea74ca9 to your computer and use it in GitHub Desktop.
Save AustinSturm/5dccc8c7590323f607ae81f14ea74ca9 to your computer and use it in GitHub Desktop.
# input: {}
# returns [(hostnames), (ip), (ports)]
def getTargets(finding):
results = []
hostnames = str(finding['Server or Device Name']).split()
ips = str(finding['IP Address']).split()
ports = str(finding['Port(s)'].split())
print "ports"
print str(ports)
zipped = list(izip_longest(hostnames, ips, ports, fillvalue=''))
print "target:"
print zipped
return zipped
@AustinSturm
Copy link
Author

Input for port: [u'22']
Output: [('', '10.38.168.72,', '['), ('', '10.38.168.100,', 'u'), ('', '10.38.168.128,', "'"), ('', '10.38.168.206,', '2'), ('', '10.38.168.248,', '2'), ('', '10.38.169.127,', "'"), ('', '10.38.170.42,', ']'), ('', '10.38.170.130', '')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment