Foiling The Cracker
Foiling The Cracker
Daniel V. Klein
LoneWolf Systems
5606 Northumberland
Pittsburgh, PA 15217
[email protected]
+1 412 422 0285
ABSTRACT
With the rapid burgeoning of national and international networks, the question
of system security has become one of growing importance. High speed inter-machine
communication and even higher speed computational processors have made the threats
of system ‘‘crackers,’’ data theft, data corruption very real. This paper outlines some
of the problems of current password security by demonstrating the ease by which indi-
vidual accounts may be broken. Various techniques used by crackers are outlined, and
finally one solution to this point of system vulnerability, a proactive password checker,
is proposed.
1. Introduction
The security of accounts and passwords has always been a concern for the developers and users of
Unix. When Unix was younger, the password encryption algorithm was a simulation of the M-209
cipher machine used by the U.S. Army during World War II [Morris1979]. This was a fair encryption
mechanism in that it was difficult to invert under the proper circumstances, but suffered in that it was
too fast an algorithm. On a PDP-11/70, each encryption took approximately 1.25ms, so that it was pos-
sible to check roughly 800 passwords/second. Armed with a dictionary of 250,000 words, a cracker
could compare their encryptions with those all stored in the password file in a little more than five
minutes. Clearly, this was a security hole worth filling.
In later (post-1976) versions of Unix, the DES algorithm [DES1975] was used to encrypt passwords.
The user’s password is used as the DES key, and the algorithm is used to encrypt a constant. The algo-
rithm is iterated 25 times, with the result being an 11 character string plus a 2-character ‘‘salt.’’ This
method is similarly difficult to decrypt (further complicated through the introduction of one of 4096
possible salt values) and had the added advantage of being slow. On a µVAX-II (a machine substan-
tially faster than a PDP-11/70), a single encryption takes on the order of 280ms, so that a determined
cracker can only check approximately 3.6 encryptions a second. Checking this same dictionary of
250,000 words would now take over 19 hours of CPU time. Although this is still not very much time
to break a single account, there is no guarantee that this account will use one of these words as a pass-
word. Checking the passwords on a system with 50 accounts would take on average 40 CPU days
(since the random selection of salt values practically guarantees that each user’s password will be
encrypted with a different salt), with no guarantee of success. If this new, slow algorithm was com-
bined with the user education needed to prevent the selection of obvious passwords, the problem
seemed solved.
hhhhhhhhhhhhhhhhhh
Regrettably, two recent developments and the recurrence of an old one have brought the problem of
password security back to the fore.
1) CPU speeds have gotten increasingly faster since 1976, so much so that processors that are
25-40 times faster than the PDP-11/70 (e.g., the DECstation 3100 used in this research) are
readily available as desktop workstations. With inter-networking, many sites have hundreds
of the individual workstations connected together, and enterprising crackers are discovering
that the ‘‘divide and conquer’’ algorithm can be extended to multiple processors, especially
at night when those processors are not otherwise being used. Literally thousands of times
the computational power of 10 years ago can be used to break passwords.
2) New implementations of the DES encryption algorithm have been developed, so that the
time it takes to encrypt a password and compare the encryption against the value stored in
the password file has dropped below the 1ms mark [Bishop1988, Feldmeier1989]. On a sin-
gle workstation, the dictionary of 250,000 words can once again be cracked in under five
minutes. By dividing the work across multiple workstations, the time required to encrypt
these words against all 4096 salt values could be no more than an hour or so. With a
recently described hardware implementation of the DES algorithm, the time for each
encryption can be reduced to approximately 6 µs [Leong1991]. This means that this same
dictionary can be be cracked in only 1.5 seconds.
3) Users are rarely, if ever, educated as to what are wise choices for passwords. If a password
is in a dictionary, it is extremely vulnerable to being cracked, and users are simply not
coached as to ‘‘safe’’ choices for passwords. Of those users who are so educated, many
think that simply because their password is not in /usr/dict/words, it is safe from detection.
Many users also say that because they do not have any private files on-line, they are not
concerned with the security of their account, little realizing that by providing an entry point
to the system they allow damage to be wrought on their entire system by a malicious
cracker.
Because the entirety of the password file is readable by all users, the encrypted passwords are vulner-
able to cracking, both on-site and off-site. Many sites have responded to this threat with a reactive
solution – they scan their own password files and advise those users whose passwords they are able to
crack. The problem with this solution is that while the local site is testing its security, the password file
is still vulnerable from the outside. The other problems, of course, are that the testing is very time con-
suming and only reports on those passwords it is able to crack. It does nothing to address user pass-
words which fall outside of the specific test cases (e.g., it is possible for a user to use as a password the
letters ‘‘qwerty’’ – if this combination is not in the in-house test dictionary, it will not be detected, but
there is nothing to stop an outside cracker from having a more sophisticated dictionary!).
Clearly, one solution to this is to either make /etc/passwd unreadable, or to make the encrypted pass-
word portion of the file unreadable. Splitting the file into two pieces – a readable /etc/passwd with all
but the encrypted password present, and a ‘‘shadow password’’ file that is only readable by root is the
solution proposed by Sun Microsystems (and others) that appears to be gaining popularity. It seems,
however, that this solution will not reach the majority of non-Sun systems for quite a while, nor even,
in fact, many Sun systems, due to many sites’ reluctance to install new releases of software.†
What I propose, therefore, is a publicly available proactive password checker, which will enable users
to change their passwords, and to check a priori whether the new password is ‘‘safe.’’ The criteria for
safety should be tunable on a per-site basis, depending on the degree of security desired. For example,
it should be possible to specify a minimum length password, a restriction that only lower case letters
are not allowed, that a password that looks like a license plate be illegal, and so on. Because this
proactive checker will deal with the pre-encrypted passwords, it will be able to perform more sophisti-
cated pattern matching on the password, and will be able to test the safety without having to go through
hhhhhhhhhhhhhhhhhh
† The problem of lack of password security is not just endemic to Unix. A recent Vax/VMS worm had great suc-
cess by simply trying the username as the password. Even though the VMS user authorization file is inaccessible to or-
dinary users, the cracker simply tried a number of ‘‘obvious’’ password choices – and easily gained access.
-3-
the effort of cracking the encrypted version. Because the checking will be done automatically, the pro-
cess of education can be transferred to the machine, which will instruct the user why a particular choice
of password is bad.
2. Password Vulnerability
It has long been known that all a cracker need do to acquire access to a Unix machine is to follow two
simple steps, namely:
1) Acquire a copy of that site’s /etc/passwd file, either through an unprotected uucp link, well
known holes in sendmail, or via ftp or tftp.
2) Apply the standard (or a sped-up) version of the password encryption algorithm to a collec-
tion of words, typically /usr/dict/words plus some permutations on account and user names,
and compare the encrypted results to those found in the purloined /etc/passwd file.
If a match is found (and often at least one will be found), the cracker has access to the targeted
machine. Certainly, this mode of attack has been known for some time [Spafford1988], and the
defenses against this attack have also long been known. What is lacking from the literature is an
accounting of just how vulnerable sites are to this mode of attack. In short, many people know that
there is a problem, but few people believe it applies to them.
‘‘There is a fine line between helping administrators protect their systems and providing a cookbook for
bad guys.’’ [Grampp1984] The problem here, therefore, is how to divulge useful information on the
vulnerability of systems, without providing too much information, since almost certainly this informa-
tion could be used by a cracker to break into some as-yet unviolated system. Most of the work that I
did was of a general nature – I did not focus on a particular user or a particular system, and I did not
use any personal information that might be at the disposal of a dedicated ‘‘bad guy.’’ Thus any results
which I have been able to garner indicate only general trends in password usage, and cannot be used to
great advantage when breaking into a particular system. This generality notwithstanding, I am sure that
any self-respecting cracker would already have these techniques at their disposal, and so I am not bring-
ing to light any great secret. Rather, I hope to provide a basis for protection for systems that can guard
against future attempts at system invasion.
published on the network) can be used to access or destroy any information on the machine.
It should be noted that the results of this testing do not give us any indication as to what the uncracked
passwords are. Rather, it only tells us what was essentially already known – that users are likely to use
words that are familiar to them as their passwords [Riddle1989]. What new information it did provide,
however, was the degree of vulnerability of the systems in question, as well as providing a basis for
developing a proactive password changer – a system which pre-checks a password before it is entered
into the system, to determine whether that password will be vulnerable to this type of attack. Pass-
words which can be derived from a dictionary are clearly a bad idea [Alvare1988], and users should be
prevented from using them. Of course, as part of this censoring process, users should also be told why
their proposed password is not good, and what a good class of password would be.
As to those passwords which remain unbroken, I can only conclude that these are much more secure
and ‘‘safe’’ than those to be found in my dictionaries. One such class of passwords is word pairs,
where a password consists of two short words, separated by a punctuation character. Even if only
words of 3 to 5 lower case characters are considered, /usr/dict/words provides 3000 words for pairing.
When a single intermediary punctuation character is introduced, the sample size of 90,000,000 possible
passwords is rather daunting. On a DECstation 3100, testing each of these passwords against that of a
single user would require over 25 CPU hours – and even then, no guarantee exists that this is the type
of password the user chose. Introducing one or two upper case characters into the password raises the
search set size to such magnitude as to make cracking untenable.
Another ‘‘safe’’ password is one constructed from the initial letters of an easily remembered, but not
too common phrase. For example, the phrase ‘‘Unix is a trademark of Bell Laboratories’’ could give
rise to the password ‘‘UiatoBL.’’ This essentially creates a password which is a random string of upper
and lower case letters. Exhaustively searching this list at 1000 tests per second with only 6 character
passwords would take nearly 230 CPU days. Increasing the phrase size to 7 character passwords makes
the testing time over 32 CPU years – a Herculean task that even the most dedicated cracker with huge
computational resources would shy away from.
Thus, although I don’t know what passwords were chosen by those users I was unable to crack, I can
say with some surety that it is doubtful that anyone else could crack them in a reasonable amount of
time, either.
† The astute reader will notice that 3983 is in fact 63,044,972. Since Unix passwords are truncated after 8 charac-
ters, however, the number of unique polysyllabic Chinese passwords is only around 16,000,000. Even this reduced set
was too large to complete under the imposed time constraints.
-6-
this is well within acceptable ranges, it is a bit out of line for any but the most dedicated and resource-
rich cracker.
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i
c Passwords cracked from a sample set of 13,797 accounts c
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i
c c
c
Type of Size of Duplicates Search # of Pct. Cost/Benefit c
i
i Password Dictionary Eliminated Size Matches of Total Ratio* iic
c iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
c † User/account name 130 – 130 c368 2.7% 2.830
c c
Character sequences 866 0 866 22 0.2% 0.025
c c
c
Numbers 450 23 427 9 0.1% 0.021 c
‡
c Chinese 398 6 392 56 0.4% 0.143 c
c Place names 665 37 628 82 0.6% 0.131 c
c Common names 2268 29 2239 548 4.0% 0.245 c
c c
Female names 4955 675 4280 161 1.2% 0.038
c c
c
Male names 3901 1035 2866 140 1.0% 0.049 c
c Uncommon names 5559 604 4955 130 0.9% 0.026 c
c Myths & legends 1357 111 1246 66 0.5% 0.053 c
c Shakespearean 650 177 473 11 0.1% 0.023 c
c c
Sports terms 247 9 238 32 0.2% 0.134
c c
c
Science fiction 772 81 691 59 0.4% 0.085 c
c Movies and actors 118 19 99 12 0.1% 0.121 c
c Cartoons 133 41 92 9 0.1% 0.098 c
c Famous people 509 219 290 55 0.4% 0.190 c
c c
Phrases and patterns 998 65 933 253 1.8% 0.271
c c
c
Surnames 160 127 33 9 0.1% 0.273 c
c Biology 59 1 58 1 0.0% 0.017 c
c /usr/dict/words 24474 4791 19683 1027 7.4% 0.052 c
c Machine names 12983 3965 9018 132 1.0% 0.015 c
c c
Mnemonics 14 0 14 2 0.0% 0.143
c c
c
King James bible 13062 5537 7525 83 0.6% 0.011 c
c Miscellaneous words 8146 4934 3212 54 0.4% 0.017 c
c Yiddish words 69 13 56 0 0.0% 0.000 c
c Asteroids 3459 1052 2407 19 0.1% 0.007 c
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i
c c
Total 86280 23553 62727 3340 24.2% 0.053
ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii ic
The results are quite disheartening. The total size of the dictionary was only 62,727 words (not count-
ing various permutations). This is much smaller than the 250,000 word dictionary postulated at the
beginning of this paper, yet armed even with this small dictionary, nearly 25% of the passwords were
cracked!
hhhhhhhhhhhhhhhhhh
* In all cases, the cost/benefit ratio is the number of matches divided by the search size. The more words that need-
ed to be tested for a match, the lower the cost/benefit ratio.
† The dictionary used for user/account name checks naturally changed for each user. Up to 130 different permuta-
tions were tried for each.
‡ While monosyllablic Chinese passwords were tried for all users (with 12 matches), polysyllabic Chinese passwords
were tried only for users with Chinese names. The percentage of matches for this subset of users is 8% – a greater hit
ratio than any other method. Because the dictionary size is over 16×106, though, the cost/benefit ratio is infinitesimal.
-8-
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
c Length of Cracked Passwords c
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
c c
i
i Length Count Percentage c
c iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
c 1 character 4 0.1% c
c 2 characters 5 0.2% c
c c
3 characters 66 2.0%
c c
c
4 characters 188 5.7% c
c 5 characters 317 9.5% c
c 6 characters 1160 34.7% c
c 7 characters 813 24.4% c
c c
8 characters 780 23.4%
ciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiic
The results of the word-pair tests are not included in either of the two tables. However, at the time of
this writing, the test was approximately 10% completed, having found an additional 0.4% of the pass-
words in the sample set. It is probably reasonable to guess that a total of 4% of the passwords would
be cracked by using word pairs.
respond to the challenge, and is denied access to the system. The problems with smart cards have noth-
ing to do with security, for in fact they are very good warders for your system. The drawbacks are that
they can be expensive and must be carried at all times that access to the system is desired. They are
also a bit of overkill for research or educational systems, or systems with a high degree of user turn-
over.
Clearly, then, since all of these systems have drawbacks in some environments, an additional way must
be found to aid in password security.
The configuration file which specifies the level of checking need not be readable by users. In fact,
making this file unreadable by users (and by potential crackers) enhances system security by hiding a
valuable guide to what passwords are acceptable (and conversely, which kind of passwords simply can-
not be found).
- 10 -
Of course, to make this proactive checker more effective, it woule be necessary to provide the dic-
tionaries that were used in this research (perhaps augmented on a per-site basis). Even more impor-
tantly, in addition to rejecting passwords which could be easily guessed, the proactive password changer
would also have to tell the user why a particular password was unacceptable, and give the user sugges-
tions as to what an acceptable password looks like.
References
Morris1979.
Robert T. Morris and Ken Thompson, ‘‘Password Security: A Case History,’’ Communications of
the ACM, vol. 22, no. 11, pp. 594-597, November 1979.
DES1975.
‘‘Proposed Federal Information Processing Data Encryption Standard,’’ Federal Register
(40FR12134), March 17, 1975.
Bishop1988.
Matt Bishop, ‘‘An Application of a Fast Data Encryption Standard Implementation,’’ Computing
Systems, vol. 1, no. 3, pp. 221-254, Summer 1988.
Feldmeier1989.
David C. Feldmeier and Philip R. Karn, ‘‘UNIX Password Security – Ten Years Later,’’ CRYPTO
Proceedings, Summer 1989.
Leong1991.
Philip Leong and Chris Tham, ‘‘UNIX Password Encryption Considered Insecure,’’ USENIX
Winter Conference Proceedings, January 1991.
Spafford1988.
Eugene H. Spafford, ‘‘The Internet Worm Program: An Analysis,’’ Purdue Technical Report
CSD-TR-823, Purdue University, November 29, 1988.
Grampp1984.
F. Grampp and R. Morris, ‘‘Unix Operating System Security,’’ AT&T Bell Labs Technical Jour-
nal, vol. 63, no. 8, pp. 1649-1672, October 1984.
Riddle1989.
Bruce L. Riddle, Murray S. Miron, and Judith A. Semo, ‘‘Passwords in Use in a University
Timesharing Environment,’’ Computers & Security, vol. 8, no. 7, pp. 569-579, November 1989.
Alvare1988.
Ana Marie De Alvare and E. Eugene Schultz, Jr., ‘‘A Framework for Password Selection,’’
USENIX UNIX Security Workshop Proceedings, August 1988.
Raleigh1988.
T. Raleigh and R. Underwood, ‘‘CRACK: A Distributed Password Advisor,’’ USENIX UNIX
Security Workshop Proceedings, August 1988.
- 11 -
Reid1989.
Dr. Brian K Reid, DEC Western Research Laboratory, 1989. Personal communication.