本文整理匯總了Python中shodan.WebAPI.info方法的典型用法代碼示例。如果您正苦於以下問題:Python WebAPI.info方法的具體用法?Python WebAPI.info怎麽用?Python WebAPI.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類shodan.WebAPI
的用法示例。
在下文中一共展示了WebAPI.info方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: WebAPI
# 需要導入模塊: from shodan import WebAPI [as 別名]
# 或者: from shodan.WebAPI import info [as 別名]
ssl.add_argument("-cv", "--cert-version", help="Filter by SSL version", choices=['Original', 'SSLv2', 'SSLv3', 'TLSv1'])
ssl.add_argument("-ci", "--cert-issuer", help="Filter by CA")
ssl.add_argument("-cd", "--cert-subject", help="Filter by cert description")
excl = parser.add_mutually_exclusive_group(required=True)
excl.add_argument("-H", "--hostname", help="Filter by host")
excl.add_argument("-q", "--query", help="Query")
args = parser.parse_args().__dict__
print "\n[+] Shodan HQ search client - Written by salcho"
print "[+] Starting API with key %s" % SHODAN_KEY
global api
api = WebAPI(SHODAN_KEY)
try:
inf = api.info()
except WebAPIError as e:
msg = "\n[-] WebAPIError! Message is: " + str(e)
msg += "\n[-] Your key may be causing this. You may want to change it.\n"
print msg
return
print "[+] Account info is:\n"
for key in inf.keys():
print "\t[*] %s: %s" % (key, inf[key])
if key == 'https' and inf[key]:
is_https = True
if not is_https:
del args['cert_version']
del args['cert_issuer']