Making Toggles
#1
I am trying to generate 1-15 toggle rules.

I totally understand this is probably overkill and it defeats the purpose of this “optimised” attack, but I am just playing about with it as a sort of hobby. I only use very small wordlists so I can use these rules in a reasonably short attack time.

I am using these instructions for maskprocessor.

Code:
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles1.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles6.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles7.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles8.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles9.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles10.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles11.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles12.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles13.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles14.rule
$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

$ mp32.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles15.rule

I am using atoms optimisation script.

Code:
#!/usr/bin/perl

use strict;
use warnings;

my $db2;

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

  my $db1;

  my $line_len = length ($line);

  my $i;

  for ($i = 0; $i < $line_len; $i += 2)
  {
    my $t = substr ($line, $i, 2);

    last if (exists $db1->{$t});

    $db1->{$t} = undef;
  }

  next if ($i < $line_len);

  my @sorted_keys = sort keys %{$db1};

  my $sorted_keys_s = join ("", @sorted_keys);

  next if (exists $db2->{$sorted_keys_s});

  $db2->{$sorted_keys_s} = undef;

  print "$line\n";
}

What seems to be happening is that I generate up to 8 toggles fairly quickly but then things slow down to a crawl, I am talking running it for many days. I suspect it is all to do with the duplicate checking script. I suppose it is quite a task to check for all the possible combinations that could collide, but should it be taking this long ?

Anyone have an idea how I can speed this up or do I have to just leave it running ?
Reply
#2
this script was made for the use up to 5 toggles, not more, and it works on there. ofc this can be written much more efficient.
Reply
#3
(01-08-2012, 12:25 PM)atom Wrote: this script was made for the use up to 5 toggles, not more, and it works on there. ofc this can be written much more efficient.

OK ,I see. I am not clever enough to optimise it but I am wondering if I am wasting time waiting for it to complete ?

I don't mind leaving it running if it will eventually finish but if there is no chance it will then I will stop it.

Thanks.
Reply
#4
hard to say, but i guess it will start to swap sooner or later.
Reply
#5
Well this has run for 9 days and I don't think it is getting any further. Sorry about that. I will take a look at what it has made and share the extra ones made over 5 toggles.

Looking at this code I have no idea how you work all this out atom, you are a genius !!
Reply