the last unbiased stronghold

grubbrute.txt

grubbrute.txt
Posted Jun 23, 2008

This is a GRUB bootloader password cracker. It finds the MD5 hashes in the /boot/grub/menu.lst and when given a dictionary list it does its magic! (needs the passwdmd5 perl module).

tags | cracker, perl
MD5 | ac5ffebfa346a0c505b2b33450e4b194

grubbrute.txt

Change Mirror Download
#!/usr/bin/perl 
use Crypt::PasswdMD5;

open(FG, "/boot/grub/menu.lst") || die "Problem opening /boot/grub/menu.lst !\n";
for ($count=0, $ct=0; <FG>;){
if (/^title\s+(.+)/) { $title[++$ct]=$1; $tline=$. }
if (/^password --md5 (\S+)/) { $md5hashes[++$count] = $1; $hashline=$. }
if ( $tline+1 == $hashline && $. == $hashline ) { print "MD5crypt hash for $title[$ct]: $md5hashes[$count]\n" }
if ( eof(FG) && $count==0 ) { print "GRUB is not using password authentication!" }
}



close(FG);

print"\n";

open(DC, "$ARGV[0]");

if ($count > 0) { print "Using dictionary $ARGV[0] to crack GRUB passwords...\n\n" }

for($y=1; $y<=$count; $y++){

while ($line=<DC>) {
chomp($line);
if ( $md5hashes[$y] =~ /\$1\$(.....)\$\S+/ ) { $salt=$1; }
$genhash = unix_md5_crypt($line, $salt);
if ( $genhash eq $md5hashes[$y] ) { print "Password for $title[$y+1]: $line \nMD5hash for $title[$y+1]: $md5hashes[$y]\n"; last; }

}

seek(DC,0,0);

}

close(DC);

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close