Morph - Hashcat_utils
#8
OK, I finished a perl version capable of doing width > 3. It works, but is a lot slower than the C version. Have fun, it works pretty nice Smile

Code:
#!/usr/bin/env perl

use strict;
use warnings;

my @intpos_to_rulepos =
(
  '0', '1', '2', '3', '4',
  '5', '6', '7', '8', '9',
  'A', 'B', 'C', 'D', 'E',
  'F', 'G', 'H', 'I', 'J',
);

my $function = "i";
#my $function = "o";

if (scalar @ARGV != 5)
{
  print "usage: $0 dictionary depth width pos_min pos_max\n";

  exit -1;
}

my ($dictionary, $depth, $width, $pos_min, $pos_max) = @ARGV;

if ($width > 20)
{
  print "width > 20\n";

  exit -1;
}

for (my $pos = $pos_min; $pos <= $pos_max; $pos++)
{
  my $table;

  open (IN, $dictionary) or die "$dictionary: $!\n";

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

    my $len = length $line;

    next if (($len - $pos) < $width);

    my $word = substr ($line, $pos, $width);

    next unless defined $word;

    $table->{$word}++;
  }

  close (IN);

  my @keys = sort { $table->{$b} <=> $table->{$a} } keys %{$table};

  for (my $i = 0; $i < $depth; $i++)
  {
    my @chars = split "", $keys[$i];

    my @rule;

    for (my $j = 0; $j < $width; $j++)
    {
      my $step = join "", $function, $intpos_to_rulepos[$pos + $j], $chars[$j];

      push @rule, $step;
    }

    print join (" ", @rule), "\n";
  }
}

I will add it to hashcat-utils as morph2.pl
Reply


Messages In This Thread
Morph - Hashcat_utils - by tony - 08-15-2012, 11:05 PM
RE: Morph - Hashcat_utils - by M@LIK - 08-15-2012, 11:29 PM
RE: Morph - Hashcat_utils - by mastercracker - 08-16-2012, 02:19 PM
RE: Morph - Hashcat_utils - by tony - 08-16-2012, 10:19 PM
RE: Morph - Hashcat_utils - by atom - 08-17-2012, 11:35 AM
RE: Morph - Hashcat_utils - by mastercracker - 08-17-2012, 02:07 PM
RE: Morph - Hashcat_utils - by atom - 08-17-2012, 07:47 PM
RE: Morph - Hashcat_utils - by atom - 08-20-2012, 03:17 PM
RE: Morph - Hashcat_utils - by korsa741 - 08-23-2012, 06:28 PM
RE: Morph - Hashcat_utils - by mastercracker - 08-29-2012, 02:45 PM