我继承了一个小型网络,目前正在评估其安全性能。
我开始在那个小型网络中对主机进行端口扫描(我们称之为Weirdo),从我的角度来看,似乎该特定主机具有某种端口扫描检测器和/或扫描结果混淆器,并且iptables正在进行,因为结果来了从密集扫描回来的结果与快速扫描的结果大不相同。
所以这里是快速扫描结果me@mypc:~# nmap -T4 -F 12.34.56.78
:
Starting Nmap 7.01 ( https://nmap.org ) at 2017-04-18 11:48 CEST
Nmap scan report for 12.34.56.78
Host is up (0.57s latency).
Not shown: 93 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
3306/tcp open mysql
8080/tcp open http-proxy
8443/tcp open https-alt
Nmap done: 1 IP address (1 host up) scanned in 4.15 seconds
这实际上显示了与从 Weirdo localhost 运行快速扫描相同的输出root@Weirdo:~# nmap -T4 -F localhost
。
但这是激烈的扫描me@mypc:~# nmap -T4 -A -v 12.34.56.78
:
1/tcp open tcpmux?
...(every port is shown as open, except a few)
49155/tcp open unknown
...
9102/tcp open jetdirect?
...
65389/tcp open tcpwrapped
...
Completed SYN Stealth Scan at 11:49, 18.22s elapsed (1000 total ports)
...
Not shown: 120 closed ports
注意:...
表示以不同的端口号重复上一行
所以基本上密集扫描发现更多的端口是开放的,但这是矛盾的,因为在 Weirdo localhost 上的密集扫描root@Weirdo:~# nmap -T4 -A -v localhost
也给出了与快速扫描完全相同的开放端口列表。
当我查看traceroute时,我看到以下内容:
TRACEROUTE (using port 199/tcp)
HOP RTT ADDRESS
1 1.52 ms 12.99.34.255
2 1.37 ms 12.99.0.3
3 1.09 ms 12.34.56.78
端口扫描两个ipme@mypc:~# nmap -sV -T4 -O -F --version-light 12.99.34.255 12.99.0.3
我看到这12.99.34.255
是一个可以通过浏览器访问的 Netgear Firewall FVS336Gv2(端口 80,因此是打开的)。
连续(1 秒后)快速扫描(密集扫描之后)确实会产生与密集扫描相同的输出。
等待几秒钟然后再次进行快速扫描后,它会产生与初始快速扫描相同的输出。
这个防火墙可能在密集扫描上玩花样吗?
另一个小补充:
在Weirdo主机上,我检查了 iptables 防火墙并得到以下信息:
root@Weirdo:~# iptables -vL -t filter
Chain INPUT (policy DROP 25288 packets, 1768K bytes)
pkts bytes target prot opt in out source destination
101K 54M ACCEPT all -- lo any anywhere anywhere
189K 12M ACCEPT all -- eth1 any anywhere anywhere
285 9686 ACCEPT icmp -- eth0 any anywhere anywhere icmp echo-request
297 30354 garbage all -- eth0 any anywhere anywhere state INVALID
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: FIN,SYN,RST,PSH,ACK,URG/NONE
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: FIN,SYN/FIN,SYN
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: SYN,RST/SYN,RST
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: FIN,RST/FIN,RST
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: FIN,ACK/FIN
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: PSH,ACK/PSH
0 0 garbage tcp -- eth0 any anywhere anywhere tcpflags: ACK,URG/URG
1968K 2742M ACCEPT all -- eth0 any anywhere anywhere state RELATED,ESTABLISHED
9564 391K ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:http
463 27508 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:domain
45 2392 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:8443
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:9422
25288 1768K garbage all -- eth0 any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1361K packets, 501M bytes)
pkts bytes target prot opt in out source destination
Chain garbage (9 references)
pkts bytes target prot opt in out source destination
这些过滤器是否在密集扫描中发挥作用?
有一个带有 target 的规则是什么意思garbage
?