本文整理汇总了Python中scanner.Scanner.scan_host方法的典型用法代码示例。如果您正苦于以下问题:Python Scanner.scan_host方法的具体用法?Python Scanner.scan_host怎么用?Python Scanner.scan_host使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scanner.Scanner
的用法示例。
在下文中一共展示了Scanner.scan_host方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Scanner
# 需要导入模块: from scanner import Scanner [as 别名]
# 或者: from scanner.Scanner import scan_host [as 别名]
parser.add_argument("-v", "--verbose", help="increase output verbosity",
action="store_true")
parser.add_argument("--git-download-pack", help="attempt to download git pack files",
action="store_true")
parser.add_argument("--threads", help="number of threads for concurrent download. Requires concurrent.futures",
type=int, default=0)
args = parser.parse_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)
scanner = Scanner(args.url)
vulnerability = scanner.scan_host()
if args.threads:
try:
import concurrent.futures
threads = args.threads
except ImportError:
threads = 0
logging.warning("--threads requires the concurrent.futures library")
else:
threads = 0
if vulnerability:
if vulnerability['type'] == 'git':
logging.info("Attempting to download public git repository.")
git = RipperGIT(vulnerability, threads)