WTF?!?!?!
ok I am trying to make amd5 decryptor… here is the code
<?php
$hash=$_POST['crack2'];
$type=$_POST['hash'];
echo ("hash - ".$hash."<br>" );
$fh = fopen("sdict.txt", "r" );
while(!feof($fh)) {
$word = fgets($fh);
echo ("trying - ".$word."<br>" ) ;
if ( md5($word) == $enc ) {
echo "$word is the password!";
break;
}
}
echo "end of dict";
however I am getting dodgy hashes, eg 1234 gets hashed into - ff0eb2864feb22354747f8c85d42ccb5 when it should be - 81dc9bdb52d04dc20036dbd8313ed055
WTF is going on?!? it's not a server problem, I have tested it in various places, I am just stumped!…
any help please?
$enc - sorry my bad edited echoing the word everytime for testing perposes, good job I did otherwise I would have been even more clueless.
and $type is used in my script eg.
if ( $type($word) == $enc ) {
echo "$word is the password!";
break;
}
so I can do sha1, md5 and crypt sent from another form
Zeyphier wrote: $enc - sorry my bad edited echoing the word everytime for testing perposes, good job I did otherwise I would have been even more clueless.
and $type is used in my script eg.
if ( $type($word) == $enc ) {
echo "$word is the password!";
break;
}
so I can do sha1, md5 and crypt sent from another form
OK, that should be your problem. Variables can't be used in the way you've just used $type.
ok so here is the revised code!…
<?php
$hash="81dc9bdb52d04dc20036dbd8313ed055";
// md5 of 1234
echo ("hash - ".$hash."<br>" );
$fh = fopen("sdict.txt", "r" );
while(!feof($fh)) {
$word = fgets($fh);
echo ("trying - ".$word."<br>" ) ;
echo ("trying - ".md5($word)."<br>" ) ;
if ( md5($word) == $hash ) {
echo "$word is the password!";
break;
}
}
echo "end of dict";
?>
I am still getting stupid md5's and here is the contents of the dictionary (well the begining part)
!@*$%
!@*$%^
!@*$%^&
!@*$%^&*
*
0
0racl3
0racl38
0racl38i
0racl39
0racl39i
0racle
0racle10
0racle10i
0racle8
0racle8i
0racle9
0racle9i
1
1022
10sne1
111111
121212
1225
123
123123
1234
12345
hence why I was testing 1234… any sugestions, I will try them all
OMFG, I must be such a tard, I bet it is right in my face!… ARGGGHHH (just had to let that out!)
I had a similar problem when I first attempted to code an MD5 cracker in Perl. The answer (in my case) was quite simple. The files in the dictionary actually end (from the programs point of view), with &*92;n. So the dictionary actually looks like:
apple&*92;n
bear&*92;n
test&*92;n
etc. My mistake was not removing the &*92;n. In Perl this is accomplished via the chomp() or chop(0 functions. Not sure about PHP, but it may be the same.
Actually, now that I think about it, this may not even be your problem. I'm not sure if PHP takes it as word&*92;n. In any case, try it out and see what happens.
GL. ;)
[edit] The site automatically changes the backslash character to &*92; . Maybe this is something that the admins need to be fixing..?[/edit]