Freelancer: carolinasol
Del:
Anmeld Indlæg

Php Hashes

$hashes_file = isset($argv[1]) ? $argv[1] : './hashes.txt'; $cracked_hashes_file = isset($argv[2]) ? $argv[2] : './cracked_hashes.txt'; $cracked_hashes = getHashes($cracked_hashes_file); $matches = checkHashes($cracked_hashes); deleteHashes($matches, $hashes_file); function getHashes($file) { return file($file); } function checkHashes($cracked_hashes) { $matches = array(); foreach ($cracked_hashes as $cracked_hash) { $crackedHash = split(':', trim($cracked_hash)); $hash = $crackedHash[0]; $encrypt = $crackedHash[1]; if (md5($encrypt) == $hash) { $matches[] = $hash; echo($hash . "\n"); } } echo("Matches: " . count($matches) . "/" . count($cracked_hashes) . "\n"); return $matches; } function deleteHashes($matches, $file) { $hashes = file_get_contents($file); foreach ($matches as $match) { $hashes = str_replace($match, '', $hashes); } file_put_contents($file, trim($hashes)); }

Konkurrenceindlæg #2 for Need a php page coded

Offentlig Præciserings Opslagstavle

Ingen beskeder endnu.