nmapUtils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:AnyScan 作者: zhangzhenfeng 项目源码 文件源码
def portscanner(target_host,target_port,arguments="-T4 -A -v -Pn"):
    """
    :param target_host:
    :param target_port:
    :return:
    -sS ??SYN??????????????????????(?????,?????)
    -T4 -T(0-5) ???3 4 ?Aggressive?????5?????????????????????5????????????????????1.5??
    -A ?????????????????
    """
    current_path = "%s/nmap_file/" % (os.getcwd())
    if os.path.exists(current_path) == False:
        os.mkdir("nmap_file")
    arguments = arguments + " -oN %s%s" % (current_path,target_host)
    if target_port == "" or target_port is None:
        target_port = "1-65535"
    scanner = nmap.PortScanner()
    results = scanner.scan(hosts=target_host,ports=target_port,arguments=arguments,sudo=False)
    # ???????????
    return current_path+target_host,results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号