newline as input
#3
As epixoip already mentioned, there are many possibilities to do this.

Depending on the attack mode, there are different possibilities. Some work better some work worse in different situations/scenarios

one simple idea (but maybe not the fastest for you) would be to use $HEX[] words. This works also with -a 1 for instance, but as said it won't be the fastest way to do for instance in -a 1 dict1.txt dict2.txt:
Code:
$ cat dict1.txt
# can be any wordlist
$ cat dict2.txt
$HEX[0a]

Another possibility with $HEX[] would be to simply convert the whole word list(s) into $HEX[] after adding the newline, for instance like this (perl code follows):
Code:
#!/usr/bin/env perl

# Author: philsmd (Nov 2014)

# constants

my $SUFFIX = "\n";

# start

if (scalar (@ARGV) < 1)
{
  print "ERROR: You need to specify the dictionary file\n";

  exit (1);  
}

my $dict = $ARGV[0];
my $output = $dict . "_out.txt";

open (IN,  "<", $dict)   or die "Could not open $dict: $!";
open (OUT, ">", $output) or die "Could not open $output: $!";

binmode IN;

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

  if ($line =~ /^\$HEX\[([0-9a-zA-Z]*)\]$/)
  {
    # already $HEX[]

    print OUT $line . "\n";
  }
  else
  {
    my $plain = $line . $SUFFIX;

    my $plain_hex = unpack ("H*", $plain);

    print OUT "\$HEX[$plain_hex]\n";
  }
}

close (OUT);
close (IN);

print "INFO: Successfully saved file to $output\n";

exit (0);


On the other hand, maybe the best method would be to use rules (-r append_0a.rule) in -a 0 mode, where append_0a.rule would contain something like this:
Code:
^[TAB_HERE] +0 {
where you need to replace [TAB_HERE] with a real tab (0x09).

The trick here is, since we can't use 0x0a directly in rule files because it marks of course a new rule line, to prepend a tab, increase the first char i.e. 0x09 to 0x0a and rotate to the left and hence put the 0x0a char with the { rule to the end of the word.

It depends on many factors (maybe also something like disk speed etc), but this last method should be the fastest since rules will be applied by the gpu(s).
Also, you can still use multi-rules (see https://hashcat.net/wiki/doku.php?id=rul...ulti-rules ) in this case the -r append_0a.rule should in general be the last rules you will apply.
In theory, this method could also be the "safest" since with for instance the method I discussed before ($HEX[] word list) it could be possible that some rules truncate the plain (and hence the newline char 0x0a is gone).

On the other hand, with the $HEX[] word list you do not need to apply any rules. If you apply some rules with this method, you risk that the final 0x0a won't end up in the final plain (since manipulated/truncated by some rules).


Messages In This Thread
newline as input - by svenne - 11-21-2014, 11:40 AM
RE: newline as input - by epixoip - 11-22-2014, 06:32 AM
RE: newline as input - by philsmd - 11-22-2014, 12:15 PM
RE: newline as input - by svenne - 11-23-2014, 10:51 PM