Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # hcmasks.pl by epixoip
- # calculates hashcat mask for each word, then sorts and prints masks in desc order
- use strict;
- no strict "subs";
- my %masks = ();
- sub desc {
- $masks{$b} <=> $masks{$a};
- }
- while (<STDIN>)
- {
- chomp;
- my $mask;
- my @line = split(//);
- foreach my $char (@line)
- {
- if ($char =~ /[a-z]/) {
- $mask .= "?l";
- }
- elsif ($char =~ /[A-Z]/) {
- $mask .= "?u";
- }
- elsif ($char =~ /[0-9]/) {
- $mask .= "?d";
- }
- elsif ($char =~ /[\W_]/) {
- $mask .= "?s";
- }
- }
- $masks{$mask}++;
- }
- foreach my $mask (sort desc(keys(%masks)))
- {
- printf("%10d %s\n", $masks{$mask}, $mask);
- }
Add Comment
Please, Sign In to add comment