Jump to content

MD5 and Salt Help


ipwnzphp

Recommended Posts

Retrieve the clients password in MD5 hash format. The hash uses the format "md5(salt.pw):salt" and so the salt can be obtained from the 5 characters after the colon (:) for you to be able to generate your own hash to compare. I am using WHMCS 4.0

 

$md5this =  $sd[1] . "." . "123456";

Outputs: voc)N.123456

 

$md5this =  $sd[1] . "." . "123456";

echo md5($md5this).":".$sd[1];

Outputs: ff9c65abaa070404a3274d4aaad6224a:voc)N

 

Now what's in the database is this: 58a9eeb60f1f6500a93a1bf494dec24c:voc)N

 

But what I need to get is this [upw] => 4d75fa2015aabf5620c050a85321bf27

 

I don't fully understand the salt and stuff. but does anyone see whats going on here?

Link to comment
https://forums.phpfreaks.com/topic/171902-md5-and-salt-help/
Share on other sites

thanks, ok but now they are some how getting 4d75fa2015aabf5620c050a85321bf27 from md5("voc)N"."58a9eeb60f1f6500a93a1bf494dec24c");

 

when i login using the username [email protected] with the password 123456 i get the password hash of the 4d75fa2015aabf5620c050a85321bf27 stored in a session.

Link to comment
https://forums.phpfreaks.com/topic/171902-md5-and-salt-help/#findComment-906808
Share on other sites

Post your code.

 

P.S. It seems PHP is pwning you more then you PHP ;)

 

  $sds =  $results["password"];

  $sd = explode(":", $sds);

  $hash =  $sd[1];

  $pass = "123456";

  echo md5($hash.$pass);

 

In order to authenticate someone you need to take the same steps you took when he signed up so if during signup you used:

 

md5($salt . $password) . $salt

 

Then that is the same code you need to use during authentication

Link to comment
https://forums.phpfreaks.com/topic/171902-md5-and-salt-help/#findComment-906821
Share on other sites

is how it is stored in the database 58a9eeb60f1f6500a93a1bf494dec24c:voc)N

 

So how are they getting 4d75fa2015aabf5620c050a85321bf27 for the users password when logging?

 

58a9eeb60f1f6500a93a1bf494dec24c:voc)N in the database is wrong and completly defeats the purpose of hashing.

Link to comment
https://forums.phpfreaks.com/topic/171902-md5-and-salt-help/#findComment-906831
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.