Home > Md5 cracking, PHP > MD5 cracker [1]

MD5 cracker [1]

August 18th, 2008

There are many functions perform their job but each programmer is capable of making them up as what as he want for arrives his goal , for forwarding my previous post here I wrote such a simple MD5 cracker for proving my saying . it starts with introducing two new functions str_shuffle() and substr() . the first one :

Take a look at php.net :

Randomly shuffles a string
string str_shuffle ( string $str )str_shuffle() shuffles a string .

Pay attention to shuffles word … the function shuffles the input gotten , after shuffling the ideal length must be selected ( this utility length is given by user ) . and sub_str() helps us :

substr — Return part of a string
string substr ( string $string , int $start [, int $length ] )
Returns the portion of string specified by the start and length parameters.

I’m not gonna explain of those this is your job , making our function :

1
2
3
4
5
6
function shuffle_str ( $length ) {
global $str;
$random = str_shuffle($str);
$return = substr($random,0,$length);
return $length;
}

I used global because the ” $str ” variable has been or being filled out of user defined function … and 3 input variables :

1
2
3
$password=$argv[1];  #=> Put Your MD5 For Crack
$length=$argv[2];  #=> Set Lent
$str=$argv[3];  #=> Set Your String

They are clear indeed , let you see the loop :

1
2
3
4
5
6
while(1){
$pass = shuffle_str($length);
$hash = md5($pass);
print "trying\n";
if ($hash == $password){
die("\n\n [ + ] Hash Cracked Successfully\n"); }}

The while() never accedes number 1 and causes the loop carries on until the condition returns TRUE ! and what does the while do ? each time the loop is begun , the shuffle_str() function defined attempts to create new string , at next setup goes into ” $hash ” variable being made hashing by MD5() then the password given to crack is equaled to ” $hash ” , as TRUE return script ends ! Here is the full code of MD5 cracker :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/php -q
<?php
/*
[ + ] A Simple MD5 Hash Cracker ver 1.0
[ + ] Coded By Sc0rpion Public Version
[ + ] Aria Security TeaM / WwW.Aria-Security.Net
*/
set_time_limit(0);
error_reporting(0);
if ($argc!=4){
$usage=str_repeat('=',40);
echo "\n+$usage+\n".
" [ + ] MD5 Cracker Consol Mod \n".
" [ + ] Coded by Sc0rpion ! \n".
" [ + ] Use : php $argv[0] [MD5-Hash] [Length-of-random-strings] 
[Your Own String] \n".
"+$usage+\n\n";
exit();
}else{
$password=$argv[1];  # -&gt; Put Your MD5 For Crack
$length=$argv[2];  # -&gt; Set Lent
$str=$argv[3];  # -&gt; Set Your String
$attempt = 0; # =&gt; This is just for understand attempts
function random_password($chars){
global $str;
$random = str_shuffle($str);
$select = substr($random ,0 , $chars);
return $select;
}
while(1){
$attempt++;
$pass = random_password($length);
$hash = md5($pass);
print "trying\n";
if ($hash == $password){
echo "\n\n [ + ] Hash Cracked Successfuly\n".
" [ + ] Password is : $pass\n".
" [ + ] Hash is : $hash\n".
" [ + ] After $attempt attempts !\n";
die (" [ + ] Coded By Scorp!0n !\n\n");
}}}
?>

AS I told it’s very simple and weak but showed manner of cracker scripts and how do they work BUT this ordinary might be developed and becomes the advanced . I’ve coded a advanced one which has many options and works with config.ini ( some options like brute forcing by passlist file and … ) , I’ve explained the most important notes … and the written Persian journal’s loading here , written by Sc0rpion at soundless f*cking night ( to be continue ) .

Md5 cracking, PHP , , , , ,

  1. August 18th, 2008 at 19:30 | #1

    This is not useful actually nothing to do with this script .

  2. admin
    August 18th, 2008 at 19:31 | #2

    As I told ya , “AS I told it’s very simple and weak …. ”
    has continue … be patient !

  1. No trackbacks yet.