;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1440 ;; QUESTION SECTION: ;linux.com. IN A
;; ANSWER SECTION: linux.com. 10800 IN A 151.101.129.5 linux.com. 10800 IN A 151.101.65.5 linux.com. 10800 IN A 151.101.1.5 linux.com. 10800 IN A 151.101.193.5
$ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1
好吧,不过我已经知道了。您的 Linux 发行版可能配置不同,您会看到您的上游服务器。接下来我们来试试网络管理器命令行工具 nmcli:
1 2 3
$ nmcli dev show | grep DNS IP4.DNS[1]: 192.168.1.1
$ nmap -sn 192.168.1.0/24 Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-14 14:03 PST Nmap scan report for Mobile.Hotspot (192.168.1.1) Host is up (0.011s latency). Nmap scan report for studio (192.168.1.2) Host is up (0.000071s latency). Nmap scan report for nellybly (192.168.1.3) Host is up (0.015s latency) Nmap done: 256 IP addresses (2 hosts up) scanned in 2.23 seconds
Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-14 16:46 PST Nmap scan report for Mobile.Hotspot (192.168.1.1) Host is up (0.0071s latency). Not shown: 997 closed ports PORT STATE SERVICE VERSION 22/tcp filtered ssh 53/tcp open domain dnsmasq 2.55 80/tcp open http GoAhead WebServer 2.5.0
Nmap scan report for studio (192.168.1.102) Host is up (0.000087s latency). Not shown: 998 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0) 631/tcp open ipp CUPS 2.1 Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 256 IP addresses (2 hosts up) scanned in 11.65 seconds
这些是有趣的结果。让我们尝试从不同的互联网连接进行相同的操作,以查看这些服务是否暴露于互联网中。如果您有智能手机,相当于您有第二个网络。您可以下载应用程序,还可以为您的 Linux 电脑提供热点。从热点控制面板获取广域网IP地址,然后重试:
1 2 3 4 5 6 7
$ nmap -sV 12.34.56.78
Starting Nmap 7.01 ( https://nmap.org ) at 2018-01-14 17:05 PST Nmap scan report for 12.34.56.78 Host is up (0.0061s latency). All 1000 scanned ports on 12.34.56.78 are closed