Skip to content

Commit

Permalink
shodanp returns urls
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Apr 18, 2019
1 parent d247fcc commit d0220bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/wfuzz/plugins/payloads/shodanp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class shodanp(BasePayload):
"Queries the Shodan API",
)

summary = "Returns hostnames or IPs of a given Shodan API search (needs api key)."
summary = "Returns URLs of a given Shodan API search (needs api key)."
category = ["default"]
priority = 99

Expand Down Expand Up @@ -44,8 +44,12 @@ def close(self):

def __next__(self):
match = next(self._it)

port = match['port']
scheme = 'https' if 'ssl' in match or port == 443 else 'http'

if match['hostnames']:
for hostname in match['hostnames']:
return hostname
return "{}://{}:{}".format(scheme, hostname, port)
else:
return match['ip_str']
return "{}://{}:{}".format(scheme, match['ip_str'], port)

0 comments on commit d0220bc

Please sign in to comment.