testpass2.phps

#!/usr/bin/php5 -q
<?
// testpass2.php
// The script use a dictionary to test all words against the accounts in a standard tbsource-database
// hellfairy - http://packy.se/
set_time_limit(0);
mysql_connect('localhost','username','password');
mysql_select_db('database');
$dictionary = 'SAOL12.txt';

$wordf=file_get_contents($dictionary);
$words=explode("\n", $wordf);

$res = mysql_query('select username,id,class,secret,passhash from users order by id asc');
while($data=mysql_fetch_assoc($res))
{
  foreach($words as $word)
  {
    if(md5($data[secret].strtolower($word).$data[secret]) == $data[passhash])
    {
      echo "The key ".strtolower($word)." passed for user ".$data[username]." (".$data["id"]."/".$data["class"].")!!!\n";
      continue;
    }
  }
}


?>