I have the string that was used in a webapp with md5 hashing to come up with a hash. I also have the hash. But the md5 of the string doesn't match the hash, so I'm guessing there's a salt involved. Is there any software that can help me determine the salt?
In standard hashing functions (e.g., UNIX passwords in /etc/shadow) the salt is stored as part of the hash.
Pass the stored hash value as the salt and you should get the correct result.
The hashed password value in /etc/shadow is actually a $ delimited record. For example, we have this hash of the password 'blarg':
There are three fields separated by $'s which are
If you use mkpasswd several times the hash will change.
However, by passing in the salt (i.e., the second field) from the hash value above we can match it against the original hash:
You can also pass in the whole password hash (although omitting the hash function).
On Linux the hash type can be controlled in /etc/login.defs. Be very careful when changing this, you can completely lock yourself out of the system. I suggest reading the man page carefully specifically looking at the headings MD5_CRYPT_ENAB and ENCRYPT_METHOD.