Cisco ASA
#16
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:
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!


Messages In This Thread
Cisco ASA - by fuzztester - 10-18-2012, 03:48 PM
RE: Cisco ASA - by unix-ninja - 10-18-2012, 04:15 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 04:43 PM
RE: Cisco ASA - by M@LIK - 10-18-2012, 04:36 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 04:50 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 05:03 PM
RE: Cisco ASA - by M@LIK - 10-18-2012, 05:34 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 05:37 PM
RE: Cisco ASA - by M@LIK - 10-18-2012, 06:21 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 07:47 PM
RE: Cisco ASA - by fuzztester - 10-18-2012, 08:25 PM
RE: Cisco ASA - by Incisive - 10-18-2012, 10:15 PM
RE: Cisco ASA - by M@LIK - 10-18-2012, 09:06 PM
RE: Cisco ASA - by fuzztester - 10-19-2012, 04:05 PM
RE: Cisco ASA - by M@LIK - 10-19-2012, 05:49 PM
RE: Cisco ASA - by M@LIK - 10-19-2012, 06:07 PM