text
stringlengths
0
1.99k
imagine
For example:
Imagine that the /bin directory is publicly writable. The perpetrator could
first remove the old su version (with rm utility) and then include his own
fake su to read the password of users who execute this utility.
Although writable directories can destroy system integrity, readable ones
can be just as damaging. Sometimes files and directories are configured to
permit read access by other. This subtle convenience can lead to unauthorized
disclosure of sensitive data: a serious matter when valuable information is
lost to a business competitor.
As a general rule, therefore, read and write access should be removed from
all but system administrative directories. Execute permission will allow
access to needed files; however, users might explicitly name the file they
wish to use. This adds some protection to unreadable and unwritable
directories. So, programs like lp file.x in an unreadable directory /ddr will
print the contents of file.x, while ls/ddr would not list the contents of that
directory.
PATH VARIABLE
PATH is an environment variable that points to a list of directories, which
are searched when a file is requested by a process. The order of that search
is indicated by the sequence of the listed directories in the PATH name. This
variable is established at user logon and is set up in the users .profile of
.login file.
If a user places the current directory as the first entry in PATH, then
programs in the current directory will be run first. Programs in other
directories with the same name will be ignored. Although file and directory
access is made easier with a PATH variable set up this way, it may expose the
user to pre-existing Trojan horses.
To illustrate this, assume that a Trojan horse, similar to the cat utility,
contains an instruction that imparts access privileges to a perpetrator. The
fake cat is placed in a public directory /usr/his where a user often works.
Now if the user has a PATH variable with the current directory first, and he
enters the cat command while in /usr/his, the fake cat in /usr/his would be
executed but not the system cat located in /bin.
In order to prevent this kind of system violation, the PATH variable must be
correctly set. First, if at all possible, exclude the current directory as
the first entry in the PATH variable and type the full path name when invoking
Unix system commands. This enhances file security, but is more cumbersome to
work with. Second, if the working directory must be included in the PATH
variable, then it should always be listed last. In this way, utilities like
vi, cat, su and ls will be executed first from systems directories like /bin
and /usr/bin before searching the user's working directory.
PASSWORD SECURITY
User authentication in the Unix system is accomplished by personal passwords.
Though passwords offer an additional level of security beyond physical
constraints, they lend themselves to the greatest area of computer system
compromise. Lack of user awareness and responsibility contributes largely to
this form of computer insecurity. This is true of many computer facilities
where password identification, authentication and authorization are required
for the access of resources - and the Unix operating system is no exception.
Password information in many time-sharing systems are kept in restricted
files that are not ordinarily readable by users. The Unix system differs in
this respect, since it allows all users to have read access to the /etc/passwd
file (FIGURE 2) where encrypted passwords and other user information are
stored. Although the Unix system implements a one-way encryption method, and
in most systems a modified version of the data encryption standard (DES),
password breaking methods are known. Among these methods, brute-force attacks
are generally the least effective, yet techniques involving the use of
heuristics (good guesses and knowledge about passwords) tend to be successful.
For example, the /etc/passwd file contains such useful information as the
login name and comments fields. Login names are especially rewarding to the
"password breaker" since many users will use login variants for passwords
(backward spelling, the appending of a single digit etc.). The comment field
often contains items such as surname, given name, address, telephone number,
project name and so on. To quote Morris and Grampp (7) in their landmark
paper on Unix system security:
[in the case of logins]
The authors made a survey of several dozen local machines, using as trial
passwords a collection of the 20 most common female first names, each
followed by a single digit. The total number of passwords tried was,
therefore, 200. At least one of these 200 passwords turned out to be a
valid password on every machine surveyed.
[as for comment fields]
(...) if an intruder knows something about the people using a machine, a
whole new set of candidates is available. Family and friend's names, auto
registration numbers, hobbies, and pets are particularly productive
categories to try interactively in the unlikely event that a purely
mechanical scan of the password file turns out to be disappointing.
Thus, given a persistent system violator, there is a strong evidence, that he
will find some information about users in the /etc/passwd file. With this in
mind, it is obvious that a password file should be unreadable to everyone
except those in charge of system administration.
root:aN2z06ISmxKqQ:0:10:(Boss1),656-35-0989:/:/bin
mike:9okduHy7sdLK8:09:122:No.992-3943:/usr:/bin
FIGURE 2. The /etc/passwd file. Note the comments field as underlined terms.