传递IP地址列表以在python中扫描端口(libnmap)

2024-09-20 23:07:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在编写一个python脚本,它基本上扫描IP地址上的端口,我使用libnmap库来完成这项工作,并参考了位于https://libnmap.readthedocs.org/en/latest/process.html#purpose-of-libnmap-process的文档

我希望读取一个包含要扫描的IP地址列表的外部文件,并将每个IP地址传递为:

file_object = open(file_containg_ip_to_be_port_scanned, r)

    if __name__ == "__main__":
        report = do_scan("pass_ip_here", "-sV")
        if report:
            print_scan(report)

我怎样才能做到这一点?在


Tags: 端口httpsorgreportip脚本scanif

热门问题