Multiple wordlist with brute force
#8
it's a very special situation, which requires either a special password generator or a compromise to allow some duplicates for better speed.

The candidate generator could be as simple as this:
Code:
#!/usr/bin/env perl

# Author: philsmd
# Date: June 2020
# License: public domain, credits go to philsmd and hashcat

use strict;
use warnings;

#
# Constants
#

my $NUMBER_DIGITS = 2;
# my $NUMBER_DIGITS = 4;

#
# Start
#

if (scalar (@ARGV) < 1)
{
  print "ERROR: please specify the dict as first command line option\n";

  exit (1);
}

my $dict = $ARGV[0];

my $fh;

if (! open ($fh, "<", $dict))
{
  print "ERROR: could not open the dictionary file\n";

  exit (1);
}

binmode ($fh);

# deduplicate input:

my %words;

while (my $line = <$fh>)
{
  chomp ($line);

  $words{$line} = 1;
}

close ($fh);

my @word_list = ();

foreach my $w (sort (keys (%words)))
{
  push (@word_list, $w);
}

# w + ?d?d?d?d + w + ?d?d?d?d + w

my $out_format = "%s%0" . $NUMBER_DIGITS . "d%s%0" . $NUMBER_DIGITS . "d%s\n";

my $word_count = scalar (@word_list);

my $max_digit = 10 ** $NUMBER_DIGITS;

for (my $i = 0; $i < $word_count; $i++)
{
  for (my $j = 0; $j < $max_digit; $j++)
  {
    for (my $k = 0; $k < $word_count; $k++)
    {
      next if ($k == $i);

      for (my $l = 0; $l < $max_digit; $l++)
      {
        for (my $m = 0; $m < $word_count; $m++)
        {
          next if ($m == $i);
          next if ($m == $k);

          print sprintf ($out_format, $word_list[$i], $j, $word_list[$k], $l, $word_list[$m]);
        }
      }
    }
  }
}

The NUMBER_DIGITS determine if there are 2 digits in between or 4 digits etc.

you could run it as simple as this
Code:
perl verizon_pass_generator.pl dict.txt

(and use > stdout redirects to store it to a file or directly pipe it into hashcat)
Reply


Messages In This Thread
RE: Multiple wordlist with brute force - by philsmd - 06-19-2020, 06:06 PM