4 Einträge, 1 Seite |
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/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(<PASSWORTFILE>)
{
($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 = <WORTLISTE>))
{
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);
}
1
2
3
my @array = qw(user1 user2 user3 user2 user4 user1);
my %seen;
my @unique = grep{!$seen{$_}++}@array;
1
2
3
4
5
6
7
8
9
10
11
12
#! /usr/bin/perl
use strict;
use warnings;
my @array = qw(user1 user2 user3 user2 user4 user1);
my @passwd = qw(pass1 pass2 pass3 pass2 pass4 pass1);
my %seen;
my @unique = grep{!$seen{$array[$_]}++}(0..scalar(@array)-1);
for(@unique){
print $array[$_],"\t",$passwd[$_],"\n";
}
4 Einträge, 1 Seite |