[Full-disclosure] MD5 "decrypter" PHP Script

2010-11-28 Thread Bob Smith
I use the word "decrypter" loosely, but it is what the site's
advertising it to be.

So I wrote a PHP script that takes hashes from a database
(columns are as such: id, hash, unhashed)
and checks them against md5-decrypter.com and md5decryption.com

these sites have no captcha protection (and over 4.7mil stored hashes)

http://md5-encryption.com/";, "data[Row][clear]", 
$plaintext);
}

if($num !=2){
give_back("http://md5encryption.com/";, 
"submit=Encrypt%20It!&word",
$plaintext);
}
}
function fetch_md5($url, $post, $start, $end, $trim, $hash){
$posted_vars = $post . "=" . $hash;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $posted_vars);
$fetched_page = curl_exec($ch);
curl_close($ch);
unset($ch);

$password = get_string_between($fetched_page, $start, $end);

if(isset($trim) && !empty($trim)){
$password = substr($password, $trim);
}

return $password;
}

function update_plaintext($table_name, $id_field, $row_id, $plaintext,
$dehashed){ //table name, table id field, row id value, the table
plaintext field, the dehashed password
$sql = "update $table_name set $plaintext = '$dehashed' where
$id_field = '$row_id'";
mysql_query($sql);
}

while($row = mysql_fetch_array($result)){

$password1 = fetch_md5("http://md5-decrypter.com/";,
"data[Row][cripted]", "Decrypted text:", "", "21",
$row[$table_hash]);

if(!empty($password1)){
update_plaintext($db_table, $table_id_field, 
$row[$table_id_field],
$table_plaintext, $password1);
if($giveback == "1"){
do_except("1", $password1);
}
continue;
}

$password2 = fetch_md5("http://md5decryption.com/";,
"submit=Decrypt%20It!&hash", "Decrypted Text: ", "",
"", $row[$table_hash]);

if(!empty($password2)){
update_plaintext($db_table, $table_id_field, 
$row[$table_id_field],
$table_plaintext, $password2);
if($giveback == "1"){
do_except("2", $password2);
}
continue;
}

}
?>
http://pastebin.com/idGqmqAg

___
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/


Re: [Full-disclosure] MD5 "decrypter" PHP Script

2010-12-09 Thread Jerome Athias
I did a quite similar script for oscommerce, more in a rainbowtables
building way.

$password = md5($salt . $plain) . ':' . $salt;

http://pastebin.com/mtciPcTM

Regards
/JA

http://www.linkedin.com/in/jeromeathias
"The computer security is an art form. It's the ultimate martial art."



smime.p7s
Description: S/MIME Cryptographic Signature
___
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/