
當我nmap <host>
在我的伺服器上運行時,它說以下連接埠已打開,但我的 iptables 沒有明確允許它們的規則。
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
它也是一個運行 postfix 郵件伺服器的 Debian Web 伺服器。
我沒有在 iptables 中看到任何允許這些連接埠的具體內容。
*nat
# Allow openvpn connections (nat)
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
COMMIT
*filter
# This will allow all loopback (lo0) traffic and drop all traffic to 127/8
# that does not use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# This accepts all already established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# This allows all outbound traffic
-A OUTPUT -j ACCEPT
# This will allow HTTP and HTTPS connections from anywhere, this are the normal
# ports used for a web server
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH connections
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
# Allow bittorrent/rtorrent ports, from ~/.rtorrent.rc
-A INPUT -p tcp --dport 8071:8079 -j ACCEPT
-A INPUT -p udp --dport 6881 -j ACCEPT
# Allow tor (the onion router) connections for relay node
-A INPUT -p tcp --dport 9001 -j ACCEPT
-A INPUT -p tcp --dport 9030 -j ACCEPT
# Allow mx connections
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
# Allow ICMP ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
# Allow openvpn connections
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 10.8.0.0/24 -j ACCEPT
-A INPUT -p udp --dport 53 -j ACCEPT
-A INPUT -p tcp --dport 53 -j ACCEPT
-A INPUT -p udp --dport 1194 -j ACCEPT
-A INPUT -p tcp --dport 1194 -j ACCEPT
# Keep this last line
# Reject all other inbound traffic
-A INPUT -j REJECT
-A FORWARD -j REJECT
COMMIT
如果我的 iptables.rules 檔案不允許它們,如何掃描它們?我正在運行這些服務嗎?我該如何阻止他們?
答案1
您的網際網路服務供應商正在過濾這些連接埠上的出站流量。這在住宅網路連線中很常見。此封鎖會影響 Windows NetBIOS 和 CIFS 流量,旨在阻止客戶瀏覽其(安全性較差的)鄰居電腦上的檔案。