-
-
Save AustinSturm/5dccc8c7590323f607ae81f14ea74ca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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', '')]