LulzTigre

LulzGen v0.1

Nov 15th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. local( $word_pattern, $output_file );
  3. local( %pat_codes );
  4. local( $CHAR_SETS ) = 0;
  5. $| = 1;
  6. print ("\n\t**************************************************");
  7. print ("\n\t*                Wordlist Generator              *");
  8. print ("\n\t*            written By : Lulz Tigre.           *");
  9. print ("\n\t*    Shouts out to : Lulzsecurity, nullsec   *");
  10. print ("\n\t*         Website :- www.lulzsec.nl          *");
  11. print("\n\t*    lulz my first legit script smh.           *");
  12. print ("\n\t**************************************************");
  13.  
  14. if ( $ARGV[ 0 ] eq "--?" ) { $CHAR_SETS = 1; }
  15.  
  16. ###
  17. push( @{ $pat_codes{ 'X' }}, 65,    90    );
  18. push( @{ $pat_codes{ 'x' }}, 97,    122   );
  19. push( @{ $pat_codes{ '!' }}, 0,     47    );
  20. push( @{ $pat_codes{ '@' }}, 58,    64    );
  21. push( @{ $pat_codes{ '$' }}, 91,    96    );
  22. push( @{ $pat_codes{ '^' }}, 123,   256   );
  23. push( @{ $pat_codes{ '#' }}, 48,    57    );
  24. print "\nPattern codes : \n";
  25.  
  26. if ( $CHAR_SETS ) {
  27. print "Many characters avaiable cannot be rendered with ascii,\n";
  28. print " so you may not see values within your [ ]'s for all of\n";
  29. print " the characterset. ex. 184 [ ]\n";
  30. }
  31.  
  32. print "X    : Upper case characters\n";
  33. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ 'X' } } ); }
  34. print "x    : Lower case characters\n";
  35. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ 'x' } } ); }
  36. print "!    : Special chars 1\n";
  37. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ '!' } } ); }
  38. print "\@    : Special chars 2\n";
  39. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ '@' } } ); }
  40. print "\$    : Special chars 3\n";
  41. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ '$' } } ); }
  42. print "^    : Special chars 4\n";
  43. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ '^' } } ); }
  44. print "#    : Numeric chars\n";
  45. if ( $CHAR_SETS ) { disp_range( @{ $pat_codes{ '#' } } ); }
  46.  
  47. print "Rerun this program with --? if you would like output\n";
  48. print "     of the character sets.\n";
  49. print "     WARNING : It may mess up your terminal session\n";
  50.  
  51. local( $good_params ) = 'no';
  52. while( $good_params eq 'no' ) {
  53. $word_pattern        = get_line( 'Enter the word pattern you would like'
  54. );
  55. $output_file         = get_line( 'Enter the name of the output file' );
  56. print "The values I have are : \n";
  57. print "    Word Pattern          : $word_pattern\n";
  58. print "    Output File           : $output_file\n";
  59. local $temp = 'y';
  60. $temp = get_line( 'Are these correct [y]', 1 );
  61. if ( $temp =~ /y/i || $temp eq '' ) { $good_params = 'yes'; }
  62. }
  63.  
  64. print "Building code : ";
  65. # Meat and potatoe time ....
  66. local $eval_code = '';
  67. local $eval_code = <<"EVAL_HEAD";
  68. open( OUT_FILE, "> $output_file" ) || die "Could not open output file :
  69. \$!\\n\\n";
  70. local \$smash_me = '';
  71. EVAL_HEAD
  72.  
  73. local $open_loops = 0;
  74. for( $i = 0; $i < length( $word_pattern ); $i++ ) {
  75.    local $cur_letter = '';
  76.    local $bat_letter = '';
  77.    $cur_letter = substr( $word_pattern, $i, 1 );
  78.    foreach $pat_letter ( keys %pat_codes ) {
  79.       if ( $pat_letter eq $cur_letter ) {
  80.          $bat_letter = $pat_letter;
  81.       }
  82.    }
  83.    if ( $bat_letter eq '' ) {
  84.       $eval_code .= '$smash_me_' . $i . ' = "' . $cur_letter . '";' .
  85. "\n";
  86.    } else {
  87.       $open_loops++;
  88.       @temp = @{ $pat_codes{ $cur_letter } };
  89.       $low_value = $temp[ 0 ];
  90.       $high_value = $temp[ 1 ];
  91.  
  92.       $eval_code .= <<"EVAL_LOOP";
  93. for( \$xx_$open_loops = $low_value; \$xx_$open_loops <= $high_value;
  94.  \$xx_$open_loops++ ) {
  95.       \$smash_me_$i = pack( 'c', \$xx_$open_loops );
  96.  
  97. EVAL_LOOP
  98.    }
  99. }
  100.  
  101. $eval_code .= 'print OUT_FILE ';
  102. for( $i = 0; $i < length( $word_pattern ); $i++ ) {
  103.    $eval_code .= '$smash_me_' . $i . ' . ' . "\n";
  104. }
  105. $eval_code .= '"\n";';
  106. for( $i = 0; $i < $open_loops; $i ++ ) {
  107.    $eval_code .= '}' . "\n";
  108. }
  109.  
  110. $eval_code .= 'close( OUT_FILE );';
  111. print "Done!\n";
  112.  
  113. #print $eval_code;
  114. print "Running word create, this may take some time : ";
  115. eval( $eval_code );
  116. print "Done!\n";
  117.  
  118. # Gets a line of input from the user
  119. sub get_line {
  120.    local $prompt, $can_be_empty, $temp;
  121.    local $input_ok = 'no';
  122.  
  123.    $prompt           = shift;
  124.    $can_be_empty     = shift;
  125.  
  126.    while( $input_ok eq 'no' ) {
  127.    print $prompt . ' : ';
  128.    $temp = <STDIN>; $temp =~ s/\n//g; $temp =~ s/\r//g;
  129.    if ( $temp  eq "" && $can_be_empty != 1) {
  130.       print "I'm sorry but i require input for this value,";
  131.       print " please try again.\n";
  132.    } else {
  133.    $input_ok = 'yes';
  134.    }
  135.  
  136.    }
  137.    return $temp;
  138. }
  139. # Display a range of character values
  140. sub disp_range {
  141.    local ( $start_val, $end_val ) = @_;
  142.  
  143.    print "Characters in set ( $start_val -> $end_val ) : \n";
  144.    $line_break = 0;
  145.    for( $i = $start_val; $i <= $end_val; $i++ ) {
  146.       $line_break++;
  147.       print $i . ' [ ' . pack( 'c', $i ) . ' ] ';
  148.       if ( $line_break == 5 ) {
  149.          $line_break = 0;
  150.          print "\n";
  151.       }
  152.    }
  153.    print "\n\n";
  154. }
Add Comment
Please, Sign In to add comment