First program.c
#include #include #include #include int main() { setuid( 0 ); system( "<program>" ); return 0; }Then in the shell enter the following commands:
$ gcc -o program program.c $ sudo chown root program $ sudo u+s programThen you can execute program to execute your program under root privilege!
沒有留言:
張貼留言