我运行我自己的(基于 Ubuntu 的)路由器,并iptables
配置为默认丢弃所有传入的数据包。令我惊讶的是,运行nmap
扫描(从 WAN 端)显示两个与 VOIP 相关的开放端口:
nmap -Pn -v --reason XXX.net
Starting Nmap 7.60 ( https://nmap.org ) at 2018-03-28 09:52 CEST
Initiating Parallel DNS resolution of 1 host. at 09:52
Completed Parallel DNS resolution of 1 host. at 09:52, 0.09s elapsed
Initiating Connect Scan at 09:52
Scanning XXX.net (XXX.XXX.XXX.XXX) [1000 ports]
Discovered open port 21/tcp on XXX.XXX.XXX.XXX
Discovered open port 22/tcp on XXX.XXX.XXX.XXX
Discovered open port 5060/tcp on XXX.XXX.XXX.XXX
Discovered open port 2000/tcp on XXX.XXX.XXX.XXX
Completed Connect Scan at 09:52, 5.17s elapsed (1000 total ports)
Nmap scan report for XXX.net (XXX.XXX.XXX.XXX)
Host is up, received user-set (0.035s latency).
Not shown: 995 filtered ports
Reason: 995 no-responses
PORT STATE SERVICE REASON
21/tcp open ftp syn-ack ttl 52
22/tcp open ssh syn-ack ttl 54
113/tcp closed ident reset ttl 254
2000/tcp open cisco-sccp syn-ack ttl 61
5060/tcp open sip syn-ack ttl 61
Read data files from: /usr/local/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 5.33 seconds
ftp
并且ssh
是正确的,因为这两个服务是在路由器上配置的。但是cisco-sccp
,sip
开放对我来说是个新闻。
实际上,telnet
连接到两个端口都是成功的:
telnet XXX.net 2000
Trying XXX.XXX.XXX.XXX...
Connected to XXX.net.
Escape character is '^]'.
telnet XXX.net 5060
Trying XXX.XXX.XXX.XXX...
Connected to XXX.net.
Escape character is '^]'.
但是netstat -talpn
在会话处于活动状态时在路由器上运行telnet
显示没有为任一端口建立连接。日志显示iptables
丢弃数据包:
Mar 27 20:52:16 router DROP INPUT IN=ppp0 OUT= MAC=MM:MM:MM:M SRC=YYY.YYY.YYY.YYY DST=XXX.XXX.XXX.XXX LEN=60 TOS=00 PREC=0x00 TTL=51 ID=39215 DF PROTO=TCP SPT=52200 DPT=2000 SEQ=106277563 ACK=0 WINDOW=42340 SYN URGP=0 MARK=0
从哪里连接YYY.YYY.YYY.YYY
的IP telnet
。
我的诊断正确吗?
telnet
如果是,即使数据包在路由器处丢弃,如何建立连接?谁在监听 2000 和 5060 端口?