1 #coding=utf-8
2
3 importnmap4 importoptparse5 importthreading6 importsys7 importre8 '''
9 需安装python_nmap包,支持2.x以及3.x10 python_nmap包提供了python调用nmap的一系列接口11
12 (一)重要类及方法:13 1.创建nmap扫描器14 class PortScanner()15 __init__(self, nmap_search_path=('nmap', '/usr/bin/nmap', '/usr/local/bin/nmap', '/sw/bin/nmap', '/opt/local/bin/nmap'))16 Initialize PortScanner module17
18 * detects nmap on the system and nmap version19 * may raise PortScannerError exception if nmap is not found in the path20
21 :param nmap_search_path: tupple of string where to search for nmap executable. Change this if you want to use a specific version of nmap.22 :returns: nothing23 2.扫描器方法24 scan(self, hosts='127.0.0.1', ports=None, arguments='-sV', sudo=False)25 Scan given hosts26
27 May raise PortScannerError exception if
本文发布于:2024-02-03 04:54:23,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170690726348779.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |