精华内容
下载资源
问答
  • python调用nmap扫描局域网存活主机和端口 文章目录python调用nmap扫描局域网存活主机和端口操作环境运行代码关键代码1. nm.scan(ip,port,args)2. 字典的解析运行结果参考文章 操作环境 python2 sudo apt install ...

    python调用nmap扫描局域网存活主机和端口

    操作环境

    python2

    sudo apt install nmap

    pip install nmap json

    运行代码

    sudo python2 scan.py

    代码经过调试,使用root可直接运行

    #!python2 
    # scan.py must be sudo to run
    import nmap
    import json
    
    nm = nmap.PortScanner()
    iprange = raw_input("input ip range(eg:192.168.224.0/24)>")
    port = raw_input("input target port(eg:8888)>")
    if not port:
    	port = 8888
    if not iprange:
        iprange = "192.168.224.0/24"
    print("scan ip range " + iprange)
    a = nm.scan(iprange, str(port), '-sS -O')
    a = a.get("scan")
    
    target = 0
    for key, value in a.items():
        if value.get("tcp").get(port).get("state") == "open":
            print "target ip maybe :" + key
            print "some information"
            print value
            target = target + 1
    
    if target == 0:
        print "no target machine detectd...."
    

    关键代码

    1. nm.scan(ip,port,args)

    请查阅参考文档一,有详细的解释

    返回的结果a形式如下:a是个字典

    {'nmap': {'scanstats': {'uphosts': '4', 'timestr': 'Sat Jun 27 13:29:19 2020', 'downhosts': '252', 'totalhosts': '256', 'elapsed': '9.86'}, 'scaninfo': {'tcp': {'services': '8888', 'method': 'syn'}}, 'command_line': 'nmap -oX - -p 8888 -sS -O 192.168.224.0/24'}, 'scan': {'192.168.224.132': {'status': {'state': 'up', 'reason': 'localhost-response'}, 'uptime': {'seconds': '1999559', 'lastboot': 'Thu Jun  4 10:03:20 2020'}, 'vendor': {}, 'addresses': {'ipv4': '192.168.224.132'}, 'tcp': {8888: {'product': '', 'state': 'open', 'version': '', 'name': 'sun-answerbook', 'conf': '3', 'extrainfo': '', 'reason': 'syn-ack', 'cpe': ''}}, 'hostnames': [{'type': '', 'name': ''}], 'osmatch': [{'osclass': [{'osfamily': 'Linux', 'vendor': 'Linux', 'cpe': ['cpe:/o:linux:linux_kernel:2.6.32'], 'type': 'general purpose', 'osgen': '2.6.X', 'accuracy': '100'}], 'line': '50174', 'name': 'Linux 2.6.32', 'accuracy': '100'}], 'portused': [{'state': 'open', 'portid': '8888', 'proto': 'tcp'}, {'state': 'closed', 'portid': '34334', 'proto': 'udp'}]}, '192.168.224.1': {'status': {'state': 'up', 'reason': 'arp-response'}, 'vendor': {'00:50:56:C0:00:08': 'VMware'}, 'addresses': {'mac': '00:50:56:C0:00:08', 'ipv4': '192.168.224.1'}, 'tcp': {8888: {'product': '', 'state': 'filtered', 'version': '', 'name': 'sun-answerbook', 'conf': '3', 'extrainfo': '', 'reason': 'no-response', 'cpe': ''}}, 'hostnames': [{'type': '', 'name': ''}], 'osmatch': [], 'portused': []}, '192.168.224.2': {'status': {'state': 'up', 'reason': 'arp-response'}, 'vendor': {'00:50:56:E8:9C:1A': 'VMware'}, 'addresses': {'mac': '00:50:56:E8:9C:1A', 'ipv4': '192.168.224.2'}, 'tcp': {8888: {'product': '', 'state': 'closed', 'version': '', 'name': 'sun-answerbook', 'conf': '3', 'extrainfo': '', 'reason': 'reset', 'cpe': ''}}, 'hostnames': [{'type': '', 'name': ''}], 'osmatch': [{'osclass': [{'osfamily': 'embedded', 'vendor': 'Aethra', 'cpe': ['cpe:/h:aethra:starvoice_1042'], 'type': 'broadband router', 'osgen': None, 'accuracy': '91'}], 'line': '1615', 'name': 'Aethra Starvoice 1042 ADSL router', 'accuracy': '91'}, {'osclass': [{'osfamily': 'AOS', 'vendor': 'APC', 'cpe': ['cpe:/o:apc:aos:5'], 'type': 'power-device', 'osgen': '5.X', 'accuracy': '91'}], 'line': '2920', 'name': 'APC AOS 5', 'accuracy': '91'}, {'osclass': [{'osfamily': 'SuperDOS', 'vendor': 'Bluebird', 'cpe': ['cpe:/o:bluebird:superdos'], 'type': 'general purpose', 'osgen': None, 'accuracy': '91'}], 'line': '9384', 'name': 'Bluebird SuperDOS', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:nc-130h'], 'type': 'print server', 'osgen': None, 'accuracy': '91'}], 'line': '9587', 'name': 'Brother NC-130h print server', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:hl-1870n'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '9767', 'name': 'Brother HL-1870N printer', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:hl-2070n', 'cpe:/h:brother:mfc-5460cn'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '9786', 'name': 'Brother HL-2070N or MFC-5460CN printer', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:hl-2070n'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '9805', 'name': 'Brother HL-2070N printer', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:hl-5070n'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '10112', 'name': 'Brother HL-5070N printer', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:mfc-7820n'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '10480', 'name': 'Brother MFC-7820N printer', 'accuracy': '91'}, {'osclass': [{'osfamily': 'embedded', 'vendor': 'Brother', 'cpe': ['cpe:/h:brother:mfc-9420cn'], 'type': 'printer', 'osgen': None, 'accuracy': '91'}], 'line': '10595', 'name': 'Brother MFC-9420CN printer', 'accuracy': '91'}], 'portused': [{'state': 'closed', 'portid': '8888', 'proto': 'tcp'}]}, '192.168.224.254': {'status': {'state': 'up', 'reason': 'arp-response'}, 'vendor': {'00:50:56:F5:F1:1D': 'VMware'}, 'addresses': {'mac': '00:50:56:F5:F1:1D', 'ipv4': '192.168.224.254'}, 'tcp': {8888: {'product': '', 'state': 'filtered', 'version': '', 'name': 'sun-answerbook', 'conf': '3', 'extrainfo': '', 'reason': 'no-response', 'cpe': ''}}, 'hostnames': [{'type': '', 'name': ''}], 'osmatch': [], 'portused': []}}}
    

    2. 字典的解析

    为了更好地测试,最好使用jupyter或控制台去单步执行,去使用dict的get方法去逐步解析,防止错误

    for key, value in a.items():
        if value.get("tcp").get(port).get("state") == "open":
            print "target ip maybe :" + key
            print "some information"
            print value
            target = target + 1
    

    运行结果

    zhao@zhao:~/Desktop/project$ sudo python scan.py
    [sudo] password for zhao:
    input ip range(eg:192.168.224.0/24)>
    input target port(eg:8888)>
    scan ip range 192.168.224.0/24
    target ip maybe :192.168.224.132
    some information
    {'status': {'state': 'up', 'reason': 'localhost-response'}, 'uptime': {'seconds': '2001774', 'lastboot': 'Thu Jun  4 10:03:22 2020'}, 'vendor': {}, 'addresses': {'ipv4': '192.168.224.132'}, 'tcp': {8888: {'product': '', 'state': 'open', 'version': '', 'name': 'sun-answerbook', 'conf': '3', 'extrainfo': '', 'reason': 'syn-ack', 'cpe': ''}}, 'hostnames': [{'type': '', 'name': ''}], 'osmatch': [{'osclass': [{'osfamily': 'Linux', 'vendor': 'Linux', 'cpe': ['cpe:/o:linux:linux_kernel:2.6.32'], 'type': 'general purpose', 'osgen': '2.6.X', 'accuracy': '100'}], 'line': '50174', 'name': 'Linux 2.6.32', 'accuracy': '100'}], 'portused': [{'state': 'open', 'portid': '8888', 'proto': 'tcp'}, {'state': 'closed', 'portid': '30317', 'proto': 'udp'}]}
    
    

    参考文章

    1. Python中python-nmap模块的使用

    2. nmap命令扫描存活主机

    展开全文
  • nmap命令扫描存活主机

    万次阅读 2019-09-24 12:04:15
    1、ping扫描扫描192.168.0.0/24网段上有哪些主机存活的; [root@laolinux ~]#nmap -sP 192.168.0.0/24 Starting Nmap 4.11 (http://www.insecure.org/nmap/) at 2009-04-25 06:59 CSTHost laolinux (192.168...
    1、ping扫描:扫描192.168.0.0/24网段上有哪些主机是存活的;
     
    [root@laolinux ~]# nmap -sP 192.168.0.0/24
    Starting Nmap 4.11 (  http://www.insecure.org/nmap/ ) at 2009-04-25 06:59 CST
    Host laolinux (192.168.0.3) appears to be up.
    Host 192.168.0.20 appears to be up.
    MAC Address: 00:1E:4F:CD:C6:0E (Unknown)
    Host 192.168.0.108 appears to be up.
    MAC Address: 00:E3:74:27:05:B7 (Unknown)
    Host 192.168.0.109 appears to be up.
    MAC Address: 00:E0:E4:A6:14:6F (Fanuc Robotics North America)
    Host 192.168.0.111 appears to be up.
    MAC Address: 00:E0:E4:A6:1C:91 (Fanuc Robotics North America)
    Host 192.168.0.114 appears to be up.
    MAC Address: 00:11:1A:35:38:65 (Motorola BCS)
    Host 192.168.0.118 appears to be up.
    MAC Address: 00:E0:2A:51:AC:5B (Tandberg Television AS)
    Host 192.168.0.119 appears to be up.
    MAC Address: 00:EA:E5:C1:21:D6 (Unknown)
    Host 192.168.0.124 appears to be up.
    MAC Address: 00:E0:4C:39:05:81 (Realtek Semiconductor)
    Host 192.168.0.127 appears to be up.
    MAC Address: 00:11:1A:35:38:62 (Motorola BCS)
    Host 192.168.0.128 appears to be up.
    MAC Address: 00:E0:E4:A6:1C:96 (Fanuc Robotics North America)
    Host 192.168.0.134 appears to be up.
    MAC Address: 00:E0:2A:51:AC:5F (Tandberg Television AS)
    Host 192.168.0.135 appears to be up.
    MAC Address: 00:11:1A:35:38:60 (Motorola BCS)
    Host 192.168.0.137 appears to be up.
    MAC Address: 00:1F:06:D6:3E:BA (Unknown)
    Host 192.168.0.139 appears to be up.
    MAC Address: 00:E0:E4:A6:1C:92 (Fanuc Robotics North America)
    Host 192.168.0.140 appears to be up.
    MAC Address: 00:1F:1A:39:1B:8D (Unknown)
    Host 192.168.0.155 appears to be up.
    MAC Address: 00:1C:23:4C:DB:A0 (Unknown)
    Host 192.168.0.211 appears to be up.
    MAC Address: 00:1D:72:98:A2:8C (Unknown)
    Host 192.168.0.220 appears to be up.
    MAC Address: 00:40:45:20:8C:93 (Twinhead)
    Host 192.168.0.221 appears to be up.
    MAC Address: 00:09:6B:50:71:26 (IBM)
    Nmap finished: 256 IP addresses (20 hosts up) scanned in 3.818 seconds
     
    2、端口扫描:扫描192.168.0.3这台主机开放了哪些端口;
     
    [root@laolinux ~]# nmap -sT 192.168.0.3
    Starting Nmap 4.11 (  http://www.insecure.org/nmap/ ) at 2009-04-25 07:02 CST
    Interesting ports on laolinux (192.168.0.3):
    Not shown: 1667 closed ports
    PORT      STATE SERVICE
    21/tcp    open  ftp
    22/tcp    open  ssh
    25/tcp    open  smtp
    53/tcp    open  domain
    80/tcp    open  http
    110/tcp   open  pop3
    111/tcp   open  rpcbind
    143/tcp   open  imap
    964/tcp   open  unknown
    993/tcp   open  imaps
    995/tcp   open  pop3s
    3306/tcp  open  mysql
    10000/tcp open  snet-sensor-mgmt
    Nmap finished: 1 IP address (1 host up) scanned in 4.755 seconds
    3、隐藏扫描,只在目标主机上留下很少的日志信息:隐藏扫描192.168.0.220
     
    [root@laolinux ~]# nmap -sS 192.168.0.127
    Starting Nmap 4.11 (  http://www.insecure.org/nmap/ ) at 2009-04-25 07:08 CST
    Interesting ports on 192.168.0.127:
    Not shown: 1675 closed ports
    PORT    STATE SERVICE
    21/tcp  open  ftp
    135/tcp open  msrpc
    139/tcp open  netbios-ssn
    445/tcp open  microsoft-ds
    912/tcp open  unknown
    MAC Address: 00:11:1A:35:38:62 (Motorola BCS)
    Nmap finished: 1 IP address (1 host up) scanned in 3.121 seconds
    4、UDP端口扫描:扫描192.168.0.127开放了哪些UDP端口;
     
    [root@laolinux ~]# nmap -sU 192.168.0.127
    Starting Nmap 4.11 (  http://www.insecure.org/nmap/ ) at 2009-04-25 07:08 CST
    Interesting ports on 192.168.0.127:
    Not shown: 1480 closed ports
    PORT     STATE         SERVICE
    123/udp  open|filtered ntp
    137/udp  open|filtered netbios-ns
    138/udp  open|filtered netbios-dgm
    445/udp  open|filtered microsoft-ds
    500/udp  open|filtered isakmp
    1900/udp open|filtered UPnP
    4500/udp open|filtered sae-urn
    MAC Address: 00:11:1A:35:38:62 (Motorola BCS)
    Nmap finished: 1 IP address (1 host up) scanned in 2.947 seconds
    5、操作系统识别:
     
    [root@laolinux ~]# nmap -sS -O  192.168.0.127
    Starting Nmap 4.11 (  http://www.insecure.org/nmap/ ) at 2009-04-25 07:09 CST
    Interesting ports on 192.168.0.127:
    Not shown: 1675 closed ports
    PORT    STATE SERVICE
    21/tcp  open  ftp
    135/tcp open  msrpc
    139/tcp open  netbios-ssn
    445/tcp open  microsoft-ds
    912/tcp open  unknown
    MAC Address: 00:11:1A:35:38:62 (Motorola BCS)
    Device type: general purpose
    Running: Microsoft Windows 2003/.NET|NT/2K/XP
    OS details: Microsoft Windows 2003 Server or XP SP2
    Nmap finished: 1 IP address (1 host up) scanned in 5.687 seconds

    转载于:https://www.cnblogs.com/xxxyz/p/11567531.html

    展开全文
  • 使用环境:Raspberry 3b+ +netifaces+python-nmap+nmap 调用netifaces自动获取ip地址: def get_gateways(): return netifaces.gateways()['default'][netifaces.AF_INET][0] 将ip地址生成一个网段中所有ip...

    使用环境:Raspberry 3b+ +netifaces+python-nmap+nmap

    调用netifaces自动获取ip地址:

    def get_gateways():
        return netifaces.gateways()['default'][netifaces.AF_INET][0]

    将ip地址生成一个网段中所有ip地址的列表:

    def get_ip_lists(ip):
        ip_lists = []
        for i in range(1, 256):
            ip_lists.append('{}{}'.format(ip[:-1], i))
        return ip_lists

    主要实现代码及数据分割:

    def main(ip=None):
        ip=get_gateways()
        ip_lists=get_ip_lists(ip)
        nmScan,temp_ip_lists,hosts = nmap.PortScanner(),[],ip[:-1]+'0/24'
        ret = nmScan.scan(hosts=hosts, arguments='-sP')
        print('扫描时间:'+ret['nmap']['scanstats']['timestr']+'\n命令参数:'+ret['nmap']['command_line'])
        for ip in ip_lists:
            print('ip地址:'+ip+'')
            if ip not in ret['scan']:
                temp_ip_lists.append(ip)
                print('扫描超时')
            else:print('已扫描到主机,主机名:'+ret['scan'][ip]['hostnames'][0]['name'])
        print(str(hosts) +' 网络中的存活主机:')
        for ip in temp_ip_lists:ip_lists.remove(ip)
        for ip in ip_lists:print(ip)

    完整代码:

    #!/usr/bin/python
    #_*_ coding:utf8 _*_
    import netifaces,nmap
    
    def get_gateways():
        return netifaces.gateways()['default'][netifaces.AF_INET][0]
    
    def get_ip_lists(ip):
        ip_lists = []
        for i in range(1, 256):
            ip_lists.append('{}{}'.format(ip[:-1], i))
        return ip_lists
    
    def main(ip=None):
        ip=get_gateways()
        ip_lists=get_ip_lists(ip)
        nmScan,temp_ip_lists,hosts = nmap.PortScanner(),[],ip[:-1]+'0/24'
        ret = nmScan.scan(hosts=hosts, arguments='-sP')
        print('扫描时间:'+ret['nmap']['scanstats']['timestr']+'\n命令参数:'+ret['nmap']['command_line'])
        for ip in ip_lists:
            print('ip地址:'+ip+'')
            if ip not in ret['scan']:
                temp_ip_lists.append(ip)
                print('扫描超时')
            else:print('已扫描到主机,主机名:'+ret['scan'][ip]['hostnames'][0]['name'])
        print(str(hosts) +' 网络中的存活主机:')
        for ip in temp_ip_lists:ip_lists.remove(ip)
        for ip in ip_lists:print(ip)
    
    if __name__ == '__main__':
        main()

    实验截图:

    转载于:https://www.cnblogs.com/canmeng/p/9681729.html

    展开全文
  • nmap查看局域网存活主机

    千次阅读 2019-10-03 21:06:16
    nmap是一个非常强大的扫描工具一个著名的扫描大王 用nmap进行局域网扫描 先用查看一下ip段 ifconfig 然后用 nmap -sP 192.168.43.0/24 -sP是ping扫描,24是扫描到255 ...

    nmap是一个非常强大的扫描工具一个著名的扫描大王
    用nmap进行局域网扫描
    先用查看一下ip段

    ifconfig
    

    在这里插入图片描述
    然后用

    nmap -sP 192.168.43.0/24
    

    -sP是ping扫描,24是扫描到255
    在这里插入图片描述

    展开全文
  • nmap -n -sP192.168.1.0/23 #扫描网段存活的IP 在python中使用(需要先安装nmap): # _*_coding: utf-8_*_ import nmap s = nmap.PortScanner() s_all = nmap.PortScanner() ip_seg = "192.168.1.0/23" s....
  • nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端。确定哪些服务运行在哪些连接端,并且推断计算机运行哪个操作系统(这是亦称 fingerprinting)。它是网络管理员必用的软件之一,以及用以评估网络...
  • Linux下使用nmap扫描局域网存活的IP

    千次阅读 2015-11-05 14:14:50
    Linux下使用nmap扫描局域网存活的IP[root@z05 ~]# nmap -sP 192.168.0.0/24|grep 192.mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify val...
  • Nmap扫描网段时的坑

    万次阅读 2017-02-15 16:35:37
    Nmap扫描一个网段:nmap [可选的Nmap参数] 例如:nmap -sn -PE 192.168.18.0/24 扫描探测的是192.168.18网段有多少存活主机 当我们需要探测多个网段时,nmap的网段容易写错 网段中是可以有0-255的,包括了0和...
  • 在另一个linux主机上,使用nmap命令即可 ,比如 我在1.1.1.2上开放了端口1111 -A INPUT -p tcp -m state --state NEW -m tcp --dport 1111 -j ACCEPT 在1.1.1.1上执行 即可查到 转载于:...
  • 调用nmap扫描主机操作系统,同时进行SYN扫描和UDP扫描探测开放的端口 54 nm.scan(ip,arguments= ' -O -sS -sU -F ' ) 55 sr={ ' address ' :ip, ' osclass ' :str(nm[ip][ ' osclass ' ])[1:-1], ' tcp ' :...
  • 本文通过介绍三款工具(nmap、fping、ettercap)分别对网络存活主机进行探测,让我们一起学习! 二、资源装备 1.安装好Kali Linux的虚拟机一台; 2.整装待发的小白一个。 三、战略安排 3.1 查看nmap帮助信息,寻找...
  • 使用Nmap扫描目标主机

    2021-04-13 22:17:48
    端口扫描是指某些别有用心的人发送一组端口扫描消息,试图以此侵入某台计算机,并...目前在市面上主要的端口扫描工具是X_Scan、SuperScan、nmap,其中在这里主推的是nmap Nmap包含四项基本功能: 主机发现(Host .
  • 存活主机发现(基于nmap和Qt)

    千次阅读 2018-11-05 19:56:03
    1.下载nmap并安装。下载地址:nmap。 2.nmap可以将输出结果定向为xml文件。...nmap主机发现命令:nmap -sn -PE -n --min-hostgroup 1024 --min-parallelism 1024 -PE 1-254 -oX nmap_output.xml。一个网段大概2s...
  • Python之nmap-ping扫描探测主机存活

    千次阅读 2018-11-24 21:35:41
    其实在这篇文章之前本人已讲述一篇关于ICMP协议探测主机的文章...但是功能不比scapy少,因为nmap不但可以探测主机存活、端口等功能,还可以发送大量数据包探测主机开放端口号下的版本或...
  • 脚本如下,需要用到IPy模块,python-nmap模块,脚本执行后,以csv文档将结果输出到屏幕上 #!/usr/bin/env python3 ''' ...使用方法: nmap_scan.py 192.168.0.0/24 22,3389 支持单个IP,网段扫描 网段格...
  • Nmap——端口扫描

    2021-05-24 23:41:53
    Nmap以新颖的方式使用原始IP报文来发现网络上有哪些主机,那些主机提供什么服务(应用程序名和版本),那些服务运行在什么操作系统(包括版本信息),它们使用什么类型的报文过滤器/防火墙,以及一堆其它功能。...
  • 对于已经知道主机存活或者防火墙开启的机器,可以使用-Pn参数停止探测之前的icmp请求 ,达到不触发防火墙安全机制 使用-p m-n扫描指定范围的的端口 在命令行中,输入nmap -h查看帮助信息 ...
  • 前提:拿下边界机之后,进入内网,想用nmap怎么办? CS可以开启代理,但是是socks4的代理,只能使用tcp协议,所以nmap使用的时候要使用-sT选择使用tcp_协议,要使用-Pn不使用ICMP_的ping确认主机存活 ...
  • nmap快速扫描大量主机端口方法

    千次阅读 2020-03-16 22:04:28
    今天参加了某单位的风险评估项目,在做风险评估之前需要对目标进行信息收集,我使用msf对两个目标网段做了存活主机探测,之后发现了有70个存活主机,第二步需要对存活主机进行端口扫描,这一步最开始耽误了我不少...
  • 安装nmap sudo apt-get install nmap 扫描 nmap 192.168.3.0/24 我所在的网段为192.168.3.*网段 查看mac地址 cat /proc/net/arp
  • 利用nmap搜集主机信息

    千次阅读 2018-07-22 15:43:51
    nmap是一个非常有用的信息收集工具,利用它可以查看到其他主机的MAC,IP信息,还可以查看主机哪些端口是打开的。 有效地收集信息可以对我们渗透主机起到很大的帮助。 先查看自己的IP: 之后我们在看看网关,这...
  • Nmap扫描结果保存到本地并提取ip

    千次阅读 2021-09-14 17:08:59
    需求:对某网段就行C段扫描,将扫描结果保存为txt文档,并将扫描到的所有的存活主机ip进行提取并保存到txt文件中,然后倒入nessus进行批量扫描。 1. 扫描并保存结果 nmap xx.xx.38.0/24 -oN C段.txt 2. 提取存活...
  • Nmap主机端口扫描

    2020-04-19 20:30:40
    主机端口扫描 前言 一、nmap简介 Nmap是一个网络连接端扫描软件,用来扫描网上电脑开放的网络连接端。确定哪服务运行在那些连接端,并且推断哪个操作系统计算机运行(这是亦称fingerprinting)。 它是网络管理员必用...
  • 工作环境:Red Hat Enterprise Linux Server release 6.5 (Santiago) 、 bash#!/bin/bash#nmap -n -sP 10.0.0.1-254|grep "10.0.0"|awk '{print $5}' >ceshi.txta=(`cat ceshi.txt |tr "\n" " "`)echo "${a[...
  • 0x00 ARP概述中文名: 地址解析协议(英语:Address Resolution Protocol,缩写:ARP)是通过解析网络层地址(IPv4,IPv6)来寻找...0x01 基本功能在以太网协议中规定,同一局域网中的一台主机A要和另一台主机B进行直接通...
  • 原理:nmap向所在网段发送大量ARP请求广播,如果目标主机存活,则会收到ARP响应,若一段时间后没有收到相应,则认为主机死亡。 2.基于ICMP a.通过ICMP"应答"请求和响应请求(类型值 8 和 0) nmap -PE + ip...
  • Kali Linux 使用nmap进行局域网扫描

    万次阅读 2017-07-21 11:52:58
    ping扫描扫描192.168.0.0/24网段上有哪些主机存活的;   [root@laolinux ~]# nmap -sP 192.168.0.0/24 Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-04-25 06:59 CST Host laolinux ...
  • nmap 扫描原理及操作

    2020-04-18 20:33:56
    功能架构图 检测活在网络上的主机主机发现) 检测主机上开放的端口(端口发现或枚举) 检测到相应的端口(服务发现)的软件...nmap 192.168.0.1/24 扫描IP所在网段 nmap -iL 绝对路径 将多个IP放入文本中进行...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 2,629
精华内容 1,051
关键字:

nmap扫描网段存活主机