![]() CEG
499/699:
|
|
| Incomplete Draft | 03/29/01 |
On a typical Unix system (without the Shadow Suite installed), user
information including passwords is stored in the /etc/passwd file.
The password is stored in an encoded format. The algorithm used to
encode the password field is known as a one way hash function. The
computation is easy in the encoding direction, but very time consuming to
calculate in the reverse direction.
Unix crypt() function (not the crypt(1) program) works as
follows. It takes the first 8 characters of the password, and catenates
the low 7-bits of each of these 8 characters into a 56-bit key.
Using this key a sequence of 64-zero-bits is encrypted into a 64-bit code.
This code is split into 11 six-bit numbers. Each six-bit number i is
stored as a char q[i] from the sequence q == [., /, 0-9, A-Z, a-z] of 64
characters. This computation is perturbed with a randomly generated value
called the salt, a two-character string chosen from the q. The salt
value is prepended resulting in a sequence of 13 characters.
As an example, the password "hello" was encoded in two different attempts yielding the two results:
pwsS8k.3HrN8E
BNApDvUheWPoc
Any particular password could be stored in 4096 different ways. The
collection of such user data is in the publicly readable file /etc/passwd.
A typical user's entry in a non-shadowed /etc/passwd file has the
following format:
loginName:passwd:UID:GID:fullName:homeDirectory:shell
When a user logs in and supplies a password, the salt is first retrieved from the stored encoded password. Then the supplied password is encoded with the salt value, and then compared with the encoded password. If there is a match, then the user is authenticated.
A number of Unix utilities read the /etc/passwd file to obtain
other (non-password, such as user's full name) data about a user.
Consequently, this file must continue to have read-permission enabled.
Modern Unix systems no longer store the encoded password in the /etc/passwd
file; the password field of the entries in this file now contains a useless
value. Another file /etc/shadow (on Linux), which is not
world-readable, but whose format is identical to that of /etc/passwd, stores the
encrypted password. See Linux Shadow Password HOWTO (listed in the
References) for more details.
It is computationally difficult (but not impossible) to take a randomly encoded password and recover the original password. The key space consists of 2^56 possible values. Exhaustive searches of this key space are possible using massively parallel computers. However, the real problem is not that an attacker could spend enormous computational power in guessing a password. On any system with more than just a few users, at least some of the passwords will be common words (or simple variations of common words).
A couple of entries from The Jargon File:
System crackers will simply encrypt a dictionary of words and common
passwords using all possible 4096 salt values. Then they will compare the
encoded passwords in your /etc/passwd file with their database.
Once they have found a match, they have the password for another account. This
is one of the most common methods for gaining or expanding unauthorized access
to a system.
An 8 character password encodes to one of 4096 * 13 character strings. So a dictionary of say 400,000 common words, names, passwords, and simple variations would easily fit on a 4GB hard drive. The attacker need only sort them, and then check for matches. A 40 GB hard disk now (Mar 2001) sells for under $100.
Good machine-readable collections of dictionaries are essential for cracking.
Also, if crackers obtain your /etc/passwd file first, they only
need to encode the dictionary with the salt values actually
contained in your /etc/passwd file.
Most people continue to choose easy-to-guess passwords.
1997.01.02, PA News: A recent survey by Compaq in the financial district of London showed that poor choices are the norm for computer passwords there. A staggering 82% of the respondents said they used, in order of preference, ``a sexual position or abusive name for the boss" (30%), their partner's name or nickname (16%), the name of their favorite holiday destination (15%), sports team or player (13%), and whatever they saw first on their desk (8%).
Don't Use the following for passwords: Your first name. Your last name. Your login name. Your pet's name. Any name at all. SS number. House number. Telephone number. Your bank PIN. Any password shorter than six characters.
Do Use passwords of six characters or more. Use a combination of letters, numbers, and special characters.
S/Key is a one-time password scheme based on a one-way hash function. There are four programs involved in the S/Key system.
keyinit' program is used to initialize S/Key, and to
change passwords, iteration counts, or seeds; it takes either a secret
password, or an iteration count, seed, and one-time password.keyinfo' program examines the /etc/skeykeys
file and prints out the invoking user's current iteration count and seed.login' and `su' programs contain the
necessary logic to accept S/Key one-time passwords for authentication. The `login'
program is also capable of disallowing the use of UNIX passwords on
connections coming from specified addresses.Here is how one uses the S/key.
All work should be carried out in Operating Systems and Internet Security (OSIS) Lab, 429 Russ. No other WSU facilities are allowed.
Objective: To help you gauge the level of security offered by the typical password systems.
/etc/passwd file on a machine in the
lab. Crack as many pass words as you can.Crack is a well known
password audit program. Find it on www.securityfocus.com.] See how many
pass words it can crack and how fast. Tabulate the results.| 03/29/01 01:15:27 PM |
| Open Content Copyright © 2001 pmateti@cs.wright.edu |