Instantly share code, notes, and snippets.

@AustinSturm /func.py Secret
Created Jul 25, 2018

Embed
What would you like to do?
# 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

This comment has been minimized.

Show comment
Hide comment
@AustinSturm

AustinSturm Jul 25, 2018

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', '')]

Owner

AustinSturm commented Jul 25, 2018

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