MD5 Hashing Insecure

Hello Man:

Have you figure what your problem is?.. remember that you are comparing a string so the login and the password must be enclosed in single quotes… the sc_sql_injection function encloses the login but the password is not… so change your SQL statement to:


$slogin = sc_sql_injection({login});
$spswd = hash('sha512',{pswd});

$sql = "SELECT
s.priv_admin,
s.active,
s.name,
s.email,
s.emp_id,
s.comp_id,
e.c_member,
s.group_id
FROM sdh_sec_users s
join emp_comp_access e on e.login = s.login and s.comp_id = e.c_member
WHERE e.login = ".$slogin."
AND s.pswd = '".$spswd."'";

sc_lookup(rs, $sql);

regards

Adding to kafe post. The reason you don’t need to enclose $slogin on single quotes is due to sql_injection macro, but you are not using it on $spswd, then, you have to enclose on single quotes $spswd to be a string on the SQL

Thanks guys, all is working now!

If you go to the routine in the application you can change it any way you like. A tutorial is too much, you’ll find loads of samples here: http://www.w3schools.com/php/func_string_sha1.asp

Thank you Albert, I used sha512 and everything works fine :slight_smile: by the way, I sent you a mail few days back.

Hi Mike,

I haven’t received that. Will look into my spamboxes.
I haven’t found any messages of you in my spamdrain boxes. When did you send it? Can you send it again to a dot drent at aducom dot com?

b.r. Albert

thank you Albert, i saw your reply, maybe you want to remove your encoded email above, spammers will use it to add the method to their dictionary loool :slight_smile:

They already have it. Have spamdrain on it which works perfectly fine.