linux – 黑客绕过iptables
(从SO移动)
我有iptables保护sip服务器.除了我专门打开的IP之外,它会阻止所有IP,它似乎适用于几乎所有人.我已经测试了许多未列入白名单的IP地址,但它们都应该被丢弃. 但是,我找到了一个似乎能够绕过iptables规则的“黑客”.他的探测邀请通过,我不知道如何,或甚至可能. 10年后我才见过这个. 我想它一定是我做过的事情,但我看不到它. 像这样创建的iptables(MYIP在顶部定义 – 编辑): iptables -F iptables -X iptables -N ALLOWEDSIP iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -p tcp -d $MYIP --dport 22 -j ACCEPT iptables -t filter -A INPUT -j ALLOWEDSIP # This is my white list. iptables -A ALLOWEDSIP -j RETURN 现在,在ALLOWEDSIP中只有NOTHING,我所能做的就是使用SSH(我可以).如果我向它发出电话,他们都会掉线.但wireshark告诉我这个(我的ip编辑): 89.163.146.25 -> x.x.x.x SIP/SDP 805 Request: INVITE sip:521088972597572280@x.x.x.x | x.x.x.x -> 89.163.146.25 SIP 417 Status: 100 Giving a try | x.x.x.x -> 89.163.146.25 SIP 875 Status: 407 Proxy Authentication Required | 他的电话打到我的开关,虽然最终被ACL拒绝,但他们应该永远不会到达那里.没有别的东西可以通过.拉出我的头发.谁知道? 只是为了完整性,这是iptables -L的结果: # iptables -L --line-numbers -v Chain INPUT (policy DROP 0 packets,0 bytes) num pkts bytes target prot opt in out source destination 1 10 640 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED 2 0 0 ACCEPT all -- lo any anywhere anywhere 3 0 0 ACCEPT tcp -- any any anywhere <redacted>.com tcp dpt:6928 4 0 0 ALLOWEDSIP all -- any any anywhere anywhere Chain FORWARD (policy DROP 0 packets,0 bytes) num pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6 packets,544 bytes) num pkts bytes target prot opt in out source destination Chain ALLOWEDSIP (1 references) num pkts bytes target prot opt in out source destination 1 0 0 RETURN all -- any any anywhere anywhere 编辑: 89.163.146.25 -> <redacted> RTCP 806 Source port: tag-pm Destination port: sip 编辑2: 编辑3: 解决方法
你可以nullroute.这应该绕过iptables.
route add 89.163.146.25 gw 127.0.0.1 lo 核实 netstat -nr 要么 route -n (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |