php
/**
* This class checks the strength of a MD5 password by trying to decrypt it.
*
*@Author Rochak Chauhan
*/
class PhpMd5Decrypter{
function decrypt($md5){
$md5=trim($md5);
if(strlen($md5)!=32){ die("Invalid MD5 Hash");}
$url="http://www.md5online.org/";
$matches=array();
$html=file_get_contents($url);
$pattern='/<input type="hidden" name="a" value="(.*)">/Uis';
preg_match_all($pattern, $html, $matches, PREG_SET_ORDER);
$a=$matches[0][1];
$res=$this->postDataViaCurl($md5,$a);
$returnArray=array();
$pattern2='/Found (.*) <b>(.*)<\/b><\/span>/Uis';
preg_match_all($pattern2, $res, $returnArray, PREG_SET_ORDER);
$nt=strip_tags(@$returnArray[0][2]);
$nt=trim($nt);
if(empty($nt)){return false;}
return $nt;
}
/**
*Function to post variables to a remote file using cURL
*
*@author Rochak Chauhan
*@param string $url
*
*@return string
*/
private function postDataViaCurl($md5,$a){
$url="http://www.md5online.org";
$cookiejar = "text.txt";
$parameters=array();
$parameters['md5']=$md5;
$parameters['search']="0";
$parameters['action']="decrypt";
$parameters[]="Decrypt";
$parameters['a']=$a;
}
?>