home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / infoguide / advanced / security / generic-security-info < prev    next >
Encoding:
Text File  |  1997-12-01  |  16.7 KB  |  361 lines

  1. July 2, 1992
  2.  
  3.                     CERT/CC Generic Security Information
  4.  
  5. The following information can be used in two ways:
  6. 1) To help sites that have, or may have, experienced a break-in.
  7. 2) To help assess the security of sites that have not experienced a break-in.
  8.  
  9. Section A lists several ways to determine if a system has been compromised.
  10. Sections B and C contain lists of vulnerabilities that have been exploited by
  11. intruders on UNIX and VMS systems respectively. Section D describes tools that
  12. can be used to help secure a system.
  13.  
  14. The information in this document can be used to prevent several types of
  15. break-ins.  We encourage system administrators to review all sections of this
  16. document and modify their systems accordingly to close these potential
  17. vulnerabilities. 
  18.  
  19. -------------------------------------------------------------------------------
  20.  
  21. A.  How To Determine If Your System Has Been Compromised
  22.  
  23.     1.  Examine log files such as your 'last' log, process accounting, syslog,
  24.         and C2 security logs for logins from unusual locations or other unusual
  25.         activity.  Note that this is not foolproof; many intruders edit
  26.     accounting files in an attempt to hide their activity.
  27.  
  28.  
  29.     2.  Look everywhere on the system for unusual or hidden files (files that
  30.         start with a period and are normally not shown by ls) as these can be
  31.         used to hide information such as password cracking programs and
  32.         password files from other systems.  A favorite trick on UNIX systems
  33.         is to put a hidden directory in a user's account with an unusual name;
  34.         something like '...' or '..  ' (dot dot space space) or '..^G' (dot
  35.         dot control-G).  Also, files with names such as '.xx' and '.mail' have
  36.         been used.
  37.  
  38.  
  39.     3.  Look for set-uid files everywhere on your system.  Intruders often
  40.         leave set-uid copies of /bin/sh around to allow them root access at a
  41.         later time.  The UNIX find program can be used to hunt for setuid root
  42.         files.  The following example will find setuid root files on the '/'
  43.         (root) partition (Note:  The find command will not follow symbolic
  44.         links):
  45.  
  46.             find / -user root -perm -4000 -print
  47.  
  48.  
  49.     4.  Check your system binaries to make sure that they haven't been changed.
  50.         We've seen intruders change programs on UNIX systems such as login,
  51.         su, telnet, and other critical network and system programs.  On VMS
  52.         systems, we've seen intruders change programs such as loginout.exe and
  53.         show.exe.  Compare the versions on your systems with known good copies
  54.         such as those from your initial installation tapes.  Be careful of
  55.         trusting backups; your backups could also contain Trojan horses.
  56.  
  57.  
  58.     5.  Examine all the files that are run by cron and at.  We've seen
  59.         intruders leave back doors in files run from cron or submitted to at.
  60.         These techniques can let an intruder back on the system even after
  61.         you've kicked him or her off.  Also, verify that all files/programs
  62.         referenced (directly or indirectly) by the cron and at jobs, and the
  63.         job files themselves, are not world-writable.
  64.  
  65.  
  66.     6.    Inspect /etc/inetd.conf for unauthorized additions or changes.  In
  67.         particular, hunt for entries that execute a shell program
  68.         (for example, /bin/sh or /bin/csh) and check all programs that are
  69.         specified in /etc/inetd.conf to verify that they are correct and
  70.         haven't been replaced by Trojan horses.
  71.  
  72.  
  73.     7.  Check your system and network configuration files for unauthorized
  74.         entries.  In particular, look for '+' (plus sign) entries and
  75.         inappropriate non-local host names in /etc/hosts.equiv, /etc/hosts.lpd,
  76.         and in all ~/.rhost files (especially ~root, ~uucp, ~ftp, and other
  77.         system accounts) on the system.  These files should not be
  78.         world-writable.  Furthermore, ensure that these files existed prior to
  79.         any intrusion and have not been created by the intruder.  
  80.  
  81.  
  82.     8.  Examine all machines on the local network when searching for signs of
  83.         intrusion.  In particular, check those hosts that share NIS (yellow
  84.         pages) or NFS mounted partitions, or that are referenced in
  85.         /etc/hosts.equiv files.  Also, check any hosts with which your users
  86.         share .rhost access.
  87.  
  88.  
  89.     9.  Examine the /etc/passwd file on the system and check for any
  90.         additional or modified accounts.  In particular, look for the
  91.         unauthorized creation of new accounts, accounts with no passwords, or
  92.         UID changes to existing accounts.
  93.  
  94.  
  95. B.  UNIX System Configuration Problems That Have Been Exploited
  96.  
  97.     1.  Weak passwords
  98.  
  99.         Intruders often use finger or ruser to discover account names and then
  100.         try simple passwords.  Encourage your users to choose passwords that
  101.         are difficult to guess (for example, words that are not contained in
  102.         any dictionary of words of any language; no proper nouns, including
  103.         names of "famous" real or fictitious characters; no acronyms that are
  104.         common to computer professionals; no simple variations of first or last
  105.         names.  Furthermore, inform your users not to leave any clear text
  106.         username/password information in files on any system. 
  107.  
  108.         A good heuristic for choosing a password is to choose an
  109.         easy-to-remember phrase, such as "By The Dawn's Early Light", and take
  110.         the first letters to form a password.  Insert in some punctuation or
  111.         mixed case letters as well.  For the phrase above, one example password
  112.         might be: bt}DeL{.  (DO NOT use this sample phrase for your password.)
  113.  
  114.         If intruders can get a password file, they will usually take it to
  115.         another machine and run password guessing programs on it.  These
  116.         programs involve large dictionary searches and run quickly even on
  117.         slow machines.  The experience of many sites is that most systems that
  118.         do not put any controls on the types of passwords used probably have
  119.         at least one password that can be easily guessed.
  120.  
  121.         If you believe that your password file may have been taken, change all
  122.         the passwords on the system.  At the very least, you should always
  123.         change all system passwords because an intruder may concentrate on
  124.         those and may be able to guess even a reasonably 'good' password.
  125.  
  126.     Section D details proactive steps that can be taken to ensure that
  127.         users set 'good' passwords and that encrypted passwords are not
  128.         visible to system users.
  129.  
  130.  
  131.     2.  Use of TFTP (Trivial File Transfer Protocol) to steal password 
  132.         files 
  133.  
  134.         To test your system for this vulnerability, connect to your system
  135.         using tftp and try 'get /etc/passwd'.  If you can do this, anyone else
  136.         on the network can probably get your password file.  To avoid this
  137.         problem, either disable tftpd if you don't require it or ensure that
  138.         it is configured with restricted access. 
  139.  
  140.         If you believe your password file may have been taken, the safest
  141.         course is to change all passwords in the system.
  142.  
  143.  
  144.     3.  Accounts without passwords or known passwords (accounts
  145.         with vendor-supplied default passwords are favorites) 
  146.  
  147.         Intruders often exploit system default passwords that have not been
  148.         changed since installation.  Be sure to change all default passwords
  149.         when the software is installed.  Also, be aware that product upgrades
  150.         can quietly change account passwords to a new default.  It is best to
  151.         change the passwords of default accounts after updates are applied.
  152.  
  153.         Scan your password file for extra UID 0 accounts, accounts with no
  154.         password, or new entries in the password file.  Do not allow any
  155.         accounts without passwords.  Remove entries for unused accounts from
  156.         the password file.  To disable an account, change the password field in
  157.         the /etc/passwd file to an asterisk '*', and change the login shell to
  158.         /bin/false to ensure that an intruder cannot login to the account from
  159.         a trusted system on the network.
  160.  
  161.  
  162.     4.  Holes in sendmail
  163.  
  164.         Make sure that you are running the latest sendmail from your vendor.
  165.         BSD 5.65 fixes all known holes.  To establish which version of
  166.         sendmail that you are running, use telnet to connect to the SMTP
  167.         port (25) on your system:
  168.  
  169.             telnet <your hostname> 25
  170.  
  171.  
  172.     5.  Old versions of FTP;  misconfigured anonymous FTP
  173.  
  174.         Make sure that you are running the most recent version of ftpd, which
  175.         is the Berkeley version 5.60 of July 22, 1990.  Check with your vendor
  176.         for information on configuration upgrades.  Also check your anonymous
  177.         FTP configuration.  It is important to follow the instructions provided
  178.         with the operating system to properly configure the files and
  179.         directories available through anonymous FTP (for example, file and
  180.         directory permissions, ownership and group).  Note that you should
  181.         not use your system's standard password file or group file as the
  182.         password file or group file for FTP.  The anonymous FTP root directory
  183.         and its two subdirectories, etc and bin, should not be owned by ftp.
  184.  
  185.  
  186.     6.  Fingerd hole used by the Morris Internet worm
  187.  
  188.         Make sure that you're running a version of finger that is more recent
  189.         than November 1988.  Numerous Berkeley-derived versions of UNIX were
  190.         vulnerable.
  191.         
  192.  
  193.     7.  Inappropriate network configuration file entries
  194.         
  195.         Several vendors supply /etc/hosts.equiv files with a '+' (plus sign)
  196.         entry.  The '+' entry should be removed from this file because it means
  197.         that your system will trust all other systems.  Other files that
  198.         should not contain a '+' entry include /etc/hosts.lpd and all ~/.rhost
  199.         files on the system.  These files should not be world-writable.  We
  200.         recommend that you do not support the following services in your
  201.         /etc/inetd.conf file unless you specifically require them: 
  202.  
  203.             port 11 - systat
  204.         port 69 - tftp
  205.         port 87 - link
  206.  
  207.  
  208.     8.  Misconfiguration of uucp
  209.  
  210.         If your machine supports uucp, check the L.cmds (Permissions) file and
  211.         ensure that only the commands you require are included. This file
  212.         should be owned by root (not by uucp!) and world-readable.  The L.sys
  213.         (Systems) file should be owned by uucp and protected (600) so that
  214.         only programs running setuid uucp can access it.
  215.  
  216.  
  217.     9.  Inappropriate 'secure' settings in /etc/ttys and /etc/ttytab
  218.  
  219.         Check the file /etc/ttys or /etc/ttytab depending on the release of
  220.         UNIX being used.  The default setting should be that no terminal lines,
  221.         pseudo terminals or network terminals are set secure except for the
  222.         console.
  223.  
  224.  
  225.    10.  Inappropriate entries in /usr/lib/aliases
  226.  
  227.         Examine the /usr/lib/aliases (mail alias) file for inappropriate
  228.         entries.  Some alias files include an alias named 'uudecode' or just
  229.         'decode'.  If this alias exists on your system, and you are not
  230.         explicitly using it, then it should be removed.
  231.  
  232.  
  233.    11.  Inappropriate file and directory protections
  234.  
  235.         Check your system documentation to establish the correct file and
  236.         directory protections and ownership for system files and directories.
  237.         In particular, check the '/' (root) and '/etc' directories, and all
  238.         system and network configuration files.  Examine file and directory
  239.         protections before and after installing software or running
  240.         verification utilities.  Such procedures can cause file and directory
  241.         protections to change.
  242.  
  243.  
  244.    12.  Old versions of system software
  245.  
  246.         Older versions of operating systems often have security
  247.         vulnerabilities that are well known to intruders.  To minimize your
  248.         vulnerability to attacks, keep the version of your operating system
  249.         up-to-date and apply security patches appropriate to your system(s) as
  250.         soon as they become available.
  251.  
  252.  
  253. C.  VMS System Vulnerabilities
  254.  
  255.     1.  Accounts with known default passwords
  256.  
  257.         Intruders often exploit system default passwords that have not been
  258.         changed since installation.  Make sure to change all default passwords
  259.         when the software is installed.  Be aware that product upgrades can
  260.         quietly change account passwords to a new default.  It is best to
  261.         change the passwords of default accounts after updates are applied.
  262.         Accounts no longer in use should be removed from the authorization
  263.         file and rights database.  Dormant accounts should be set to DISUSER.
  264.         
  265.         Intruders also try guessing simple user passwords.  See the discussion
  266.         on weak passwords in Section A for suggestions on choosing good
  267.         passwords.  
  268.  
  269.  
  270.     2.  Unauthorized versions of system files
  271.  
  272.         If an intruder gets into a system, the programs patch.exe,
  273.         loginout.exe, and show.exe are often modified.  Compare these programs
  274.         with those found in your distribution media.
  275.  
  276.  
  277. D.  Software Tools To Assist In Securing Your System
  278.  
  279.  *****************************************************************************
  280.  *  The CERT/CC will not formally review, evaluate, or endorse the tools     *
  281.  *  and techniques described.  The decision to use the tools and             *
  282.  *  techniques described is the responsibility of each user or               *
  283.  *  organization, and we encourage each organization to thoroughly evaluate  *
  284.  *  new tools and techniques before installation or use.                     *
  285.  *****************************************************************************
  286.  
  287.     1.  Shadow passwords
  288.  
  289.     If your UNIX system has a shadow password capability, you should
  290.         consider using it.  Under a shadow password system the /etc/passwd
  291.         file does not have encrypted passwords in the password field.  Instead
  292.         the encrypted passwords are held in a shadow file that is not world
  293.         readable.  Consult your system manuals to determine whether a shadow
  294.         password capability is available on your system, and to get details of
  295.         how to set up and manage such a facility.
  296.     
  297.  
  298.     2.  COPS (The Computer Oracle and Password System)
  299.  
  300.         COPS is a publicly available collection of programs that attempt to
  301.         identify security problems in a UNIX system.  COPS does not attempt to
  302.         correct any discrepancies found; it simply produces a report of its
  303.         findings.  COPS was written by Dan Farmer and is available via
  304.         anonymous FTP from the cert.org system (192.88.209.5) in the
  305.         /pub/cops directory and via uucp from uunet.uu.net.
  306.  
  307.     
  308.     3.  passwd+
  309.  
  310.     passwd+ is a replacement program suite that allows a system
  311.         administrator to enforce policies for selecting passwords.  The suite
  312.         also provides a logging capability.  passwd+ was written by Matt
  313.         Bishop and can be obtained by anonymous FTP from the dartmouth.edu
  314.         system (129.170.16.4) in the file /pub/passwd+.tar.Z.  Please read the
  315.         README.IMPORTANT file which accompanies this software distribution.
  316.     
  317.  
  318.     4.  TCP/IP Wrapper Program
  319.  
  320.     This program provides additional network logging information and gives
  321.     a system administrator the ability to deny or allow access from
  322.     certain systems or domains to the host on which the program is
  323.     installed.  ation of this software does not require any modification
  324.     to existing network software or network configuration files.  The
  325.     program was written by Wietse Venema from Eindhoven University of
  326.     Technology in the Netherlands and is available via anonymous FTP from
  327.     the cert.org system (192.88.209.5) in the /pub/tools/tcp_wrapper
  328.     directory.
  329.  
  330.  
  331. -------------------------------------------------------------------------
  332.  
  333. If you believe that your system has been compromised, contact CERT/CC via
  334. telephone or e-mail.
  335.  
  336. Internet E-mail: cert@cert.org
  337. Telephone: 412-268-7090 24-hour hotline:
  338.     CERT/CC personnel answer 7:30a.m. to 6:00p.m. EST(GMT-5)/EDT(GMT-4),
  339.     and are on call for emergencies during other hours.
  340.  
  341. Computer Emergency Response Team/Coordination Center (CERT/CC)
  342. Software Engineering Institute
  343. Carnegie Mellon University
  344. Pittsburgh, PA 15213-3890
  345.  
  346. The CERT/CC issues CERT Advisories, which warn you about problems and inform
  347. you about preventive techniques.  The CERT/CC maintains a CERT Advisory
  348. mailing list, which is also distributed via the USENET newsgroup
  349. comp.security.announce.  If you are unable to receive the newsgroup
  350. comp.security.announce, send mail to:
  351.  
  352.       cert-advisory-request@cert.org
  353.  
  354. to be added to the Advisory mailing list.
  355.  
  356. Past advisories and other computer security related information are available
  357. for anonymous FTP from the cert.org (192.88.209.5) system.
  358.  
  359. Copyright (c) 1991, 1992 Carnegie Mellon University
  360.  
  361.