def build_nmap_commandline(self, base_flags, address, interface=None):
'''Builds common NMAP option command lines'''
ipaddr = ipaddress.ip_address(address)
# Several bits of magic are required here
# 1. If we're v6 address or range, we need -6
# 2. If we're link-local, we need to specify the interface
options = base_flags
if ipaddr.version == 6:
options = "-6 " + options
if ipaddr.is_link_local:
options = "-e " + interface + " " + options
return options
评论列表
文章目录