Auteur Sujet: [Bridge][SMF][wip]  (Lu 1283 fois)

Skullfox

  • Newbie
  • *
  • Messages: 2
    • Voir le profil
[Bridge][SMF][wip]
« le: 07 mars 2017, 08:42:05 »
Hello,
im almost finished my SMF2MUSH class.

#Edit
https://github.com/Skullfox/smf2mush

How SMF generates the hash:

$hash = sha1(strtolower($user) . $pw);
Im decrypting the mushraider pw like showed in the example:
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$pwd = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $salt, stripslashes($_POST['pwd']), MCRYPT_MODE_ECB, $iv);


Now the following happens,

Login: dev1
PW: dev1

What i expect:
sha1(strtolower("dev1") . "dev1");returns
2410765d412f626d0818926a1e50def5c7f6f6c2
Thats the correct one.


$pwd = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, ....$pwd contains now "dev1" as string but if i do:

$hash = sha1(strtolower( $_POST["login"] ) . $pwd);
I got:
f502db2d58871225893deec88650330b822474a2
The $pwd var causes the error.

Any ideas ?


EDIT

Found the solution, facepalm....

$hash = sha1(strtolower( $_POST["login"] ) . trim($pwd) );
fixed it.

Gonna publish the class on github when im home.

Cya Phil
« Modifié: 14 mars 2017, 08:36:39 par Skullfox »

Skullfox

  • Newbie
  • *
  • Messages: 2
    • Voir le profil
Re : [Bridge][SMF][wip]
« Réponse #1 le: 08 mars 2017, 14:18:59 »
Work in progress

https://github.com/Skullfox/smf2mush

Info:
PHP Deprecated:  Function mcrypt_get_iv_size() is deprecated
PHP Deprecated:  Function mcrypt_create_iv() is deprecated
PHP Deprecated:  Function mcrypt_decrypt() is deprecated

These commands will be mostly removed in the next PHP 7.2 update, if i have no time to update the class, someone only need to modify the decryptMush() function.
« Modifié: 08 mars 2017, 14:24:29 par Skullfox »

Mush

  • Mushraider
  • Administrator
  • Hero Member
  • *****
  • Messages: 768
  • Meh.
    • Voir le profil
    • MushRaider
Re : [Bridge][SMF][wip]
« Réponse #2 le: 27 avril 2017, 09:30:27 »
Thank you =)

Didn't notice they will be deprecated, will need to find something to replace them
MushRaider - modern raid planner for modern raiders
Me suivre sur  twitter and Google+
Soutenir le projet et me payer une bière =)