Unix Os
Unix Os
Control Association
www.isaca.org
UNIX OS
AUDIT PROGRAM
&
INTERNAL CONTROL QUESTIONNAIRE
Disclaimer
The topics developed for these Audit Programs and Internal Control Questionnaires have been
prepared for the professional development of ISACA members and others in the IS Audit and
Control community. Although we trust that they will be useful for that purpose, ISACA cannot
warrant that the use of this material would be adequate to discharge the legal or professional
liability of members in the conduct of their practices.
September 2001
1
UNIX OS
Audit Program and ICQ
Comments:
Details/Test:
· If possible, purchase and run one of these programs against the selected
UNIX systems.
2
UNIX OS
Audit Program and ICQ
Details/Test:
· Gather the following information:
· An inventory of all UNIX hardware and software, including workstations.
· Policies, standards, and procedures.
· A schematic for the UNIX platform and the overall view.
· The unit's strategies and objectives.
· File listings (or equivalents), profile, cshrc and login files for:
· root
· systems administrator (with the highest level of privilege)
· privileged users or special group users
· a typical non-privileged user
· the default (as supplied to new users)
· All significant UNIX servers should be audited. For each server, do the following:
· Telnet to them from the MS-DOS prompt
· Log onto the system as root to extract the relevant information. Otherwise, ask
a system administrator to run the commands on your behalf.
· Start logging, or alternatively redirect the output of the following commands to
a file.
· hHostname
· rusers –l
· finger 0
· finger system
· finger root
· finger guest
· finger demo
· finger ftp
· finger bin
· cat /etc/inittab/
· cat /etc/group/
· cat /etc/passwd/
· cat /etc/shadow/
· cat /usr/lib/uucp/
· cat /usr/lib/uucp/System Devices
· cat /usr/lib/uucp/Devices
· cat /usr/lib/uucp/Systems
· cat /usr/lib/uucp/Permissions
· cat /usr/lib/cron/cron.allow
· cat /usr/lib/cron/at.deny
· cat /usr/lib/cron/cron.deny
· ls –alnupFq /etc
· ls –alnupFq /bin/
· ls –alnupFq /dev/
· ls –alnupFq /lib/
· ls –alnupFq /stand/
· ls –alnupFq /tmp/
· ls –alnupFq /usr/
· ls –alnupFq /unix/
· ls –alnupFq /usr/spool/cron/crontabs
· ls /alnupFq /etc/ftpusers
· pPg /etc/ftpusers
· pg /etc/inetd.conf
· pg /etc/hosts.lpd
· ls –alnupFq /etc/security/
· ls –alnupFq /etc/security/audit/
· rsh <system name> csh –I
· Stop logging
3
UNIX OS
Audit Program and ICQ
4
UNIX OS
Audit Program and ICQ
You must use a logon ID, which has execute access to these directories.
Ask the system administrator for an ID with these capabilities (the system
administration ID would suffice). While logged on, change the current
directory to each of the above listed directories using the cd command
(similar to cd command in MS-DOS) and while in the directory, issue at the
$ prompt, ls -l. This command will display the access capabilities for each
of the files within the directory. Repeat this step for subdirectories also.
/ Root
/bin Contains executable programs and UNIX utilities
/dev Contains special files which represent devices
/etc Contains miscellaneous administration utilities
and data files for system admin
/lib Contains libraries for programs and languages
/stand Contains stand-alone programs, including copy
of operating system kernel loaded by disk-based boot
loader
/tmp Contains temporary files that can be created by any
user
/usr Contains user directories and files
/unix UNIX Kernel is located in this directory
6
UNIX OS
Audit Program and ICQ
· List the contents of selected user's profile file. This file will determine which
directory is accessed through the specification of path variables.
· Determine if the directory accessed is the appropriate directory given
the user's job duties.
· Review also for the use of the unmask command in either the system
or user's profiles. This command can modify default access.
· Evaluate the need and use of restricted shells.
· Ensure that write access to system and user profiles, and any restricted
shells is appropriately restricted. This is achieved by reviewing file
access permissions for these .profile files.
7
UNIX OS
Audit Program and ICQ
UNIX OS
Audit Program and ICQ
8
Networking Security Procedure Step: Comments:
remote execution
Details/Test:
The files hosts.equiv and .rhosts allow users on defined remote machines to log
on to the local machine without using a password.
· Examine the file /etc/hosts.equiv and ensure that all listed hosts are
appropriate.
· Find all files called .rhosts (these may be located in the users home
directories) and ensure that these are appropriate. Remember that use
of host.equiv and .rhosts is convenient but can be used as a backdoor.
They should never be allowed for root and is at all possible should be
banned.
9
UNIX OS
Audit Program and ICQ
ls -l .profile
- marks it as a file
rwx states the owner/creator has read/write/execute
permissions
rwx states that group members of group usr have
read/write/execute permissions
--- states that others outside of the group
usr have no rights
1 states that there are no other file links
drs01 the owner of the file
usr the owners group affiliation
1070 the file size
Mar 7
23:15 the date and time created/last updated
.profile the file name
The above example allows the user and all members of the users group to change
the profile. Security would be better if only the administrator could change the
profile i.e.
10
(-r-x------), alternatively is users are allowed to change their own .profile, the
permissions should be set to (-rwx------).
UNIX OS
Audit Program and ICQ
11
UNIX OS
Audit Program and ICQ
12
UNIX OS
Audit Program and ICQ
13
UNIX OS
Audit Program and ICQ
Appendix A: References
UNIX OS
Audit Program and ICQ
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 organization.
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/*
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/*
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
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/*
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/*
UNIX OS
Audit Program and ICQ
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.
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/
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/*
SATAN
SATAN (Security Administrator Tool for Analyzing 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*
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*
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
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:
16
ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl/chrooduid1.2.asc
CGIWRAP
It is available from:
ftp://ftp.cc.umr.edu/pub/cgi/cgiwrap
UNIX OS
Audit Program and ICQ
X11R6
It is available from:fttp://archie.au/X11/R6/*
ftp://archie.au/X11/contrib/*
or
ftp://ftp.x.org/pub/R6/*
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).
17
The shadow password file enhances security by storing password hashes in a separate, restricted-access file, instead of in /etc/passwd. In the shadow file, encrypted passwords are located in the second position of each entry, making the file only readable by the superuser, thereby reducing the risk of unauthorized access to password data .
The "init" utility is responsible for system start-up processes, executing the instructions in /etc/inittab. It calls the getty utility for terminal logins, which then invokes the login process. Misuse or replacement of "getty" and "login" with unauthorized utilities can introduce security risks by allowing unauthorized access or bypassing login authentication procedures .
"COPS" and "Tiger" are valuable for securing UNIX systems by identifying common security and configuration problems, as well as signs of intrusion. By running these tools, administrators gain insights into vulnerabilities within their systems, allowing them to implement fixes proactively, thus enhancing security defenses .
Reviewing access capabilities to operating system directories and files is important to ensure that only authorized users have access, preventing unauthorized access that could lead to security breaches. This involves assessing who can read, write, or execute files and directories, ensuring that permissions align with security policies and user job duties .
Using .rhosts and hosts.equiv files for remote access can simplify user logins by allowing access without a password. However, this convenience poses significant security risks, as it may act as a backdoor for unauthorized access, especially if used by root accounts. Limiting or banning these files reduces potential vulnerabilities .
Unnecessary entries in the inetd.conf file should be removed because they can expose network services that are not needed, increasing the attack surface for potential intruders. Disabling or removing these services limits vulnerability and reduces the chances of unauthorized access or exploitation .
.netrc files pose security risks because they store unencrypted passwords for auto-login to remote machines. If accessed by unauthorized users, they can provide credentials for remote system access, compromising security and enabling malicious activities .
The "sulog" file logs all attempts to use the superuser ('su') command. By routinely reviewing this file, system administrators can detect unauthorized or suspicious attempts to gain superuser access, which may indicate potential security breaches or misuse of privileges .
Tripwire acts as an early intrusion detection system by maintaining a checksum database of critical system files. By detecting any unauthorized changes to these files, system administrators can quickly identify and respond to potential security breaches, ensuring that integrity is maintained .
Restricted shells limit users to a specific set of commands and restrict their ability to change directories, modify the PATH variable, execute commands with a path, or redirect output. This minimizes users' ability to perform unauthorized actions or modifications to the system, thereby enhancing security .