mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-24 14:32:57 +08:00
21 lines
590 B
Python
21 lines
590 B
Python
from shodan import WebAPI
|
|
import sys
|
|
|
|
|
|
class search_shodan():
|
|
|
|
def __init__(self, host):
|
|
self.host = host
|
|
self.key = "oCiMsgM6rQWqiTvPxFHYcExlZgg7wvTt"
|
|
if self.key == "":
|
|
print "You need an API key in order to use SHODAN database. You can get one here: http://www.shodanhq.com/"
|
|
sys.exit()
|
|
self.api = WebAPI(self.key)
|
|
|
|
def run(self):
|
|
try:
|
|
host = self.api.host(self.host)
|
|
return host['data']
|
|
except:
|
|
print "SHODAN empty reply or error in the call"
|
|
return "error"
|