Subject: Re: Isn't it a security hole...

From: [email-masked] (Gilbert Ramirez Jr.) (by way of Mike Wood <[email-masked]>)
Date: Wed, 14 Aug 1996 11:27:54 -0700

>As Jerzy Kakol said:
>> 
>> 
>> ...the attribute readable for others in case of the file /etc/passwd?
>
>Perhaps a bit, but not too much. The passwords in /etc/passwd are encrypted
>through one-way DES encryption.  It's much easier to simply guess users'
>passwords, the majority of which are first-names or first-names followed
>by a number.
>
>> 
>> TIA.
>> 
>>     Jerzy Kakol
>> 
>--gilbert
>______________________________________________________________________
>Gilbert Ramirez Jr.                     [email-masked]
>University of Texas                     http://merece.uthscsa.edu/gram
>Health Science Center at San Antonio    University Health System
>

        Actually, cracking a unix passwd file is quite easy, even for those
with minimal computer knowledge.  With widely available programs like Crack
(UNIX), Crakerjack (DOS), and root_crack(DOS) anybody with a CPU >386 can
crack the DES encryption with a bit of time.

                                        Mike...

---

From: Guy Maor <[email-masked]>
Date: Wed, 14 Aug 1996 18:10:41 -0500 (CDT)

> crack the DES encryption with a bit of time.

Those programs you mention crack accounts file by guessing the actual
password, encrypting that with all the salts, and matching it to the
encrypted password.  Guesses of the password include permutations of
the user name, gecos, and a dictionary.  Unfortunately such attacks
often work.

Truly cracking a passwd file would take more than "a bit of time".  Or
maybe you're an extremely patient person.

Guy

---

From: Stephen Masterman <[email-masked]>
Date: Thu, 15 Aug 96 13:05 EDT

>crack the DES encryption with a bit of time.

My understanding of this situation (and please correct me if I'm wrong) is
that the crypt() routine used by passwd is a truly one-way hashing algorithm,
i.e. there simply is no way to go from an encrypted password back to the
original.  Actually, I seem to remember reading that the crypt routine uses
the password in combination with a "random" (based on time of day) string of
bits (called the "salt", can't remember the length, I think it was 12 bits, 
giving 4096 possible encryptions of any given string), and that it uses this
new salt+password as its key in encrypting a string of 0's. Given this, the 
only way to crack the passwords is to compile a dictionary of possible 
passwords, by taking all the likely strings to be used as passwords and 
encrypting each one 4096 times, once for each salt.  Once you have this 
dictionary made, it can be distributed to anyone to use as the foundation of
their crack attack, but if you wish to hack someone personally, i.e. by 
checking their first name, etc., you'll have to add these to the dictionary
(unless common names are also part of the original dictionary). And it should
be plain how anyone with reasonable password-selection skills can be pretty
much immune to this attack, e.g. by using non-word strings, by having 
punctuation, by varying the case of your characters, etc.  If the max passwd
length is 8 bytes, then at a quick estimate it seems that there are 
256^8 * 4096 different possible passwords...?

I think this is a fascinating subject, I hope I haven't gotten it too wrong.
Please reply with corrections.

Thanks,
Steve

---

From: "Brian C. White" <[email-masked]>
Date: Thu, 15 Aug 1996 17:26:03 -0400

> original.

Correct.

> Actually, I seem to remember reading that the crypt routine uses
> encrypting each one 4096 times, once for each salt.

Because the same salt must be used on verification as on generation, the
salt is stored as the first two characters of the 13 character encrypted
password is thus easily obtained.  Without this, there would be no way
to verify a password other than trying it 4096 different ways.

> Once you have this
> (unless common names are also part of the original dictionary).

The "Crack" program automatically adds such words (obtained from user-info
and any readable files from the user's directory).

> And it should

Right, but most people don't do this.  It's usually a word or some simple
permutation of a word.  Crack tries the with different cases, backwards, 
"1" instead of "i", "0" instead of "o", etc.

If a password were a random sequence of characters, they would be nearly
unbreakable, but then people would have to write them down somewhere and
that is an even bigger security risk in many ways.

                                        Brian
                               ( [email-masked] )

-------------------------------------------------------------------------------
    In theory, theory and practice are the same.  In practice, they're not.