本文整理汇总了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']