Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Bugtraq
[Top] [All Lists]

RE: [HACKERS] Postgres: pg_hba.conf, md5, pg_shadow, encrypted passwords

Subject: RE: [HACKERS] Postgres: pg_hba.conf, md5, pg_shadow, encrypted passwords
Date: Thu, 21 Apr 2005 17:14:47 -0400

The salt isn't always known...  I don't know how an 
unprivledged user on a system w/ /etc/shadow could get at it 
anyway.  I'm sure alot of people would be very anxious to 
know if you know of a way to do that...

The salt is known, just not by an unpriveledged user. But if you can access
/etc/shadow, then you know the salt and the hashed passwords. 

The salt is added (dunno where in the original string) to the password prior
to hashing. Then the salt is prepended to the hased value and stored
somewhere, in your case, /etc/shadow. 

For a salt to be usable, you have to know what it is. Secure hashes are "one
way" which means that you shouldn't be able to derive the original text
solely from the hash value. To create password: create 2 byte salt from
ASCII -> prepend salt to password -> hash salt+password with MD5 -> prepend
salt to hash value -> store it. To check password: get username and password
-> lookup hash string using username from /etc/shadow -> get salt from hash
value -> hash salt+password with MD5 -> compare value computed hash value
from stored hash value -> If match, user authenticated, if not, user not
authenticated.

So if you hash a password with a salt, and then lose the salt, you can never
check the password again. You have to know salt. 

Since the salt is known, it has no effect on the "keyspace" because you
don't have to guess it.  If there was no salt, then pre-computing a
dictionary is a much smaller task. 

mike



<Prev in Thread] Current Thread [Next in Thread>