is the version of the operating system that you run.
6.7 ULTRIX
* DO regularly ask your vendor for a complete list of patches.
Some patches are available from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.service.digital.com
/ultrix///ssrt*
or
ftp://ftp.service.digital.com/pub/ultrix///ssrt*
where is either mips or vax; and
where is the version of the operating system that you run.
==============================================================================
7.0 Security and the X Window System
==============================================================================
Access to your X server may be controlled through either a host-
based or user-based method. The former is left to the discretion
of the Systems Administrator at your site and is useful as long as
all hosts registered in the /etc/Xn.hosts file have users that can be
trusted, where "n" represents your X server's number.
This may not be possible at every site, so a better method is
to educate each and every user about the security implications
(see references below). Better still, when setting up a user, give
them a set of X security related template files, such as .xserverrc
and .xinitrc. These are located in the users home directory.
You are strongly advised to read the section on X window system
security referred to in the X Window System Administrators Guide (C.4).
7.1 Problems with xdm
Note: Release 6 of X11 is now available and solves many problems
associated with X security which were present in previous releases.
If possible, obtain the source for R6 and compile and install it on
your system. See B.18 for how to retrieve the source for X11R6.
* xdm bypasses the normal getty and login functions, which means that
quotas for the user, ownership of /dev/console and possibly other
preventive measures put in place by you may be ignored.
* You should consult your vendor and ask about potential security holes
in xdm and what fixes are available.
* If you are running a version of xdm earlier than October 1995 then
you should update to a newer version.
(Refer to CERT Vendor-Initiated Bulletin VB-95:08, see C.8)
7.2 X security - General
* DO Read the man pages for xauth and Xsecurity.
Use this information to set up the security level you require.
* ENSURE that the permissions on /tmp are set to 1777 (or drwxrwxrwt).
i.e., the sticky bit should be set. The owner MUST always be
root and group ownership should be set to group-id 0, which is
"wheel" or "system".
- If the sticky bit is set, no one other than the owner can
delete the file /tmp/.X11-unix/X0, which is a socket for your
X server. Once this file is deleted, your X server will no
longer be accessible.
- See G.14 for example commands to set the correct permissions
and ownership for /tmp.
* DO use the X magic cookie mechanism MIT-MAGIC-COOKIE-1 or better.
With logins under the control of xdm (see 7.1), you can turn on
authentication by editing the xdm-config file and setting the
DisplayManager*authorize attribute to true.
When granting access to the screen from another machine, use
the xauth command in preference to the xhost command.
* DO not permit access from arbitrary hosts.
Remove all instances of the 'xhost +' command from the
system-wide Xsession file, from user .xsession files, and from
any application programs or shell scripts that use the X window
system.
==============================================================================
Appendix A: Other AUSCERT information sources
A.1 AUSCERT advisories and alerts
Past AUSCERT advisories and alerts can be retrieved via anonymous
ftp from
ftp://ftp.auscert.org.au/pub/auscert/advisory/
A.2 AUSCERT's World Wide Web server
AUSCERT maintains a World Wide Web server. Its URL is
http://www.auscert.org.au
A.3 AUSCERT's ftp server
AUSCERT maintains an ftp server with an extensive range of
tools and documents. Please browse through it. Its URL is
ftp://ftp.auscert.org.au/pub/
==============================================================================
Appendix B: Useful security tools
There are many good tools available for checking your system.
The list below is not a complete list, and you should NOT rely on
these to do ALL of your work for you. They are intended to be only
a guide. It is envisaged that you may write some site specific tools
to supplement these. It is also envisaged that you may look around
on ftp servers for other useful tools.
AUSCERT has not formally reviewed, evaluated or endorsed the tools
described. The decision to use the tools described is the
responsibility of each user or organisation.
B.1 Crack
Crack is a fast password cracking program designed to assist site
administrators in ensuring that users use effective passwords.
Available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/cert/tools/crack/*
B.2 COPS and Tiger
These packages identify common security and configuration
problems. They also check for common signs of intrusion.
Though there is some overlap between these two packages, they
are different enough that it may be useful to run both. Both
are available via anonymous ftp.
COPS:
ftp://ftp.auscert.org.au/pub/cert/tools/cops/1.04
tiger:
ftp://ftp.auscert.org.au/pub/mirrors/net.tamu.edu/tiger*
B.3 anlpasswd
This program is a proactive password checker. It runs a
series of checks on passwords at the time users set them and
refuses password that fail the tests. It is designed to work
with shadow password systems. It is available via anonymous ftp
from:
ftp://ftp.auscert.org.au/pub/mirror/info.mcs.anl.gov/*
B.4 tcp_wrapper
This software gives logging and access control to most network
services. It is available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
/tcp_wrappers_7.2.tar.gz
B.5 Tripwire
This package maintains a checksum database of important system
files. It can serve as an early intrusion detection system. It
is available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/coast/COAST/Tripwire/*
B.6 cpm
cpm checks to see if your network interfaces are running in
promiscuous mode. If you do not normally run in this state then
it may be an indication that an intruder is running a network
sniffer on your system. This program was designed to run on
SunOS 4.1.x and may also work on many BSD systems. It is available
via anonymous ftp from:
ftp://ftp.auscert.edu.au/pub/cert/tools/cpm/*
B.8 Vendor supplied security auditing packages
Sun provides an additional security package called SUNshield.
Please direct enquiries about similar products to your vendor.
B.9 smrsh
The smrsh(8) program is intended as a replacement for /bin/sh
in the program mailer definition of sendmail(8). smrsh is a
restricted shell utility that provides the ability to specify,
through a configuration, an explicit list of executable
programs. When used in conjunction with sendmail, smrsh
effectively limits sendmail's scope of program execution to
only those programs specified in smrsh's configuration.
It is available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/cert/tools/smrsh
Note: smrsh comes bundled with Eric Allman's sendmail 8.7.1 and
higher.
B.10 MD5
MD5 is a message digest algorithm. An implementation of this is
available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/cert/tools/md5/*
B.11 rscan
This tool checks for a number of common IRIX-specific security
bugs and problems. It is available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.vis.colostate.edu
/rscan/*
B.12 SATAN
SATAN (Security Administrator Tool for Analysing Networks) is
a testing and reporting tool that collects information about
networked hosts. It can also be run to check for a number
of vulnerabilities accessible via the network. It is available
via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl/satan*
B.13 logdaemon
Written by Wietse Venema, this package includes replacements
for rsh and rlogin daemons. By default these versions do not
accept wild cards in host.equiv or .rhost files. They also
have an option to disable user .rhost files. logdaemon is
available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl/logdaemon*
B.14 portmapper/rpcbind
These are portmapper/rpcbind replacements written by Wietse
Venema that disallow proxy access to the mount daemon via the
portmapper. Choose the one suitable for your system. They are
available via anonymous ftp from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
/portmap_3.shar.Z
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
/rpcbind_1.1.tar.Z
B.15 PGP Pretty Good Privacy implements encryption and authentication.
It is available from:
ftp://ftp.ox.ac.uk/pub/pgp/unix/
B.16 chrootuid
Allows chroot functionality. The current version is 1.2 (at
time of writing). Please check for later versions.
It is available from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
/chrooduid1.2
A digital signature is available from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
/chrooduid1.2.asc
B.17 CGIWRAP
It is available from:
ftp://ftp.cc.umr.edu/pub/cgi/cgiwrap
B.18 X11R6
It is available from:
ftp://archie.au/X11/R6/*
ftp://archie.au/X11/contrib/*
or
ftp://ftp.x.org/pub/R6/*
B.19 Washington University ftpd (wu-ftpd)
This can log all events and provide users with a login banner
and provide writable directory support in a more secure manner.
It is available from:
ftp://ftp.auscert.org.au/pub/mirrors/wuarchive.wustl.edu
/packages/wuarchive-ftpd/*
NOTE: Do not install any versions prior to wu-ftp 2.4 as these are
extremely insecure and in some cases have been trojaned.
Refer to the CERT advisory CA-94:07 (C.8).
B.20 Patch 005 for BSD/386 v1.1.
It is available from:
ftp://ftp.auscert.org.au/pub/mirrors/ftp.bsdi.com
/bsdi/patches/README
ftp://ftp.auscert.org.au/pub/mirrors/ftp.bsdi.com
/bsdi/patches/?U110-005
or
ftp://ftp.bsdi.com/bsdi/patches/README
ftp://ftp.bsdi.com/bsdi/patches/?U110-005
(where ? is B or S for the Binary or Source version)
B.21 Anonymous FTP Configuration Guidelines
The CERT document which addresses the many problems associated
with writable anonymous ftp directories. It is available from:
ftp://ftp.auscert.org.au/pub/cert/tech_tips/anonymous_ftp
==============================================================================
Appendix C: References
C.1 Practical UNIX Security
Simson Garfinkel and Gene Spafford
(C) 1991 O'Reilly & Associates, Inc.
C.2 UNIX Systems Security
Patrick Wood and Stephen Kochan
(C) 1986 Hayden Books
C.3 UNIX system security: A Guide for Users and System Administrators
David A. Curry
Addison-Wesley Professional Computing Series
May 1992.
C.4 X Window System Administrators Guide
Chapter 4
(C) 1992 O'Reilly & Associates, Inc.
C.5 Information Security Handbook
William Caelli, Dennis Longley and Michael Shain
(C) 1991 MacMillan Publishers Ltd.
C.6 Firewalls and Internet Security
William R. Cheswick & Steven M. Bellovin
(C) 1994 AT&T Bell Laboratories
Addison-Wesley Publishing Company
C.7 Building Internet Firewalls
Brent Chapman and Elizabeth Zwicky
(C) 1995 O'Reilly & Associates, Inc.
C.8 CERT advisories are available via anonymous FTP from
ftp://ftp.auscert.org.au/pub/cert/cert_advisories/*
CERT vendor-initiated bulletins are available via anonymous FTP from
ftp://ftp.auscert.org.au/pub/cert/cert_bulletins/*
C.9 UNIX System Administration Handbook (second edition)
Evi Nemeth, Garth Snyder, Trent R. Hein and Scott Seebas
Prentice-Hall, Englewood Cliffs (NJ), 1995
C.10 Essential System Administration
Aeleen Frisch
O'Reilly & Associates, Inc.
C.11 Managing Internet Information Services
Cricket Liu, Jerry Peek, Russ Jones, Bryan Buus, Adrian Nye
O'Reilly & Associates, Inc.
C.12 Managing NFS and NIS
Hal Stern, O'Reilly and Associates, Inc., 1991
==============================================================================
Appendix D: Abbreviated Checklist
It is intended that this short version of the checklist be used in
conjunction with the full checklist as a progress guide (mark off the
sections as you go so that you remember what you have done so far).
1.0 Patches
[ ] Installed latest patches?
2.0 Network security
[ ] Filtering
[ ] "r" commands
[ ] /etc/hosts.equiv
[ ] /etc/netgroup
[ ] $HOME/.rhosts
[ ] NFS
[ ] /etc/hosts.lpd
[ ] Secure terminals
[ ] Network services
[ ] Trivial ftp (tftp)
[ ] /etc/services
[ ] tcp_wrapper (also known as log_tcp)
[ ] /etc/aliases
[ ] Sendmail
[ ] majordomo
[ ] fingerd
[ ] UUCP
[ ] REXD
[ ] World Wide Web (WWW) - httpd
3.0 ftpd and anonymous ftp
[ ] Versions
[ ] Configuration
[ ] Anonymous ftp only
[ ] Configuration of your ftp server
[ ] Permissions
[ ] Writable directories
[ ] Disk mounting
4.0 Password and account security
[ ] Policy
[ ] Proactive Checking
[ ] NIS, NIS+ and /etc/passwd entries
[ ] Password shadowing
[ ] Administration
[ ] Special accounts
[ ] Root account
[ ] .netrc files
[ ] GCOS field
5.0 File system security
[ ] General
[ ] Startup and shutdown scripts
[ ] /usr/lib/expreserve
[ ] External file systems/devices
[ ] File Permissions
[ ] Files run by root
[ ] Bin ownership
[ ] Tiger/COPS
[ ] Tripwire
6.0 Vendor operating system specific security
[ ] SunOS 4.1.x
[ ] Patches
[ ] IP forwarding and source routing
[ ] Framebuffers /dev/fb
[ ] /usr/kvm/sys/*
[ ] /usr/kvm/crash
[ ] /dev/nit (Network Interface Tap)
[ ] Loadable drivers option
[ ] Solaris 2.x
[ ] Patches
[ ] IP forwarding and source routing
[ ] Framebuffers /dev/fbs
[ ] IRIX
[ ] Patches
[ ] AIX
[ ] Patches
[ ] HPUX
[ ] Patches
[ ] OSF
[ ] Patches
[ ] ULTRIX
[ ] Patches
7.0 Security and the X Window System
[ ] Problems with xdm
[ ] X security - General
==============================================================================
Appendix E: Shell Scripts
E.1 Script for printing the umask value for each user.
#!/bin/sh
PATH=/bin:/usr/bin:/usr/etc:/usr/ucb
HOMEDIRS=`cat /etc/passwd | awk -F":" 'length($6) > 0 {print $6}' | sort -u`
FILES=".cshrc .login .profile"
for dir in $HOMEDIRS
do
for file in $FILES
do
grep -s umask /dev/null $dir/$file
done
done
==============================================================================
Appendix F: Table of operating systems by flavour
Operating System SVR4-like BSD-like Other
-------------------------------------------------------------------
| |
| SunOS 4.1.x * |
| |
| Solaris 2.x * |
| |
| Solaris intel86 x.x * |
| |
| Irix x.x * |
| |
| HP/UX x.x * |
| |
| Ultrix x.x * |
| |
| OSF x.x * |
| |
| *BSD* x.x * |
| |
| Linux x.x * |
| |
| AIX x.x * |
| |
| SCO x.x * |
| |
-------------------------------------------------------------------
==============================================================================
Appendix G: List of commands by flavour
Notes:
1. The commands given here are examples only. Please consult the manual
pages for your system if you are unsure of the consequence of any
command.
2. BSD-style commands are marked as BSD commands, similarly for SVR4.
3. Commands which are not labelled are expected to work for both.
4. Full directory paths and program options may vary for different flavours
of UNIX. If in doubt, consult your vendor documentation.
G.1 Restart inetd
BSD commands
# /bin/ps -aux | /bin/grep inetd | /bin/grep -v grep
# /bin/kill -HUP
SVR4 commands
# /bin/ps -ef | /bin/grep inetd | /bin/grep -v grep
# /bin/kill -HUP
G.2 Ascertain which services are registered with the portmapper
# /usr/bin/rpcinfo -p
G.3 Rebuild alias maps
# /usr/bin/newaliases
If you run NIS (YP), you will then need to rebuild your maps to have the
change take effect over all clients:
# (cd /var/yp; /usr/bin/make aliases)
G.4 Test whether sendmail wizard password is enabled
% telnet hostname 25
wiz
debug
kill
quit
%
You should see the response "5nn error return" (e.g., "500 Command
unrecognized") after each of the commands 'wiz', 'debug' and 'kill'.
Otherwise, your version of sendmail may be vulnerable. If you are unsure
whether your version is vulnerable, update it.
G.5 Set sendmail log level to 9
Include lines describing the log level (similar to the following two) in
the options part of the general configuration information section of the
sendmail configuration file:
# log level
OL9
The log level syntax changed in sendmail 8.7 to:
# log level
O LogLevel=9
G.6 Set syslog log level for mail messages
Include lines describing the logging required (similar to the following
two) in the syslog.conf file:
mail.info /dev/console
mail.info /var/adm/messages
For the change to take effect, you must then instruct syslog to reread
the configuration file.
BSD commands
Get the current PID of syslog:
# /bin/ps -aux | /bin/grep syslogd | /bin/grep -v grep
Then tell syslog to reread its configuration file:
# /bin/kill -HUP
SVR4 commands:
Get the current PID of syslog:
# /bin/ps -ef | /bin/grep syslogd | /bin/grep -v grep
Then tell syslog to reread its configuration file:
# /bin/kill -HUP
NOTE: In the logs, look for error messages like:
- mail to or from a single pipe ("|")
- mail to or from an obviously invalid user (e.g., bounce or blah)
G.7 (Rebuilding and) restarting sendmail(8)
To rebuild the frozen configuration file, firstly do:
# /usr/lib/sendmail -bz
NOTE: The above process does not apply to sendmail v8.x which does not
support frozen configuration files.
To restart sendmail(8), you should kill *all* existing sendmail(8)
processes by sending them a TERM signal using kill, then restart
sendmail(8).
BSD commands
Get the pid of every running sendmail process:
# /bin/ps -aux | /bin/grep sendmail | /bin/grep -v grep
Kill every running sendmail process and restart sendmail:
# /bin/kill #pid of every running sendmail process
# /usr/lib/sendmail -bd -q1h
SVR4 commands
Get the pid of every running sendmail process:
# /bin/ps -ef | /bin/grep sendmail | /bin/grep -v grep
Kill every running sendmail process and restart sendmail:
# /bin/kill #pid of every running sendmail process
# /usr/lib/sendmail -bd -q1h
G.8 Test whether ftpd supports SITE EXEC
For normal users:
% telnet localhost 21
USER username
PASS password
SITE EXEC
For anonymous users:
% telnet localhost 21
USER ftp
PASS username@domainname.au
SITE EXEC
You should see the response "5nn error return" (e.g., "500 'SITE
EXEC' command not understood"). If your ftp daemon has SITE EXEC
enabled, make sure you have the most recent version of the daemon (e.g.,
wu-ftp 2.4). Older versions of ftpd allow any user to gain shell access
using the SITE EXEC command. Use QUIT to end the telnet session.
G.9 Ascertain whether anonymous ftp is enabled
% ftp localhost
Connected to localhost
220 hostname FTP server ready
Name (localhost:username): anonymous
331 Guest login ok, send username as password
Password: user@domain.au
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
G.10 Ensure that * in the password field is correctly implemented
1. Try using NIS with the '*' in the password field for example:
+:*:0:0:::
If NIS users cannot log in to that machine, remove the '*' and try
the next test.
2. With the '*' removed, try logging in again. If NIS users can log in
AND you can also log in unauthenticated as the user '+', then your
implementation is vulnerable. Contact the vendor for more information.
If NIS users can log in AND you cannot log in as the user '+', your
implementation should not be vulnerable to this problem.
G.11 Find .exrc files
# /bin/find / -name '.exrc' -exec /bin/cat {} \; -print
See also G.19.
G.12 Locate and print .forward files
# /bin/find / -name '.forward' -exec /bin/cat {} \; -print
See also G.19.
G.13 Remove execute permission on /usr/lib/expreserve
# /bin/chmod 400 /usr/lib/expreserve
G.14 Set ownership and permissions for /tmp correctly
# /bin/chown root /tmp
# /bin/chgrp 0 /tmp
# /bin/chmod 1777 /tmp
NOTE: This will NOT recursively set the sticky bit on sub-directories
below /tmp, such as /tmp/.X11-unix and /tmp/.NeWS-unix; you may
have to set these manually or through the system startup files.
G.15 Find group and world writable files and directories
# /bin/find / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;
# /bin/find / -type d \( -perm -2 -o -perm -20 \) -exec ls -ldg {} \;
See also G.19.
G.16 Find files with the SUID or SGID bit enabled
# /bin/find / -type f \( -perm -004000 -o -perm -002000 \) \
-exec ls -lg {} \;
See also G.19.
G.17 Find normal files in /dev
# /bin/find /dev -type f -exec ls -l {} \;
See also G.19.
G.18 Find block or character special files
# /bin/find / \( -type b -o -type c \) -print | grep -v '^/dev/'
See also G.19.
G.19 Avoid NFS mounted file systems when using /bin/find
# /bin/find / \( \! -fstype nfs -o -prune \)
As an example, could be
-type f \( -perm -004000 -o -perm -002000 \) -exec ls -lg {} \;
==============================================================================
The AUSCERT team have made every effort to ensure that the information
contained in this checklist is accurate. However, the decision to use the
tools and techniques described is the responsibility of each user or
organisation. The appropriateness of each item for an organisation or
individual system should be considered before application in conjunction with
local policies and procedures. AUSCERT takes no responsibility for the
consequences of applying the contents of this document.
AUSCERT acknowledges technical input and review of this document by CERT
Coordination Center and DFN-CERT and comments from users of this document.
Permission is granted to copy and distribute this document provided that The
University of Queensland copyright is acknowledged.
(C) Copyright 1995 The University of Queensland
==============================================================================
If you believe that your system has been compromised, contact AUSCERT or your
representative in FIRST (Forum of Incident Response and Security Teams).
Internet Email: auscert@auscert.org.au
AUSCERT Hotline: (07) 3365 4417 (International: + 61 7 3365 4417)
Facsimile: (07) 3365 4477
AUSCERT personnel answer during business hours (AEST - GMT+10:00),
on call after hours for emergencies.
Australian Computer Emergency Response Team
c/- Prentice Centre
The University of Queensland
Brisbane, Queensland 4072.
Australia
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i
Comment: Finger pgp@ftp.auscert.org.au to retrieve AUSCERT's public key
iQCVAwUBMNdrTih9+71yA2DNAQH9sQP/aWGDwRG80e4oz6pgeRRkzB25tm0D12ew
8zXBldNrbGC1s0h4U//G/WPNvWeF4Llr7GAAevTxwc8RMeDS9N3Aw5YTpPXaOE+x
WSqHDEQfCwRgiOJc4sw3GA9r7/HYcwi81E06gNwmFTDU+IMmAiKCBisw/vNCnHS9
RztMITIV7is=
=wZf1
-----END PGP SIGNATURE-----