Skip to content

Instantly share code, notes, and snippets.

@jimywork
Last active December 8, 2019 16:13
Show Gist options
  • Save jimywork/cb08f0277ab3dec0d5a514110b7c6eca to your computer and use it in GitHub Desktop.
Save jimywork/cb08f0277ab3dec0d5a514110b7c6eca to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import shodan
import requests
def goipsms (api=None, dork=None, limit=None, offset=None) :
urls = []
try:
api = shodan.Shodan(api)
res = api.search(dork, limit=limit, offset=offset)
matches = res['matches']
for match in matches:
ipaddress = match['ip_str']
port = match['port']
# Skip hosts with SSL
if port == 443 :
continue
urls.append('http://{}:{}'.format(ipaddress, port))
except shodan.APIError as error:
print(error)
return urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment