This page was already viewed 627times
When working in offensive Cybersecurity a.k.a hacking/pentesting, one of the most well known attack consists in trying to crack credentials by testing multiple string/passwords until a match. This technic is commonly called brute-force. Multiple powerfull tools exists to run a bruteforce attack on a file, database or even a website, such as Hydra, John The Ripper, Ophcrack, Hashcat and many others. They almost all relies on dictionnaries or words generation algoithms.
In this context, it is important to have a good and powerfull word generator that may quickly builds customized wordlists depending on the needs.
*The Finseckto high speed word generatorFinseckto provides this high speed word generator, written in perl script, that may be used as input of bruteforce tools in bruteforce or dictionnary modes. This script is specifically designed for very high speed, in order to very quickly produce wordfiles or dictionnary entries. This implementation make uses of the matrix principle to build reuslts very quickly based on Random Access Memory (RAM) usage. However, this performance gain is done at a price of a very high memory cost (RAM).
This implementation, by default, produces words from 74 symbols set but this is very easily configurable.
*Performance assessmentWith 8Go RAM: this implementation produces, almost instantly, all possible 5 characters words in a 74 symbols set (a-z,A-Z,1-9) before overflow.
The following imlementation is the perl script designed to produce an high speed word generator based on RAM usage.
Lets create a file called 'wordgen.pl', and write the following code in it.
#!/usr/bin/perl # High speed & Optimized Word Generator # Words including [a-z][A-Z][1-9]. # Based on RAM usage: 8GB RAM goes to 5 characters. # Copyright @RemsFlems (finseckto) sub combine { return unless defined wantarray; die if @_ < 2; return if @_ == 2 and ! $_[1]; my ($stack, $length, $lengthmax, $out, $OUT_FH, $list) = @_; if ($length < $lengthmax) { close $OUT_FH; } open my $OUT_FH, '>>', 'char_num.txt'; if ($length <= 1) { $out = [] unless defined $out; unshift @{$out}, ''; # print {$OUT_FH} join "\n", @{$out}; close $OUT_FH; return wantarray ? @{$out}: $out; } #open $OUT_FH, '>', 'char_num_under_10.txt' unless defined $OUT_FH; @{$list} = @{$stack} unless defined $list; push @{$out}, @{$stack}; # print {$OUT_FH} join "\n", @{$out}; if ($length == $lengthmax) { print {$OUT_FH} join "\n", @{$out}; print {$OUT_FH} "\n"; } my @newlist; for my $i (0 .. $#{$stack}) { for my $j (0 .. $#{$list}) { push @newlist, join '', ($list->[$j], $stack->[$i]); } } print {$OUT_FH} join "\n", @newlist; print {$OUT_FH} "\n"; combine(\@newlist, $length - 1, $lengthmax, $out, $OUT_FH, $list); } $longueur = 5; $liste = ['a' .. 'z', 1 .. 10, 'A' .. 'Z']; open $OUT_FH1, '>', 'char_num.txt'; close $OUT_FH1; $combinaisons = combine($liste, $longueur, $longueur); # cas 2 # @combinaisons = combine($liste, $longueur); # cas 1
The usage if this wordgen.pl script is pretty simple. The only action to do, excepting having building a wordgen.pl file, is to execute the following command in your commandline prompt.
client@linux:#perl wordgen.pl