PDA

Просмотр полной версии : перловый брутфорс md5


DetMyl
18.12.2005, 01:46
Мне сегодня понадобилось разшифровать пару хэшей от vBulletin 3.0.7, полазив по инету я нашел единственно полезную вещь Здесь (http://forum.antichat.ru/threadnav5456-2-10-salt+vbulletin.html) .
Но так как я предпочитаю перл (и думаю немного побыстрей будет), написал вариант простого брутфорсера для хэшей от vBulletin 3.х. Т.е. расшифровка хэшей созданных по алгоритму md5(md5($pass).$salt)

Если кто-то может улучшить скорость работы скрипта, пишите плс! :rolleyes:
# This is a very simple perl brutforcer for vBulletin 3.x MD5 hashes.
# For usage you need a dictionary file and file with hashes (:-))
# Hashes have to be in this form: "username:hash:salt"
# Good Luck!
#
# (c)DetMyl 17.12.2005, Detmyl@bk.ru

if (@ARGV < 2)
{
print q(
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Usage: perl vB_hash.pl [dictionary file] [username:hash:salt file]
I.e. : perl vB_hash.pl someBigDitionary.dic spizhzhenyeHashy.md5
++++++++++++++++++++++++++++++++++++++++++++++++++ ++
);
exit;
}

use Digest::MD5 'md5_hex';

$hashSaltFile = $ARGV[1];
$dictfile = $ARGV[0];

open (HASHFILE, $hashSaltFile) || die "couldn't open the file $hashSaltFile";

while ($hashes = <HASHFILE>) {
open (DICTFILE, $dictfile) || die "couldn't open the file $dictfile";
($user,$hash,$salt) = split(/:/, $hashes);
$salt =~ s/\n//;
while ($words = <DICTFILE>) {
$words =~ s/\n//;
if ( $hash eq md5_hex(md5_hex($words).$salt)) { print "FOUND!!! user: ".$user." pass:".$words."\n";}

}
close(DICTFILE);
}
close(HASHFILE);

vector
24.12.2005, 19:30
Спасибо это - полезная вещь!

DetMyl
26.12.2005, 15:52
Немного улучшил скрипт: теперь по-умолчению проверяется имя пользователя как пароль, и при нахождении пароля скрипт сразу переходит к следующему хэшу.
# This is a very simple perl brutforcer for vBulletin 3.x MD5 hashes.
# For usage you need a dictionary file and file with hashes (:-))
# Hashes have to be in this form: "username:hash:salt"
# Good Luck!
#
#
# (c)DetMyl 17.12.2005, Detmyl@bk.ru



if (@ARGV < 2)
{
print q(
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Usage: perl vB_hash.pl [dictionary file] [username:hash:salt file]
I.e. : perl vB_hash.pl someBigDitionary.dic spizhzhenyeHashy.md5
++++++++++++++++++++++++++++++++++++++++++++++++++ +
);
exit;
}

use Digest::MD5 'md5_hex';

$dictfile = $ARGV[0];
$hashSaltFile = ($ARGV[1] ne '') ? $ARGV[1] : $ARGV[0];

open (HASHFILE, $hashSaltFile) || die "couldn't open the file $hashSaltFile";


while ($hashes = <HASHFILE>) {
($user,$hash,$salt) = split(/:/, $hashes);
$salt =~ s/\n//;
if ( $hash eq md5_hex(md5_hex($user).$salt)) { print "FOUND!!! user: ".$user." pass:".$user."\n";next} #check with username
open (DICTFILE, $dictfile) || die "couldn't open the file $dictfile";
while ($words = <DICTFILE>) {
$words =~ s/\n//;
if ( $hash eq md5_hex(md5_hex($words).$salt)) { print "FOUND!!! user: ".$user." pass:".$words."\n"; last;}

}
close(DICTFILE);

}
close(HASHFILE);