#!/usr/bin/perl use strict; use warnings; use Tk; my $version = "0.1b"; my $dir; my $dir1; my $file = "./"; my $enc; my $out = "0"; my $username; my $underlined = "-" x 25; my @user = ("Username\n", "$underlined\n\n"); my @passwd = ("Passwort\n", "$underlined\n\n"); my $try; my $line; my $test; my $count; my $i = "0"; my $prob = "1"; my $passwd_ok = "0"; my $passwd_fail; my $out_new; #Offene Konsole in Windows vermeiden BEGIN { if ($^O eq 'MSWin32') { require Win32::Console; Win32::Console::Free(); } } #Main Window erzeugen my $main = MainWindow->new(-background => 'blue'); $main->configure(-title => "Brutie $version"); #Frames erzeugen my $f1 = $main->Frame()->pack(-side => 'top'); my $f2 = $main->Frame()->pack(-side => 'bottom'); my $f3 = $main->Frame()->pack(-side => 'bottom'); my $f4 = $main->Frame(-background => 'pink')->pack(-side => 'bottom', -side => 'left'); my $f6 = $main->Frame(-background => 'yellow')->pack(-side => 'bottom', -side => 'right'); #Inhalte erzeugen my $text= $f1->Label(-text => "Brutie $version", -width => '35', -background => 'red')->pack(); my $text3 = $f4->Entry(-background => 'green', -textvariable => \$dir)->pack(-side => 'top'); my $text2 = $f6->Button(-text => 'Wörterliste', -background => 'pink', -activebackground => 'pink', -command => \&openword, -width => '10')->pack(); my $text3 = $f4->Entry(-background => 'green', -textvariable => \$dir1)->pack(-side => 'bottom'); my $text4 = $f6->Button(-text => 'Passwortdatei', -background => 'yellow', -activebackground => 'yellow', -command => \&openpasswd, -width => '10')->pack(); my $text0 = $f3->Button(-text => 'Scan!', -command => \&brutie, -width => '25', -background => 'green', -activebackground => 'yellow')->pack(); MainLoop(); sub openword{ my $wordlist = $main->FileSelect(-directory => $file); $dir=""; $dir = $wordlist->Show; } sub openpasswd{ my $passwd = $main->FileSelect(-directory => $file); $dir1=""; $dir1 = $passwd->Show; } sub brutie { @passwd = (); @user = (); my @user = ("Username\n", "$underlined\n\n"); my @passwd = ("Passwort\n", "$underlined\n\n"); unless (-f $dir) { my $popup = $main->Toplevel(); my $in = $popup->Label(-text => "Die Wortliste \"$dir\" existiert nicht!\nBitte eine neue Wählen.")->pack();   }  unless (-f $dir1) { my $popup = $main->Toplevel(); my $in = $popup->Label(-text => "Die Passwortdatei \"$dir1\" existiert nicht!\nBitte eine neue Wählen.")->pack();   } open(PASSWORTFILE, $dir1) || die "Fehler: Kann $dir1 nicht öffnen:$!"; while() { ($username, $enc)=split(/:/); open (WORTLISTE, $dir) || die "Fehler: Kann $dir nicht öffnen: $!"; my $user ="$username\n"; if ($enc eq "" && $username ne "") { push @user, $user; push @passwd, "Kein Passwort\n"; $prob = "1"; $passwd_ok++; } while (defined ($line = )) { chomp $line; $try=crypt($line, $enc); $test=crypt($username, $enc); if ($enc eq '*' or $enc eq '*************' or $enc eq 'x' or $enc eq '!' or $enc eq '!!') { $out++; } elsif($try eq $enc) { my $new_passwd = "$line\n"; push @user, $user; push @passwd, $new_passwd; $prob = "1"; $passwd_ok++; } elsif($test eq $enc) { push @user, $user; push @passwd, $user; $prob = "1"; $passwd_ok++; } else {             push @user, $user;                   push @passwd, "Nicht geknackt...";                         $passwd_fail++;         $prob = "1"; } } } if ($prob) { $out_new = $out / 7; my $up = $main->Toplevel(); $up->configure(-title => 'Brutie Ergebnisstabelle'); my $table1 = $up->Frame()->pack(-side => 'top'); my $table2 = $up->Frame()->pack(-side => 'top'); my $table_down = $up->Frame()->pack(-side => 'bottom'); my $table3 = $table2->Frame()->pack(-side => 'left'); my $t1 = $table1->Label(-text => "Brutie Ergebnisstabelle\n", -width => '81', -background => 'red')->pack(); my $frame = 40; my $t3 = $table3->Label(-text => "@user", -anchor => 'w', -width => "$frame", -background => 'yellow')->pack(-side => 'left'); my $t4 = $table3->Label(-text => "@passwd", -anchor => 'w', -width => "$frame", -background => 'pink')->pack(-side => 'left'); my $t5 = $table_down->Label(-text => "Geknackte Passwörter: $passwd_ok\n", -background => 'orange', -width => '81')->pack(); my $passwd_fail_new=$passwd_fail-$out_new; my $t6 = $table_down->Label(-text => "Nicht geknackte Passwörter: $passwd_fail_new\n", -background => 'orange', -width => '81')->pack(); my $t7 = $table_down->Label(-text => "Abgeschaltete Dienste: $out_new\n", -background => 'orange', -width => '81')->pack(); } else { my $pop = $main->Toplevel(); my $inside = $pop->Label(-text => "Keine Übereinstimmenden Passwörter!", -background => 'red')->pack(); } close(PASSWORTFILE); close(WORTLISTE); }