抓住我的头在这一个…我使用屏蔽,而代理服务器,我只是与Rackspace安装。 这是我的iptablesconfiguration:
*filter # Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT # Accept all established inbound connections -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Allow all outbound traffic - you can modify this to only allow certain traffic -A OUTPUT -j ACCEPT # Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL). -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 ping -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT # Reject all other inbound - default deny unless explicitly allowed policy -A INPUT -j REJECT -A FORWARD -j REJECT COMMIT
我把它保存到一个configuration文件中,并使用iptables-restore进行加载。 这是我的端口扫描是什么样子的:

什么可能导致这种封闭的港口模式?
编辑:iptables -L的输出
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere REJECT all -- anywhere 127.0.0.0/8 reject-with icmp-port-unreachable ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT icmp -- anywhere anywhere icmp echo-request REJECT all -- anywhere anywhere reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-port-unreachable Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere
什么可能导致这种封闭的港口模式?
一个糟糕的扫描仪。 你正在添加一个
-A INPUT -j REJECT
规则这将导致您的主机响应ICMP type 3 / code 3消息( 目标不可达 – 端口不可达 )除了以前接受的端口22,80和443(后者不出现在扫描中)。 这不应该以任何方式导致“隐形”端口。
吉布森不可信 ,其他人也对臭名昭着的“盾牌起来! 几年前 :
GRC的纳米探针“努力地连接()到服务器,然后漫步。 但是,端口testing告诉我,我的HTTP端口已closures。 奇怪。 很奇怪。 看看我从这个连接嗅探的日志显示我的Web服务器响应 – 仍然testing程序报告它被closures。 我重复了基于Windows和Unix的Web服务器的练习,总体命中率不到30%,换句话说,testing程序通常不会检测到我的开放式Web服务器。
看来,有些东西永远不会改变。
作为替代,还原为公开可用的开源工具。 Nmap是一款通用的扫描仪,几乎可以在每月$ 5美元的VPS主机上获得。 如果您只需要偶尔进行扫描,则可以使用Online Domain Tools中的在线nmap服务。