10-19-2012, 06:07 PM
Btw, I wrote this perl script to make the charactersets out of the usernames list, you don't need to chop them or anything, just do:
CiscoASA.pl:
It still feels a bit cheesy for me so expect any bugs!
Code:
perl CiscoASA.pl < usernames
CiscoASA.pl:
Code:
#!/usr/bin/perl
# extracts 4 character-sets basesd on given usernames list for *MD5 Cisco ASA* algorithm, written by malik51
#use v5.14;
use strict;
use warnings;
if (scalar(@ARGV) != 0) { die("usage: $0 < usernames\n"); }
sub uniq {
my %seen;
my @newarray;
foreach my $item (@_) {
unless ($seen{$item}) {
push(@newarray, $item);
$seen{$item}++;
}
}
undef(%seen);
return @newarray;
}
my @_1_chararr;
my @_2_chararr;
my @_3_chararr;
my @_4_chararr;
while (my $line = <STDIN>) {
chomp($line);
next if (length($line) < 4);
push(@_1_chararr, substr($line, 0, 1));
push(@_2_chararr, substr($line, 1, 1));
push(@_3_chararr, substr($line, 2, 1));
push(@_4_chararr, substr($line, 3, 1));
}
for my $i (1 .. 4) {
my $u = $i - 1;
eval '
@_' . $i . '_chararr = uniq(@_' . $i . '_chararr);
open(CHARSET' . $i . ', \' > charset' . $i . '.txt\') || die(\'charset' . $i . '.txt: \' . lc($!) . "\n");
print CHARSET' . $i . ' join(\'\', @_' . $i . '_chararr);
print STDOUT \'CHARSET' . $i . ' written to .\charset' . $i . '.txt successfully...\' . "\n";
';
warn($@) if ($@);
}
print STDOUT "\nuse:\n" . '-1 .\charset1.txt -2 .\charset2.txt -3 .\charset3.txt -4 .\charset4.txt ... ?1?2?3?4' . "\n";
exit(0);
It still feels a bit cheesy for me so expect any bugs!