-->

phpass上的身份验证失败从某些phpBB3的密码?(phpass fails on Authen

2019-10-30 05:51发布

无论使用的phpass测试程序http://www.openwall.com/phpass/phpass-0.3.tar.gz或Python-phpass,并使用C * |?Y [J“KQ”%GF的明文密码和$ P $ 9kS6tD8tVxajypvJ5837.bt2emepD8 /作为散列,这样做:

<?php
#
# This is a test program for the portable PHP password hashing framework.
#
# Written by Solar Designer and placed in the public domain.
# See PasswordHash.php for more information.
#

require 'PasswordHash.php';

header('Content-type: text/plain');
$t_hasher = new PasswordHash(8, FALSE);
$correct2 = 'C?*|Y[j"KQ\'%gf';
$hash2 = '$P$9kS6tD8tVxajypvJ5837.bt2emepD8/';
print 'Hash: [' . $hash2 . "]\n";
print 'correct: [' . $correct2 . "]\n";

$check = $t_hasher->CheckPassword($correct2, $hash2);
if ($check)
    {
    print "Check IF THIS WORKScorrect: '" . $check . "' (should be '1')\n";
    }
else
    {
    print "IT FAILED!!!!!!!!\n\n\n";
    }
?>

哈希是从。中文(3.0.10),当我提供该密码。中文,它正常工作。

。中文是应该使用phpass本身,做$ H $,而不是$ P $。

在phpBB3的数据库条目这个例子是:

qlc4pi000000 “; 0;” 127.0.0.1 “; 1351902499;” testpass “;” testpass “;” $ H $ 9kS6tD8tVxajypvJ5837.bt2emepD8 / “; 1351902499; 0;” tp@inva.lid.com “; 266402289712;” '' “1351902544; 1351902499; 0;” '' “;” '' “; 0; 0; 0; 0; 0; 0; 0;” EN “; 0.00; 0;” DM d,Y G:IA“; 2; 0; “ ''”; 0; 0; 0; 0; -3; 0; 0; “T”, “d”; 0; “T”, “A”; 0; 1; 0; 1; 1; 1; 1; 230271; “ ''”; 0; 0; 0; “ ''”; “ ''”; “ ''”; “ ''”; “ ''”; “'”;” '' “;” '' “;” '' “;” '' “;” '' “;” '' “;” '' “;”' “;” bf4ae169a5a21313" ; 1; 0; 0

在phpBB3的使用的明文口令可以是[C * | Y [J“KQ'%GF]和散列(从phpBB3的格式转换为[$ P $ 9kS6tD8tVxajypvJ5837.bt2emepD8 /](均密码散列&是间[] )

任何人都可以阐明这是怎么回事了一些光,为什么这并不phpass工作? 这是在同一台机器,该论坛是上,并再次,它的。中文论坛的工作,这样我就可以登录罚款。 它只是我不能phpass当我直接访问数据库。中文认证外部。 它不会对其他帐户的工作,虽然,这只是它失败在某些帐户。

Answer 1:

原来的问题是,phpBB3的转换使用HTML转义码的密码。

现在,一旦密码被转换,它存储在phpBB3的哈希相匹配。



Answer 2:

该phpBB3的最有可能的应用PHP函数用htmlspecialchars (无标志)的密码。

这实际上是由phpBoing注意到还注意到问题的讨论https://stackoverflow.com/a/12543884/1148030 。

非标准标识符$ H $是有用的。 当$ H $是目前实现可以知道使用转义支持。中文。



文章来源: phpass fails on Authentication on certain passwords from phpBB3?