Pular para o conteúdo principal

Script Words Generator em português Gerador de Palavras, em perl para


Encontrei um script em perl que faz todo o trabalho por nos.
O script e capaz de fazer varias combinações inclusive de quebrar senha WPA, além de uma grande extensão de palavras. O nome do script em perl e Words Generator no português Gerador de Palavras, salve o script abaixo com a extensão .pl





 #!/usr/bin/perl  
 =head1 NAME  
 wg.pl  
 =head1 AUTHOR  
 Matteo Redaelli  
 E-MAIL: matteo.redaelli@libero.it  
 WEB:  http://digilander.iol.it/reda  
 =head1 DESCRIPTION  
 This is a Word Generator: you can apply some useful options to filter the   
 words  
 =head1 USAGE  
 type  perl wg.pl -h  
 =head1 HISTORY  
 2000-01-06: the first lines of this script  
 2000-01-11 added getopt  
 2000-01-21: adjusted default parameters  
 2002-03-05: new option -n  
 2002-03-06: new option -s  
 2002-03-07: reorganization of all source code, more documentation  
 =head1 LICENSE  
 This package is free software; you can redistribute it and/or  
 modify it under the same terms as Perl itself, i.e., under the  
 terms of the "Artistic License" or the "GNU General Public License".  
 =head1 DISCLAIMER  
 This package is distributed in the hope that it will be useful,  
 but WITHOUT ANY WARRANTY; without even the implied warranty of  
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 See the "GNU General Public License" for more details.  
 =cut  
 use Getopt::Std;  
 use strict;  
 #use integer;  
 sub char2string  
 {  
 # string generator: if I pass 'a' and 5, I'll get 'aaaaa'  
      sprintf "%s", @_[0] x @_[1];  
 }  
 sub occurs  
 {  
  my $pat = @_[0];  
  my $astring = @_[1];  
  my $tot = $astring =~ s/$pat//g;  
 #     print "tot $tot\n";  
 #  
  return $tot;  
 }  
 sub few_repeatitions  
 {  
   my $astring = @_[0];  
   my $max = @_[1];  
   my $len = length( $astring );  
   my $tot = 0;  
   my $mid = int( $len / 2);  
   for ( my $step = 2; $step <= $mid; $step++) {  
    for ( 0 .. $len - $step ) {  
      my $letters = substr( $astring, $_, $step);  
 #     print "$letters\n";  
      $tot = occurs( $letters, $astring);  
      return $tot if $tot > $max;  
    }  
   }   
   return 0;  
 }  
 sub nple  
 {  
      my $astring = @_[0];  
      my $len = length( $astring );  
      my $tot = 0;  
      my $in = 0;  
      my $last = ' ';  
     for ( 0 .. $len - 1) {  
         my $letter = substr( $astring, $_, 1);  
 #     print "$astring $letter $last\n";  
           if ( ($letter cmp $last) == 0) {  
 #               print "$letter = $last, $in, $tot";  
                if ($in == 0) {  
                     $in = 1;  
                     $tot++;  
                }  
           } else {  
                $in = 0;  
           }            
           $last = $letter;  
     }  
      return $tot;  
 }  
 sub substring  
 {  
      my $string1 = @_[0];  
      my $string2 = @_[1];  
      $_ = $string2;  
      if ( /$string1/ ) {  
           return 0;  
      }  
      else {  
           return 1;  
      }  
 }  
 my %opts;  
 getopts('a:c:ehl:n:o:r:tu:v:z:', \%opts);  
 usage(0) if $opts{'h'};  
 $opts{'u'} and $opts{'v'} or usage(1);  
 # setup parameters  
 my $va_list = $opts{'v'};  
 my @va_list = split( //, $va_list ); # convert string to an array  
 my $min_depth = $opts{'l'} ? int($opts{'l'}) : 1;  
 my $max_depth = $opts{'u'} ? int($opts{'u'}) : 1;  
 usage(2) if $min_depth > $max_depth;  
 my $prefix = $opts{'a'} ? $opts{'a'} : '';  
 my $postfix = $opts{'z'} ? $opts{'z'} : '';  
 my $max_occurs = $opts{'o'} ? int($opts{'o'}) : $opts{'u'};  
 my $max_cons = $opts{'c'} ? int($opts{'c'}) : $opts{'u'};  
 my $max_nple = $opts{'n'};  
 my $max_reps = $opts{'r'};  
 usage(3) if $min_depth < 1 ||   
      $max_depth < 1 ||   
      $max_occurs < 1 ||   
      $max_cons < 1 ||   
      $max_nple < 0 ||   
      $max_reps < 0;  
 if ($opts{'t'}) {   
      print "Options:\n";  
      foreach my $key (sort keys %opts)   
           { print "$key -> $opts{$key}\n"; }  
      print "Global vars:\n";  
      print_vars();  
 }  
 for ($min_depth..$max_depth) {  
      wg( $_, "");  
 }  
 sub print_vars  
 {  
      print "min_depth = $min_depth\n";  
      print "max_depth = $max_depth\n";  
      print "max_occurs = $max_occurs\n";  
      print "max_cons = $max_cons\n";  
      print "max_nple = $max_nple\n";  
      print "max_reps = $max_reps\n";  
 }  
 #  
 # word generator  
 #  
 sub wg  
 {  
      my $max_depth = @_[0];  
      my $myprefix = @_[1];  
      my $elem;  
      if ($max_depth == 0 ) {  
           print "$prefix$myprefix$postfix\n";  
           if ( $opts{e} == 1) {  
                system "$prefix$myprefix$postfix\n";  
           }  
      }  
      else {  
 #          print " n = $opts{'n'} r = $opts{'r'} \n";  
 #  
 #          suggestion: the generation of the words is more variuos if  
 #          I change the order of the list of the letters (@va_list)  
           foreach $elem (@va_list) {  
                my $newstring = "$myprefix$elem";       
                return if ( $opts{'c'} &&   
                      substring(char2string( $elem , $max_cons), $myprefix ) == 0);  
                return if( $opts{'n'} && nple( $newstring ) > $max_nple);  
                return if( $opts{'r'} &&  
                     few_repeatitions( $newstring, $max_reps) != 0 );  
                return if ( $opts{'o'} && occurs( "$elem", $newstring) > $max_occurs );   
                wg( $max_depth -1, "$myprefix$elem");       
           }  
      }  
 }  
 sub usage  
 {  
      my $rc = @_[0];  
      die <<END_USAGE  
 USAGE: perl $0 options  
 options are:  
      -a string: prefix  
      -c number: max consecutive letters (how many consecutive 'a' do you want?)  
      -e : submit the output string to the operating system  
      -h : help  
      -l number: min length of the word  
      -o number: max number of occurrencies of a letter   
      -n number: max number of n-ple (AA, BBB, CCC, DDDD)  
      -r number: max number of repeatitions (ABCABABBCDBCD has 5 repeatitions: 3 reps of AB and 2 of BCD)  
      -t : trace on  
      -u number: max length of the word  
      -v string: list of valid characters (es, "01" "abcdef")  
      -z string: postfix  
 possible return code are:  
      0, ok  
      1, not all parameters  
      2, min length (-l) is greater than max lenght (-u)  
      3, at least one parameter is lower than 1  
 Return code: $rc  
 END_USAGE  

Exemplo de como utilizar o script: 

No meu caso, como uso Linux salvei o arquivo e de a permissão de torno-lo executável "#chmod +x Script.pl" ou poderia usar a seguinte linha "perl wg.pl" que executaria o script da mesma forma. No windows e so instalar o ActivePerl.

Usei em esse comando:

./Script.pl -l 8 -u 64 -v abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ0123456789\`\~\!\@\#\$\%\^\&\*\(\)\-\_\+\=\[\]\;\’\,\.\/\<\>\?\:\”\{\}\|\ > words.txt

-l --> Tamanho minimo da palavra
-u --> Tamanho máximo da palavra
-v --> Listar os caracteres que eu vou querer na minha wordlist
> words.txt --> E para salva as palavras(Onde ta words.txt pode ser qualquer nome).


Então minha wordlist vai no minimo 8 caráteres e no máximo 86.

exemplo simples


Comentários

Postagens mais visitadas deste blog

WiFiPhisher - Ataques Automatizados de Phishing Contra Redes Wi-Fi

Um pesquisador de segurança grego, chamado George Chatzisofroniou, desenvolveu uma ferramenta de engenharia social WiFi que é projetado para roubar credenciais de usuários de redes Wi-Fi segura. A ferramenta, batizada WiFiPhisher, foi lançado no site do desenvolvimento de software GitHub no domingo e está disponível gratuitamente para os usuários.   "É um ataque de engenharia social que não usa força bruta, em contraste com outros métodos. É uma maneira fácil de obter senhas WPA", disse George Chatzisofroniou. No entanto, existem várias ferramentas de hacker disponíveis na Internet que pode cortar de uma rede Wi-Fi segura, mas esta ferramenta automatiza múltipla Wi-Fi técnicas que o tornam um pouco diferente dos outros hackers. Ferramenta WiFiPhisher usa ataque "gêmeo do mal " cenário. O mesmo que o gêmeo do mal, a ferramenta cria primeiro um ponto de acesso sem fio falso (AP) mascarar-se como o legítimo Wi-Fi AP. Em seguida, ele dirige uma negação de...

Como encontrar a WPS Routers Habilitados - Kali Linux

Como você poderia encontrar WPS Routers ativado?  Sério é muito fácil de encontrar WPS habilitado roteadores, mas depois que eu postei o meu tutorial sobre como cortar o WPA / WPA2 WiFi Protected muitos povos me enviado mensagens para saber como eles poderiam encontrar WPS habilitado router? por isso é muito simples e limitado a um comando único sim, vamos usar o comando de lavagem para esse fim. O comando que podemos utilizar para encontrar WPS habilitado roteadores está abaixo. wash -i mon0 -C Tenha em mente que o "C" neste alfabeto "C" deve ser a capital Também tenha em mente antes de entrar este comando por favor ligar o interface de moniter ou este comando não funciona mais assim para que você moniter tipo de interface o comando abaixo primeiro e depois tentar digitalizar routers WPS habilitados. airmon-ng start wlan0  Agora isso vai lhe dar todos os roteadores que possuem botão WPS / push ativado em cima delas e você pode tentar cortar-lhes a seu p...

Tsunami - DNS Amplification Attack Tool

ABOUT Tsunami is forked from Namescan .  It is an open source project by Samiux (GPLv3). It is designed for research and testing your firewalls as well as IDS/IPS.  Do NOT think of using this tool to attack.  It is very expensive due to its poor performance.  The effect may be differ due to the bandwidth, number of sessions and the size of feedback from the domain query as well as the power of the tool. All the features of Namescan are included in Tsunami.  That means, you can use Tsunami as a scanner too.  Please note that Namescan features/functions cannot be used with Tsunami functions. KNOW ISSUE The performance of this tool is very very poor. Tsunami only works on Kali Linux 1.0.9a or above.  Other linux  distributions may not working properly. The -p switch, do not set more than 1000 as it will consume a lot of memory. FEATURE Tsunami will spoof the MAC address on every session and it will be changed on the next session....