Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 21:41 EDT Nmap scan report for 192.168.1.1 Host is up (0.0011s latency). MAC Address: 44:7D:3F:07:2C:A1 (Unknown) Nmap scan report for 192.168.1.2 Host is up (0.000095s latency). MAC Address: FF:8E:BB:EE:AA:B4 (Unknown) Nmap scan report for 192.168.1.3 Host is up (0.051s latency). MAC Address: CC:C0:AC:22:DD:07 (Unknown) Nmap scan report for 192.168.1.7 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 50.15 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 21:52 EDT Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 999 closed ports PORT STATE SERVICE 22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
计算网段主机IP: 仅列出指定网段上的每台主机,不发送任何报文到目标主机.
[root@localhost ~]# nmap -sL 192.168.1.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 21:43 EDT Nmap scan report for 192.168.1.0 Nmap scan report for 192.168.1.1 Nmap scan report for 192.168.1.2 Nmap scan report for 192.168.1.3 Nmap scan report for 192.168.1.4 Nmap scan report for 192.168.1.5 ...省略... Nmap done: 256 IP addresses (0 hosts up) scanned in 4.03 seconds
扫描IP地址范围: 可以指定一个IP地址范围
[root@localhost ~]# nmap -sP 192.168.1.1-10
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:17 EDT Nmap scan report for 192.168.1.1 Host is up (0.00087s latency). MAC Address: 1A:7D:2E:AC:6E:1A (Unknown) Nmap scan report for 192.168.1.2 Host is up (0.00016s latency). MAC Address: 81:8E:38:BC:7C:8E (Unknown) Nmap scan report for 192.168.1.4 Host is up (0.061s latency). MAC Address: 81:29:81:64:81:A3 (Unknown) Nmap scan report for 192.168.1.5 Host is up (0.060s latency). MAC Address: EA:3A:EA:EA:81:EA (Unknown) Nmap scan report for 192.168.1.7 Host is up. Nmap done: 10 IP addresses (5 hosts up) scanned in 0.26 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:15 EDT Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 21:55 EDT Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 999 closed ports PORT STATE SERVICE 22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
SYN扫描: 使用SYN半开放扫描
[root@localhost ~]# nmap -sS 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:01 EDT Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 999 closed ports PORT STATE SERVICE 22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
TCP扫描: 扫描开放了TCP端口的设备.
[root@localhost ~]# nmap -sT 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:01 EDT Nmap scan report for 192.168.1.7 Host is up (0.0012s latency). Not shown: 999 closed ports PORT STATE SERVICE 22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds
UDP扫描: 扫描开放了UDP端口的设备.
[root@localhost ~]# nmap -sU 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:02 EDT Nmap scan report for 192.168.1.7 Host is up (0.0010s latency). Not shown: 999 closed ports PORT STATE SERVICE 68/udp open|filtered dhcpc
Nmap done: 1 IP address (1 host up) scanned in 1.52 seconds
协议探测: 探测目标主机支持哪些IP协议
[root@localhost ~]# nmap -sO 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:04 EDT Nmap scan report for 192.168.1.7 Host is up (0.000016s latency). Not shown: 249 closed protocols PROTOCOL STATE SERVICE 1 open icmp 2 open|filtered igmp 6 open tcp 17 open udp 103 open|filtered pim 136 open|filtered udplite 255 open|filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 1.37 seconds
探测目标系统: 扫描探测目标主机操作系统,这里结果仅供参考.
[root@localhost ~]# nmap -O 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:06 EDT Nmap scan report for 192.168.1.7 Host is up (0.000056s latency). Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql Device type: general purpose Running: Linux 3.X OS CPE: cpe:/o:linux:linux_kernel:3 OS details: Linux 3.7 - 3.9 Network Distance: 0 hops
OS detection performed. Please report any incorrect results at http://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 1.82 seconds
探测服务版本: 用于扫描目标主机服务版本号.
[root@localhost ~]# nmap -sV 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:08 EDT Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.4 (protocol 2.0) 80/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.4.16) 3306/tcp open mysql ?
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 6.43 seconds
扫描多台主机: 一次性扫描多台目标主机.
[root@localhost ~]# nmap 192.168.1.2 192.168.1.7
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:11 EDT Nmap scan report for 192.168.1.2 Host is up (0.00052s latency). Not shown: 997 filtered ports PORT STATE SERVICE 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds MAC Address: F4:8E:38:EE:7C:B4 (Unknown)
Nmap scan report for 192.168.1.7 Host is up (0.000010s latency). Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql
Nmap done: 2 IP addresses (2 hosts up) scanned in 4.26 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-19 22:13 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.0000090s latency). Other addresses for localhost (not scanned): 127.0.0.1 Not shown: 996 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 80/tcp open http 3306/tcp open mysql
Nmap scan report for 192.168.1.7 Host is up (0.0000090s latency). Not shown: 997 closed ports PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 3306/tcp open mysql
Nmap done: 3 IP addresses (2 hosts up) scanned in 3.09 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 03:12 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.000012s latency). Not shown: 998 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp
Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-30 23:16 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.0000090s latency). Not shown: 995 closed ports PORT STATE SERVICE 21/tcp open ftp | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_drwxr-xr-x 2 0 0 6 Oct 30 19:45 pub 22/tcp open ssh 25/tcp open smtp | smtp-enum-users: |_ root 80/tcp open http | http-domino-enum-passwords: |_ ERROR: No valid credentials were found 3306/tcp open mysql
Nmap done: 1 IP address (1 host up) scanned in 0.89 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 02:05 EDT Pre-scan script results: | broadcast-netbios-master-browser: | ip server domain |_192.168.1.2 Web-Server WORKGROUP Nmap scan report for 192.168.1.1 Host is up (0.0011s latency). Not shown: 998 closed ports PORT STATE SERVICE 80/tcp filtered http 1900/tcp open upnp MAC Address: 42:1C:1B:E7:B1:B2 (TP-Link)
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 02:16 EDT Nmap scan report for www.baidu.com (61.135.169.121) Host is up (0.017s latency). Other addresses for www.baidu.com (not scanned): 61.135.169.125 PORT STATE SERVICE 443/tcp open https |_http-date: Sun, 31 Mar 2019 06:16:53 GMT; 0s from local time.
Nmap done: 1 IP address (1 host up) scanned in 0.27 seconds
执行DOS攻击: dos攻击,对于处理能力较小的站点还挺好用的.
[root@localhost ~]# nmap --script http-slowloris --max-parallelism 1000 www.mkdirs.com Warning: Your max-parallelism (-M) option is extraordinarily high, which can hurt reliability
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 02:21 EDT
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 02:28 EDT NSE: Loaded 1 scripts for scanning. NSE: Script Pre-scanning. Initiating Ping Scan at 02:28 Scanning www.baidu.com (61.135.169.121) [4 ports] Completed Ping Scan at 02:28, 0.02s elapsed (1 total hosts) Initiating Parallel DNS resolution of 1 host. at 02:28 Completed Parallel DNS resolution of 1 host. at 02:28, 0.01s elapsed Initiating SYN Stealth Scan at 02:28 Scanning www.baidu.com (61.135.169.121) [1 port] Completed SYN Stealth Scan at 02:28, 0.20s elapsed (1 total ports) NSE: Script scanning 61.135.169.121. Nmap scan report for www.baidu.com (61.135.169.121) Host is up (0.016s latency). Other addresses for www.baidu.com (not scanned): 61.135.169.125 PORT STATE SERVICE 53/tcp filtered domain
NSE: Script Post-scanning. Read data files from: /usr/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.28 seconds Raw packets sent: 6 (240B) | Rcvd: 1 (28B)
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 02:29 EDT Nmap scan report for www.baidu.com (61.135.169.121) Host is up (0.017s latency). Other addresses for www.baidu.com (not scanned): 61.135.169.125 PORT STATE SERVICE 80/tcp open http
Host script results: | hostmap-ip2hosts: |_ hosts: Error: could not GET http://www.ip2hosts.com/csv.php?ip=61.135.169.121
Nmap done: 1 IP address (1 host up) scanned in 5.89 seconds
Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-31 03:19 EDT Nmap scan report for www.baidu.com (61.135.169.125) Host is up (0.018s latency). Other addresses for www.baidu.com (not scanned): 61.135.169.121 Not shown: 998 filtered ports PORT STATE SERVICE 80/tcp open http 443/tcp open https