VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > Python基础教程 >
  • Python-nmap网络扫描和嗅探工具包使用(2)

1
2
3
4
import nmap
nm = nmap.PortScanner()
ret = nm.scan('114.114.114.114','20')
print ret

 

返回格式如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
    'nmap': {
        'scanstats': {'uphosts''1''timestr''Tue Oct 25 11:30:47 2016''downhosts''0''totalhosts''1''elapsed''1.11'},
        'scaninfo': {'tcp': {'services''20''method''connect'}}, 
        'command_line''nmap -oX - -p 20 -sV 115.239.210.26'
     },
    'scan': {
        '115.239.210.26': {
            'status': {'state''up''reason''syn-ack'},
            'hostnames': [{'type''''name'''}],
            'vendor': {}, 
            'addresses': {'ipv4''115.239.210.26'},
            'tcp': {20: {'product''''state''filtered''version''''name''ftp-data''conf''3''extrainfo''''reason''no-response''cpe'''}
            }
        }
    }
}

相关教程