home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / securesu.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  28.6 KB  |  692 lines

  1. My appologies for taking so long with this it became much larger than
  2. I'd though it would.   
  3. Please Note:
  4.    1) My intent in this was to limit my audience enough so that 
  5.       this document would not become too large and cumbersome.  
  6.       Please note the intended audience.   
  7.    2) This document is sure to undergo revision, and I hesitate to 
  8.       ever call any revision a final draft.
  9.    3) Please forgive any typo's and gramatical errors.  It's late 
  10.       and I wanted to get this out on a day other than Friday.  
  11.       Send me notes of typos and spelling directly don't bother
  12.       the rest of the net with such.
  13.    4) I'll try to post when I'm able to put this list up on our 
  14.       ftp server ftp.Hawaii.Edu:/pub/security.
  15.    
  16. Again many thanks to all those who provided feedback.
  17.  
  18. I'm not sure where the other lists are but here's what I've got,
  19. please let me know if it's of help:
  20.  
  21. ----------------------------------------------------------------------
  22.  
  23.  
  24. How to improve security on a newly installed SunOS 4.1.3 system. 
  25.  
  26.        Version 1.0        Thomas M. Kroeger   - July 94
  27.                 tmk@hawaii.edu
  28.  
  29. Copyright -- Thomas M. Kroeger   - July 94
  30.    Please feel free to redistribute or include this list or parts of it
  31. wherever you desire, but, please include appropriate citation.
  32.  
  33. Goal -   
  34.    Attempt to provide a list of some of the more basic steps that 
  35. can be done to improve security on a newly installed SunOS 4.1.3 system.
  36. This is by no means an all inclusive list of actions, just a list of 
  37. some simple and more common measures.  
  38.  
  39. Intended Audience -
  40.    Anyone responsible for the system administration duties of a machine
  41. running SunOS 4.1.3.  These recommendations applicable to a stand-alone  *
  42. workstation. It is assumed that the reader has some familiarity with basic 
  43. system administration (you should be able to do a basic system installation 
  44. by yourself, install patches, and use an editor).
  45.  
  46. [* which may be connected to a larger network?]
  47.  
  48.   NOTE: This list limits it's coverage to measures that can
  49. be done for a stand-alone workstation addition to the steps listed here 
  50. there are many measures that can be taken to improve the security of 
  51. an enviornment, measures such as; filtering traffic to  port 2049/udp 
  52. at the routers will prevent NFS calls from outside your domain.
  53.  
  54.  
  55. Disclaimer ---
  56. These recommendations come with no guarantees of anything!  Support is only
  57. offered within the University of Hawai'i community.
  58.  
  59. The truly paranoid may wish to these implement these recommendations while in 
  60. single user mode as an extra measure of security to avoid possible subversive
  61. shenannigans by a wily cracker.
  62.  
  63.  
  64. To Do on a system Just installed
  65. ------------------------------
  66.  
  67. Patches --
  68. + install the following patches
  69.  
  70. 4.1.3 Security listing
  71.    100103    SunOS 4.1;4.1.1;4.1.2;4.1.3: script to change file permissions
  72.    100173    SunOS 4.1.1/4.1.2/4.1.3 : NFS Jumbo Patch
  73. *  100224    SunOS 4.1.1,4.1.2,4.1.3: /bin/mail jumbo patch
  74.    100257    SunOS 4.1.1;4.1.2;4.1.3: jumbo patch for ld.so, ldd, and ldconf
  75.    100272    SunOS 4.1.3: Security update for in.comsat.
  76.    100296    SunOS 4.1.1, 4.1.2, 4.1.3: netgroup exports to world
  77.    100305    SunOS 4.1.1, 4.1.2, 4.1.3: lpr Jumbo Patch
  78.    100372    SunOS 4.1.1;4.1.2;4.1.3: tfs and c2 do not work together
  79. *  100377    SunOS 4.1.1, 4.1.2, 4.1.3: sendmail jumbo patch
  80. *  100383    SunOS 4.0.3;4.1;4.1.1;4.1.2;4.1.3: rdist security and hard link
  81.    100448    OpenWindows 3.0: loadmodule is a security hole.
  82.    100452    OpenWindows 3.0: XView 3.0 Jumbo Patch
  83.    100478    OpenWindows 3.0: xlock crashes leaving system open
  84. *  100482    SunOS 4.1;4.1.1;4.1.2;4.1.3: ypserv and ypxfrd fix, plus DNS fi
  85.    100507    SunOS 4.1.1, 4.1.2, 4.1.3: tmpfs jumbo patch
  86.    100513    SunOS 4.1.1;4.1.2;4.1.3: Jumbo tty patch
  87.    100564    SunOS 4.1.2, 4.1.3: C2 Jumbo patch
  88. *  100593    SunOS 4.1.3: Security update for dump.
  89.    100623    SunOS 4.1.2;4.1.3: UFS jumbo patch
  90.    100630    SunOS 4.1.1, 4.1.2, 4.1.3: SECURITY: methods to exploit login/su
  91.    100631    SunOS  4.1.x: env variables can be used to exploit login(US only)
  92. *  100632    SunSHIELD 1.0: ARM jumbo patch release
  93.    100890    SunOS 4.1.3: domestic libc jumbo patch
  94.    100891    SunOS 4.1.3: international libc jumbo patch
  95.    100909    SunOS 4.1.1;4.1.2;4.1.3: Security update for syslogd.
  96.    101072    SunOS 4.1.1;4.1.2;4.1.3: Non-related data filled the last block
  97.    101080    SunOS 4.1.1 4.1.2 4.1.3: security problem with expreserve
  98.    101200    SunOS 4.1.1, 4.1.2, 4.1.3: Breach of security using modload
  99.    101206    ODS 1.0; NFS/fsirand security fix.
  100. *  101480    SunOS 4.1.1;4.1.2;4.1.3: Security update for in.talkd.
  101. *  101482    SunOS 4.1.3, 4.1.2, 4.1.1: Security update for write.
  102.    101640    SunOS 4.1.3: in.ftpd logs password info when -d option is used.
  103.    101710    ONLINE DISKSUITE (ODS) 1.0: Security update for dump.
  104.  
  105. 4.1.3 U1 security listing
  106.    101434    SunOS 4.1.3_U1: lpr Jumbo Patch
  107. *  101435    SunOS 4.1.3_U1: ypserv fix
  108. *  101436    SunOS 4.1.3_U1: bin/mail jumbo patch
  109.    101440    SunOS 4.1.3_U1: security problem: methods to exploit login/su
  110.    101558    SunOS 4.1.3_U1: international libc jumbo patch
  111. *  101579    SunOS 4.1.3_U1: Security problem with expreserve for Solaris 1.
  112.    101587    SunOS 4.1.3_U1: security patch for mfree and icmp redirect
  113.    101590    ONLINE DISKSUITE (ODS) 1.0, NFS/fsirand security fix
  114.    101621    SunOS 4.1.3_U1: Jumbo tty patch
  115. *  101665    SunOS 4.1.3_U1: sendmail jumbo patch
  116.    101679    SunOS 4.1.3_U1: Breach of security using modload
  117.    101759    SunOS 4.1.3_U1: domestic libc jumbo patch
  118.  
  119.    * - Note: some patches may not be required if you are disabling this
  120.    feature.  If this is the case, ensure that all relevant files have had 
  121.    their mode changed to remove the SUID bit  -- chmod u-s <file>.
  122.  
  123.    Note 2: Some patches may not necessarily apply based on packages 
  124.    installed (US Encryption...) or your configuration.  Please carefully 
  125.    check the README for each patch.
  126.    Patches are available via anonymous ftp from 
  127.                                      ftp.uu.net:/system/sun/sun-dist
  128.  
  129. Network level changes -------
  130.  
  131. + Disable source routing
  132.   Why:
  133.    Source routing enables the originating host to dictate the route the 
  134.    packet will take.   This can be used to spoof a system into believing
  135.    that the packets are coming from a trusted source.
  136.   How: 
  137.    Install patch found in Ref. 19
  138.   More info: Ref. 2 [Cheswick 94] Chap 2, Ref. 19
  139.  
  140. + Comment out all unnecessary services in /etc/inetd.conf
  141.   Why:
  142.    RPC services can be used to gain access as well as information about
  143.    a system.  These are very site specific adjustments and will have to
  144.    be tailored to your needs.  Additionally, TCP wrappers [Ref. 4] can be 
  145.    used to improve loging, prevent IP spoofing (one host pretending to be 
  146.    another to gain access) and limit access to a service as well as 
  147.    totally removing it.
  148.   How:
  149.    Edit file /etc/inetd.conf and put a # in front of services that
  150.    are not needed.
  151.  
  152.      Services possibly needed, but probably desired:
  153.     ftp - possible needed for file transfer, however if all you 
  154.           want is outgoing ftp then this is can be commented out.
  155.     telnet - obvious (recommend restricting with TCP wrappers Ref. 4)
  156.     finger - Possibly but better to get a modified version that doesn't
  157.          give up that much information (To be honest I have no
  158.                  experience with any of these I'd recommend checking into
  159.                  some of the ones on ftp.uu.net).
  160.     talk - nice to have but how much will you miss it?
  161.  
  162.      Services which are probably unnecessary - see man pages for details
  163.     name - for name services (man tnamed)
  164.     comsat - for mail - not necessary.
  165.     login - for rlogin - please see discussion under ruserok().
  166.     uucp - if you aren't sure if your using this then you are not.
  167.     exec - services for rexecd  - do without.
  168.  
  169.       Services recommended against - FIND A WAY TO LIVE WITHOUT.
  170.     shell - for rsh -- major source for security problems
  171.     tftp -  only needed for support of an X terminal or diskless
  172.                 clients, doubtfully needed on a desktop machine.
  173.   More info: Ref. 4 [Venema 92]., Ref. 15
  174.  
  175.  
  176. + Enable NFS port monitoring (This is of value only if you are exporting 
  177.     filesystems over NFS)
  178.   Why:
  179.    Port monitoring ensures that calls to NFS to mount a file system come
  180.    from a port < 1024  (in other words, a port that requires root 
  181.    access to use).
  182.   How:
  183.    The default /etc/rc.local sets up port monitoring only if the file
  184.    /etc/security/passwd.adjunct exists.  If you will be implementing 
  185.    shadowing then you can skip over this step.  If you will not be
  186.    implementing shadowing and you will be exporting files then you should 
  187.    modify /etc/rc.local to do the following 2 lines: (regardless of 
  188.    whether the passwd.adjunct file exists):
  189.        echo "nfs_portmon/W1" | adb -w /vmunix /dev/kmem > /dev/null 2>&1
  190.        rpc.mountd
  191.  
  192.    Shadowing is covered under the section Changes to ID Management.
  193.  
  194.    Note: one possible side effect: non-sun nfs client might not 
  195.           be able to mount exported files.
  196.   More info: Ref. 3 [Stern 92] pg 177 & mountd(8C)
  197.  
  198. + Ensure that ypbind is started with the -s option.
  199.   Why:
  200.    Users could easily start thier own ypbind services and activate a 
  201.    phony NIS database giving them access as any user.
  202.   How:
  203.    As with port monitoring the default /etc/rc.local sets up ypbind in the
  204.    secure mode (-s option) only if the file /etc/security/passwd.adjunct 
  205.    exists.  If you will be implementing shadowing then you can skip over
  206.    this step, overwise you should modify /etc/rc.local to start ypbind 
  207.    with the -s option regardless of whether the passwd.adjunct file exists.
  208.   More info: ypbind(8)
  209.  
  210. + Disable IP forwarding -  
  211.   Why:
  212.    I'm not sure if this can be abused on a machine with only one interface
  213.    but I'd rather err of the side of safety.  It could be used to spoof
  214.    an IP address.
  215.   How:
  216.    Install the following line in the kernel configuration file:
  217.        options "IPFORWARDING=-1"
  218.    For info on how to custom configure a kernel, see the file
  219.    /usr/sys/`arch`/conf/README.
  220.  
  221.  
  222. Kernel changes  -------
  223.  
  224. + modify ruserok() in /usr/lib/libc.so.1.8 (9 on 4.1.3 U1) to disable:  
  225.             -  root .rhosts authentication, wildcards in .rhosts, or
  226.               .rhosts entirely depending on the level of security you want.
  227.   Why: 
  228.    ruserok() is a library routine that does the checking of both the 
  229.    .rhosts and /etc/hosts.equiv files for all the r commands. 
  230.     a) ruserok() uses the source IP address in the rpc request for 
  231.    authentication.  There are no guarantees that this address is correct.
  232.    This address can easily be spoofed, yielding illegitimate access to 
  233.    a system.  
  234.     b) Crackers will often insert +'s into users' .rhosts file
  235.    to allow them to gain access at a latter date.  Most users 
  236.    don't look at their .rhosts file too often.
  237.    Note: While using .rhosts prevents crackers from sniffing your users' 
  238.    passwords, it also make them vulnerable to IP spoofing (claiming
  239.    to be a host that you're not) it becomes a matter of preference
  240.    what level of protection you'd choose here.  
  241.      
  242.   How:  
  243.    To modify the source code requires a source code license.
  244.    At Univ of Hawaii,  modified version of libc.so.1.8 should be 
  245.    available though the systems group.
  246.  
  247.    For those who wish to create thier own modified version of ruserok()
  248.    please see the section at the end that describes some of the details
  249.    for creating a custom libc.so.   
  250.  
  251.    Additionally the logdaemon package Ref. 15 has a modified version
  252.    of libc.so that helps with this.  This site also has BSD sources
  253.    for the ruserok() routine.
  254.  
  255.    Finally TCP wrappers can also be used to restrict access to each
  256.    individual r command. Ref. 4
  257.  
  258.   More info: ruserok(3), hosts.equiv(5),
  259.               source code file /lib/libc/net/rcmd.c, Ref. 4, Ref. 15
  260.  
  261.  
  262.  
  263. Filesystem change----------
  264.  
  265. + create the file /etc/ftpusers 
  266.   Why: 
  267.    This file is a list of users that will not be allowed to access the
  268.    system via ftp.  This prevents Joe Cracker from using ftp to
  269.    modify a file (such as /etc/passwd) if he is able to determine your 
  270.    root password.   
  271.   How: 
  272.    create the file /etc/ftpuser with the following entries (one per line):
  273.     root, nobody, daemon, sys, bin, uucp, news, ingres, AUpwdauthd,
  274.     AUyppasswdd, sysdiag, sundiag, and any other ID's that exist that
  275.     you don't want to allow ftp access.
  276.  
  277.   More info: man ftpusers(5)
  278.  
  279. + Remove the + in /etc/hosts.equiv
  280.   Why: 
  281.    Well..... Everyone gains access with this. 
  282.    Note: This file should not have any comment lines. 
  283.   More info: hosts.equiv(5)
  284.  
  285. + edit /etc/exports  remove all entries you don't want exported.
  286.    - ensure whatever entries remain have restricted access
  287.   Why: 
  288.    NFS leaves the normal file system protection up to the client 
  289.    instead of the server.  Acracker with root access on a client can 
  290.    work around many of these protections. As a result filesystems 
  291.    exported to the world are particularly vulnerable.
  292.   How: 
  293.    Edit the file /etc/exports
  294.    1) Only export what you need to export. If you aren't certain that 
  295.       it needs to be exported, then it probably doesn't.
  296.    2) Never export to the world.  Use a -access=host.foo.bar.edu option.
  297.    3) When ever possible export the file systems read-only. option ro
  298.    You can use showmount -e to see what you currently have exported.
  299.  
  300.   More info: exports(5), exportfs(8), showmount(8) 
  301.  
  302. + Install random number inode generator on filesystems fsirand
  303.   Why:
  304.    Predicable root handles assists crackers in abusing NFS.  After 
  305.    installing the patch for fsirand you'll need to run fsirand for
  306.    all your filesystems.
  307.   How:
  308.    Ensure the filesystem is unmounted and run fsirand.     
  309.   More info: fsirand(8), SunOS patch 100173 (NFS Jumbo)
  310.  
  311. + nosuid in mounts
  312.    Why:
  313.     Use the nosuid option when adding entries to /etc/fstab to mount a 
  314.     filesystem exported by another host.  Anyone gaining access to the
  315.     other host can create or modify an existing program which could 
  316.     compromise your system.   Note: this doesn't work on tmpfs filesystems.
  317.    How: 
  318.     Include the nosuid when you add an entry to /etc/fstab to import 
  319.     a filesystem.
  320.    More info: Ref. 3 [Stern 92] pg. 175 fstab(5)
  321.  
  322. + Edit /etc/ttytab to remove the secure option from all entries.
  323.   Why:
  324.    The secure entry in /etc/ttytab allows logins directly to root on that
  325.    tty.   If you feel that your machine is not in a physically secure 
  326.    location, you may choose to remove the secure option from the 
  327.    console as well.
  328.   More info: ttytab(5)
  329.  
  330. + Set eeprom secure field to command or full -
  331.   Why: 
  332.    If you feel that your machine is not in a secure location, then 
  333.    the eeprom field secure can be used to prevent unauthorized root 
  334.    access by crashing your machine.   Note: with the full option the 
  335.    system will not auto-reboot and will wait for the root password to 
  336.    be entered.
  337.   More info: eeprom(8)
  338.  
  339. + chmod 600 /dev/eeprom -
  340.   Why:
  341.    Prevents users from reading the eeprom passwd.
  342.   More info: eeprom(8)
  343.  
  344. + Remove openprom support if you do not intend to use the eeprom 
  345.    secure field.
  346.   Why:
  347.    A cracker who gains root access could install an eeprom password and
  348.    make your life a bit harder.
  349.   How:
  350.    Remove the device driver from the kernel by commenting out
  351.    the following:
  352.   
  353.    # The "open EEPROM" pseudo-device is required to support the
  354.    # eeprom command.
  355.    #
  356.    pseudo-device   openeepr        # onboard configuration NVRAM
  357.   More info: eeprom(8)
  358.  
  359. + Uncomment security options in frame buffer table file /etc/fbtab
  360.   Why:
  361.    Without these entries ownership of console devices will not be properly
  362.    set.
  363.   More info: fbtab(5)
  364.  
  365. + add umask 022 to /etc/rc & /.login
  366.   Why:
  367.    Prevent key files created during startup and root operation from
  368.    being created world writeable.  Note you may want to set umask in 
  369.    /.login to 077 instead of 022
  370.   More info: umask(1), rc(8)
  371.  
  372. + chmod go-w /etc/* ; chmod g+w /etc/dumpdates
  373.   Why:
  374.    None of these file in /etc should require write access 
  375.    by world except for dumpdate, which requires group write access.
  376.   More info: chmod(1), aliases(5), state(5), utmp(5V), remote(5), rmtab(5)
  377.  
  378. + edit /etc/rc.local to comment change part that chmod's 666 motd
  379.   Why: 
  380.    /etc/motd is the normal system's message of the day; it won't
  381.    allow people to gain root access, but it could be a nuisance if they
  382.    can change this anonymously.  Additionally it is important to
  383.    ensure that the line "rm -f /tmp/t1" is at the begining of this part.
  384.  
  385. + Chmod u-s the following files unless you specifically use them:
  386.   Why: 
  387.    Changing the modes for those file which you will not be using 
  388.    helps prevent would be crackers from exploiting unknown security 
  389.    flaws in these files which could be used to compromise your system.
  390.  
  391.     /usr/bin/cu     /usr/bin/tip         /usr/bin/fusage     
  392.     /usr/bin/nsquery     /usr/bin/uucp         /usr/bin/uuname 
  393.     /usr/bin/uustat     /usr/bin/uux         /usr/ucb/rcp 
  394.     /usr/ucb/rdist     /usr/ucb/rlogin     /usr/lib/uucp/uusched
  395.     /usr/lib/uucp/uuxqt /usr/ucb/rsh        /usr/lib/uucp/uucico 
  396.     /usr/games/hack     /usr/games/chesstool     /usr/games/fortune 
  397.     /usr/lib/exrecover  /usr/games/robots       /usr/lib/uucp/remote.unknown
  398.     /usr/games/hack     /usr/games/snake    /usr/bin/sunview1/sv_release 
  399.     /usr/etc/rfsetup
  400.     /usr/bin/allocate - used with C2 security.
  401.     /usr/ucb/quota - used with disk quotas
  402.     /usr/lib/expreserve - used to recover edit session that died.
  403.  
  404.     Following may only be needed to be run by user root; as such, they would
  405.     not need to be SUID root:
  406.      /usr/etc/shutdown /usr/lib/acct/accton
  407.  
  408.    More info:  lots of man pages ;-)
  409.  
  410. + chmod g-s the following file unless you specifically use them:
  411.  Why:
  412.    Changing the modes for those file which you will not be using helps 
  413.    prevent would be crackers from exploiting unknown security flaws 
  414.    in these files which could be used to compromise your system.
  415.  
  416.     /usr/bin/wall     /usr/etc/trpt        /usr/bin/sunview1/toolplaces 
  417.     /usr/bin/iostat     /usr/bin/ipcs         /usr/ucb/vmstat 
  418.     /usr/ucb/netstat     /usr/etc/arp         /usr/etc/dmesg 
  419.     /usr/etc/dkinfo     /usr/etc/chill         /usr/etc/dumpfs 
  420.     /usr/etc/devinfo     /usr/etc/nfsstat     /usr/old/perfmon 
  421.     /openwin/bin/xload     /usr/kvm/pstat         /usr/kvm/crash 
  422.     /usr/kvm/getcons     /usr/etc/kgmon         /usr/etc/trpt
  423.  
  424.    More info:  lots of man pages ;-)
  425.  
  426. + edit syslog.conf -- uncomment auth & mail lines
  427.   Why: 
  428.    The enables improved loging of logins and su's be prepared for lots of 
  429.    data.
  430.   More info: syslog.conf(5)
  431.  
  432. + chmod 640 /vmunix; chgrp kmem /vmunix ;
  433.   Why: 
  434.    Prevent crackers from finding out more about your kernel configuration.
  435.   
  436.  
  437. Changes to ID management ------
  438.  
  439. + Disable SUID passwd (if using NIS) or -F option in /bin/passwd  
  440.   Why: 
  441.    Here two options exist:
  442.    1) you are using NIS for your user database; so you don't need
  443.    /bin/passwd (and the two hard links to it /bin/chfn & /bin/chsh) 
  444.    to be SUID root.
  445.    2) You will have local entries in your /etc/passwd that you would
  446.    like to be able to change thier own passwd. Then please note that 
  447.    /bin/passwd has a race condition that can be exploited to write to
  448.    files as root, allowing a cracker to gain root access.  
  449.  
  450.    In either case yppasswd (and ypchfn & ypchsh) does not need to 
  451.    be SUID root.
  452.   How:
  453.    In all cases - cd /bin; chmod u-s yppasswd ypchfn ypchsh
  454.    Option 1  - cd /bin; chmod u-s passwd chfn chsh 
  455.    Option 2a - Replace passwd with a proactive (check for bad passwds)
  456.               passwd program.  Ref 7. 
  457.    Option 2b - Do a binary edit of passwd (sun's code) as shown below:
  458.         # cd /bin
  459.         # cp passwd passwd.old; chmod 700 passwd.old
  460.         # adb -w - passwd
  461.         not core file = passwd
  462.         /l 'F:'
  463.         0x68de        This address is required in the following step:
  464.         0x68de/w 0
  465.         0x68de:         0x463a  =       0x0
  466.         <CTRL-D>
  467.        # chmod 4711 /bin/passwd
  468.        Note: The following files should all contain the same code, and
  469.              be SUID root (unless chmod u-s was done above).  If you intend 
  470.              to use any of these, ensure they are a link to the modified 
  471.              file /bin/passwd: yppasswd, ypchfn, ypchsh, chfn, chsh.
  472.   More info: Ref. 6 [8lgm]-Advisory-7.UNIX.passwd.11-May-1994.NEWFIX
  473.  
  474. + remove ID sync:::
  475.   Why: 
  476.    This ID is created to enable the admin to sync the file system before a
  477.    system crash.  It defaults without and password, and can be abused to 
  478.    gain access to the system.  The simplest solution is to live without 
  479.    this feature and remove this ID.
  480.   More info: passwd(5)
  481.  
  482. + Implement shadowing
  483.   Why: 
  484.    To restrict access to all users' encrypted passwords.  Even though 
  485.    passwords are encrypted, Crack (a publicly available program) can 
  486.    be used to effectively guess users' passwords.
  487.   How:
  488.    This can be done two different ways:
  489.     1. by implementing Sun's C2 security package, which 
  490.    provides additional auditing.  I've found that this auditing can be
  491.    troublesome to maintain and I didn't have need for the extensive data.
  492.     2. the second option is to implement shadowing but not C2, this
  493.    procedure is fully explained in detail in Ref. 5.  In short:
  494.        - ensure patch 100564 is installed, (note this also implements 
  495.          securenets for NIS)
  496.        - split /etc/passwd into /etc/passwd & /etc/security/passwd.adjunct
  497.        - split /etc/group into /etc/group & /etc/security/group.adjunct
  498.        - add required Audit users (even if not implementing auditing)
  499.        - comment out the part of rc.local that starts audit
  500.        - reboot.
  501.    The existence of the file /etc/security/passwd.adjunct has several
  502.    other effects in rc.local that improve system security; (ypbind -s 
  503.    and rpc.mountd without -n).
  504.   More info: Ref 5 
  505.  
  506. + ensure all ID's have passwd
  507.   Why: 
  508.     Any ID without a password provides open access to your system,
  509.     Root comes without a password.  
  510.   More info: passwd(5)
  511.  
  512. Modify mail system  -----
  513.   Why: 
  514.    The sendmail program itself has been notorious for numerous bugs that
  515.    gave crackers root access illegitimately.  This is a huge topic and 
  516.    should be a paper or book in itself.  I claim no expertise here, and
  517.    to my great fortune my sendmail experience is limited.  ;-)
  518.       There are several different possible configurations and options 
  519.    I'll outline them and point you to further References. 
  520.  
  521.   Host configuration:
  522.   1. If you intend to send and receive mail directly on your machine.     
  523.      Options are:
  524.    a. Live with sendmail - install the newest version 8.6.9 (currently)
  525.     - ensure a mail file is always in existence for all users
  526.           Ref.10 &11.
  527.         - "chmod u-s /bin/mail" and change sendmail to use "procmail" 
  528.         or mail.local Ref. 17
  529.        Ref.where to get???
  530.         - change sendmail default UID in sendmail.cf to 65534   "Ou65534"
  531.         - turn on security features of sendmail:
  532.            "Opauthwarnings needmailhelo noexpn novrfy restrictmailq"
  533.          Refs. 2 [Cheswick & Bellovin 94] & 9 [Costales 93]
  534.  
  535.    b. Install zmailer -- Ref 8 [URL to zmailer package]
  536.         - zmailer does not use /bin/mail so chmod u-s /bin/mail
  537.  
  538.   2. If mail for your host is received on a different host (ie. local mail
  539.      delivery is handled by another host).  Here your system should only
  540.      need to support outgoing mail.  To prevent the sendmail daemon from
  541.      being started comment out the part or /etc/rc.local that starts
  542.      sendmail. For outgoing mail:
  543.    a. install latest version of sendmail. 
  544.      - see config 1 for thing to change in sendmail config.
  545.          - since mail delivery is being handled by main mail host
  546.            there is no need for /bin/mail so - chmod u-s /bin/mail
  547.    b. Install zmailer -- Ref 8 [URL to zmailer package]
  548.         - zmailer does not use /bin/mail so chmod u-s /bin/mail
  549.     
  550.   3. No need for mail whatsoever on this machine
  551.                                      (incoming, outgoing, or internal).
  552.       This is certainly most secure mode because e-mail will not be able to 
  553.       be sent from or to this machine.  This basic restriction of outside
  554.       access will prevent abuse of that access.  
  555.      How:
  556.       To disable mail totally:
  557.       - chmod u-s /usr/lib/sendmail & /usr/lib/sendmail.mx & /bin/mail
  558.       - comment out the part of rc.local that starts sendmail 
  559.  
  560.  
  561. Packages to enable better monitoring and security:
  562. ------------------------
  563.  
  564. + tripwire - Ref.13. 
  565.  - Include all suid & sgid file in config. 
  566.    - I've modified COPS script to check this with every run, awaiting
  567.      response from Dan Farmer if he minds my releasing script.
  568. + tcp wrappers - Ref.4. 
  569. + Cops - Ref. 14  
  570.    - Set up to run each night - be careful to check the 
  571.      bitbucket output to ensure that it is working properly.
  572. + Modified portmapper, login, rshd, rlogind, pidentd from W. Venema 
  573.   Ref. 15
  574. + TAMU tiger scripts - Ref. 16.
  575.  
  576. Note:  the Australian group SERT has put together a package called
  577. MegaPatch that includes several of these packages as well as many 
  578. of the patches to SunOS previously mentioned.  Ref. 18
  579.  
  580. References  
  581. ----------
  582.  
  583. [1] Dan Farmer & Wietse Venema, "Improving the security of your Site by
  584. Breaking Into it",  1993.
  585. URL:ftp.win.tue.nl:/pub/security/admin-guide-to-cracking.Z
  586.  
  587. [2] W. Cheswick & S. Bellovin, "Firewalls and Internet Security," Addison-
  588. Wesley, April  94.
  589.  
  590. [3] H. Stern, "Managing NFS & NIS", O'Reilly & Associates, April 92
  591.  
  592. [4] Wietse Venema, "TCP WRAPPER: Network monitoring, access control and
  593. booby traps," Proceedings of the Third Usenix Unix Security Symposium, 
  594. pg 85-92.  
  595. URL:ftp.win.tue.nl:/pub/security/tcp_wrapper.ps.Z (paper - .txt.Z avail)
  596. URL:ftp.win.tue.nl:/pub/security/tcp_wrappers_6.3.shar.Z (package)
  597.  
  598.  
  599. [5] Eric Oliver, "How to shadow without C2 Auditing", June 94
  600. URL:ftp.Hawaii.Edu:/????????
  601.  
  602. [6]        [8lgm]-Advisory-7.UNIX.passwd.11-May-1994.NEWFIX
  603.  
  604. [7]  Proactive password changing programs 
  605.       (There are several this is the only one who's URL I had available)
  606. URL:info.mcs.anl.gov:/pub/systems/anlpasswd-2.2.tar.Z
  607.  
  608. [8] Zmailer package - 
  609. URL: cs.toronto.edu:/pub/zmailer.tar.Z
  610.                     /pub/zmailer.README
  611.  
  612. [9] Bryan Costales, Eric Allman & Neil Rickert,  "Sendmail,"
  613. O'Reilly & Associates, June 93
  614.  
  615. 8lgm advisories are avaiable though the 8lgm file server -
  616.    8lgm-fileserver@bagpuss.demon.co.uk
  617. [10]        [8lgm]-Advisory-5.UNIX.mail.24-Jan-1992
  618. [11]        [8lgm]-Advisory-5.UNIX.mail.24-Jan-1992.PATCH
  619. [12]        [8lgm]-Advisory-6.UNIX.mail2.2-May-1994
  620.  
  621. [13] Tripwire - Gene Kim & Gene Spafford 1994
  622. URL:ftp.cs.purdue.edu:/pub/spaf/COAST/Tripwire
  623.  
  624. [14] Cops - Dan Farmer & Gene Spafford 1990 
  625. URL:ftp.cert.org:/pub/tools/cops
  626.  
  627. [15] portmapper, login, rshd, rlogind  - Wietse Venema
  628. URL:ftp.win.tue.nl:/pub/security/portmap.shar.Z
  629. URL:ftp.win.tue.nl:/pub/security/logdaemon-XX.tar.Z
  630.  
  631. [16] TAMU tiger script. - Safford et al 93
  632. URL:net.tamu.edu/pub/security/TAMU
  633.  
  634. [17] Local mail delivery agents:
  635. URL:ftp.informatik.rwth-aachen.de:/pub/packages/procmail
  636. URL:ftp ---- ????? mail.local Joerg Czeranski
  637.  
  638. [18] MegaPatch - SERT
  639. URL:ftp.sert.edu.au:/security/sert/tools/MegaPatch.1.7.tar.Z
  640.  
  641. [19] Source Routinng Patch -
  642. URL:ftp.greatcircle.com:/pub/firewalls/digest/v03.n153.Z
  643.  
  644. Acknowledgements:
  645. Thanks to all the people in comp.security.unix who offered their 
  646. suggestions, and thanks to the following people for their kind review:
  647.   casper@fwi.uva.nl (Casper Dik)
  648.   baron@uhunix.uhcc.Hawaii.Edu (Baron  K Fujimoto)
  649.   rgoodman@uhunix.uhcc.Hawaii.Edu (Becky Goodman)
  650.   newsham@uhunix.uhcc.Hawaii.Edu (Tim Newsham)
  651.   andys@unipalm.co.uk (Andy Smith)
  652.  
  653.  
  654. ------  Other Thoughts for future development & other ---
  655.    Didn't have enough time to do these as well as I'd like. 
  656.  
  657. + disable routed (standard routing table)
  658.   Prevents receiving a false routing table.
  659.  
  660. + remove /dev/nit?
  661.  
  662. + Customizing ruserok() - a bit beyond the basics but here's some info:
  663.      If you have source license to 4.1.3 modify the routine 
  664.    ruserok() to return -1  for the cases you wish to disallow.
  665.    To disable .rhosts authentication entirely, simply have this routine
  666.    return -1.  Look at the file /usr/lib/shlib.etc/README for how to modify
  667.    libc.so, note: also make the following changes:
  668.    in the file /usr/lib/shlib.etc/README below the line
  669.      % mv rpc_commondata. rpc_commondata.o
  670.    insert
  671.      % mv xccs.multibyte. xccs.multibyte.o
  672.    in the Makefile:
  673.    change the lines below to read as they do here:
  674.       OBJSORT=/usr/lib/shlib.etc/objsort
  675.       AWKFILE=/usr/lib/shlib.etc/awkfile
  676.    and add the -ldl option at the end of both ld command lines.
  677.  
  678.   More info: ruserok(3), hosts.equiv(5)  
  679.               source code file /lib/libc/net/rcmd.c Ref. 4, Ref. 15
  680.  
  681. --
  682.                                     tmk
  683.  
  684. -----------------------------------------------------------------------
  685. Tom M. Kroeger                                 Pray for wind       
  686. University of Hawaii Computing Center       \    Pray for waves and
  687. 2565 The Mall,  Keller Hall                 |\     Pray it's your day off!
  688. Honolulu HI 96822     (808) 956-2408        |~\   
  689. e-mail: tmk@uhunix.uhcc.hawaii.edu          |__\
  690.                                            ,----+--
  691.  
  692.