Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/bin/perl
- my $NumArgs = $#ARGV + 1;#Determine the number of arguments the user has given us
- if ($NumArgs <= 1) {
- #Our user has only entered some information. Display help screen.
- header();
- exit();}
- if ($NumArgs == 2) {
- my $dictfile = $ARGV[0]; #Host is the first argument supplied
- my $complexlvl = $ARGV[1]; #Username is the 2nd argument supplied
- print "Working...\n";
- if ($complexlvl == 1) {
- #Minimal complexity; all we want to do is
- #1 Plain word
- #2 Plain with 2 digits at the end
- #3 Convert to Uppercase with 2 digits at the end
- #4 Front-End Cap with 2 digits at the end
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Output as PLAIN
- print HYBRID "$curword\n";
- #Output as PLAN with Front-End Cap
- print HYBRID ucfirst($curword) . "\n";
- #Output as PLAIN with all Caps
- print HYBRID uc $curword . "\n";
- #Output as plain w/ 2 digits
- for $i (0 .. 9) {
- print HYBRID "$curword" . $i . "\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$curword" . $i . "\n";
- }
- #Output as Front-End Cap w/ 2 digits
- my $toprint = ucfirst lc $curword;
- for $i (0 .. 9) {
- print HYBRID "$toprint" . $i . "\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$toprint" . $i . "\n";
- }
- #Output as Uppercase w/ 2 digits
- my $toprint = uc $curword;
- for $i (0 .. 9) {
- print HYBRID "$toprint" . $i . "\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$toprint" . $i . "\n";
- }
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 1
- ###### ROUTINE 2 #########
- if ($complexlvl == 2) {
- #Marginal complexity; all we want to do is
- #1 Plain word & !
- #2 Plain with 2 digits at the end & !
- #3 Convert to Uppercase with 2 digits at the end & !
- #4 Front-End Cap with 2 digits at the end & !
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Output as PLAIN & !
- print HYBRID "$curword!\n";
- #Output as PLAN with Front-End Cap & !
- print HYBRID ucfirst($curword) . "!\n";
- #Output as PLAIN with all Caps & !
- print HYBRID uc $curword . "!\n";
- #Output as plain w/ 2 digits & !
- for $i (0 .. 9) {
- print HYBRID "$curword" . $i . "!\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$curword" . $i . "!\n";
- }
- #Output as Front-End Cap w/ 2 digits & !
- my $toprint = ucfirst lc $curword;
- for $i (0 .. 9) {
- print HYBRID "$toprint" . $i . "!\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$toprint" . $i . "!\n";
- }
- #Output as Uppercase w/ 2 digits & !
- my $toprint = uc $curword;
- for $i (0 .. 9) {
- print HYBRID "$toprint" . $i . "!\n";
- }
- for (0 .. 99) {
- my $i = sprintf qq{%02d}, $_;
- print HYBRID "$toprint" . $i . "!\n";
- }
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 2
- ###### ROUTINE 3 #########
- if ($complexlvl == 3) {
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Begin processing of the word and generate variations
- my $totalword = '';
- my $foundchar = 0; #Variable to cancel variations past one
- for $i (0 .. length($curword)) {
- my $curchar = substr($curword, $i, 1);
- #Begin replacing the first letter found ONLY
- my $addchar = $curchar; #Default to current character, replace ONLY if a match found.
- if (($curchar eq 'a') or ($curchar eq 'A')) {
- if ($foundchar < 1) {
- $addchar = 4;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'b') or ($curchar eq 'B')) {
- if ($foundchar < 1) {
- $addchar = 8;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'e') or ($curchar eq 'E')) {
- if ($foundchar < 1) {
- $addchar = 3;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'g') or ($curchar eq 'G')) {
- if ($foundchar < 1) {
- $addchar = 9;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'i') or ($curchar eq 'I')) {
- if ($foundchar < 1) {
- $addchar = 1;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'l') or ($curchar eq 'L')) {
- if ($foundchar < 1) {
- $addchar = 1;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'o') or ($curchar eq 'O')) {
- if ($foundchar < 1) {
- $addchar = 0;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 's') or ($curchar eq 'S')) {
- if ($foundchar < 1) {
- $addchar = 5;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 't') or ($curchar eq 'T')) {
- if ($foundchar < 1) {
- $addchar = 7;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'z') or ($curchar eq 'Z')) {
- if ($foundchar < 1) {
- $addchar = 2;
- $foundchar = ($foundchar + 1);
- }
- }
- #Add current character to list and repeat
- $totalword = ($totalword . $addchar);
- }
- #Output as PLAIN
- print HYBRID "$totalword\n";
- #Output as PLAIN with Front-End Cap
- print HYBRID ucfirst($totalword) . "\n";
- #Output as PLAIN with all Caps
- print HYBRID uc $totalword . "\n";
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 3
- ###### ROUTINE 4 #########
- if ($complexlvl == 4) {
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Begin processing of the word and generate variations
- my $totalword = '';
- for $i (0 .. length($curword)) {
- my $curchar = substr($curword, $i, 1);
- #Begin replacing the first letter found ONLY
- my $addchar = $curchar; #Default to current character, replace ONLY if a match found.
- if (($curchar eq 'a') or ($curchar eq 'A')) {
- $addchar = 4;
- }
- elsif (($curchar eq 'b') or ($curchar eq 'B')) {
- $addchar = 8;
- }
- elsif (($curchar eq 'e') or ($curchar eq 'E')) {
- $addchar = 3;
- }
- elsif (($curchar eq 'g') or ($curchar eq 'G')) {
- $addchar = 9;
- }
- elsif (($curchar eq 'i') or ($curchar eq 'I')) {
- $addchar = 1;
- }
- elsif (($curchar eq 'l') or ($curchar eq 'L')) {
- $addchar = 1;
- }
- elsif (($curchar eq 'o') or ($curchar eq 'O')) {
- $addchar = 0;
- }
- elsif (($curchar eq 's') or ($curchar eq 'S')) {
- $addchar = 5;
- }
- elsif (($curchar eq 't') or ($curchar eq 'T')) {
- $addchar = 7;
- }
- elsif (($curchar eq 'z') or ($curchar eq 'Z')) {
- $addchar = 2;
- }
- #Add current character to list and repeat
- $totalword = ($totalword . $addchar);
- }
- #Output as PLAIN
- print HYBRID "$totalword\n";
- #Output as PLAIN with Front-End Cap
- print HYBRID ucfirst($totalword) . "\n";
- #Output as PLAIN with all Caps
- print HYBRID uc $totalword . "\n";
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 4
- ###### ROUTINE 5 #########
- if ($complexlvl == 5) {
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Begin processing of the word and generate variations
- my $totalword = '';
- my $foundchar = 0; #Variable to cancel variations past one
- for $i (0 .. length($curword)) {
- my $curchar = substr($curword, $i, 1);
- #Begin replacing the first letter found ONLY
- my $addchar = $curchar; #Default to current character, replace ONLY if a match found.
- if (($curchar eq 'a') or ($curchar eq 'A')) {
- if ($foundchar < 1) {
- $addchar = 4;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'b') or ($curchar eq 'B')) {
- if ($foundchar < 1) {
- $addchar = 8;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'e') or ($curchar eq 'E')) {
- if ($foundchar < 1) {
- $addchar = 3;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'g') or ($curchar eq 'G')) {
- if ($foundchar < 1) {
- $addchar = 9;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'i') or ($curchar eq 'I')) {
- if ($foundchar < 1) {
- $addchar = 1;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'l') or ($curchar eq 'L')) {
- if ($foundchar < 1) {
- $addchar = 1;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'o') or ($curchar eq 'O')) {
- if ($foundchar < 1) {
- $addchar = 0;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 's') or ($curchar eq 'S')) {
- if ($foundchar < 1) {
- $addchar = 5;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 't') or ($curchar eq 'T')) {
- if ($foundchar < 1) {
- $addchar = 7;
- $foundchar = ($foundchar + 1);
- }
- }
- elsif (($curchar eq 'z') or ($curchar eq 'Z')) {
- if ($foundchar < 1) {
- $addchar = 2;
- $foundchar = ($foundchar + 1);
- }
- }
- #Add current character to list and repeat
- $totalword = ($totalword . $addchar);
- }
- #Print final word & !
- print HYBRID "$totalword!\n";
- #Output as PLAIN with Front-End Cap
- print HYBRID ucfirst($totalword) . "!\n";
- #Output as PLAIN with all Caps
- print HYBRID uc $totalword . "!\n";
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 5
- ###### ROUTINE 6 #########
- if ($complexlvl == 6) {
- #Open dictionary file for processing
- open DICTLIST, $dictfile or die$!;
- my @listwords = DICTLIST;
- while (my $curword = <DICTLIST>) {
- chomp($curword);
- my $outfile = 'hybrid.txt'; #Set hydrid output file
- open(HYBRID, ">>$outfile"); #Open file for writing
- #Begin processing of the word and generate variations
- my $totalword = '';
- for $i (0 .. length($curword)) {
- my $curchar = substr($curword, $i, 1);
- #Begin replacing the first letter found ONLY
- my $addchar = $curchar; #Default to current character, replace ONLY if a match found.
- if (($curchar eq 'a') or ($curchar eq 'A')) {
- $addchar = 4;
- }
- elsif (($curchar eq 'b') or ($curchar eq 'B')) {
- $addchar = 8;
- }
- elsif (($curchar eq 'e') or ($curchar eq 'E')) {
- $addchar = 3;
- }
- elsif (($curchar eq 'g') or ($curchar eq 'G')) {
- $addchar = 9;
- }
- elsif (($curchar eq 'i') or ($curchar eq 'I')) {
- $addchar = 1;
- }
- elsif (($curchar eq 'l') or ($curchar eq 'L')) {
- $addchar = 1;
- }
- elsif (($curchar eq 'o') or ($curchar eq 'O')) {
- $addchar = 0;
- }
- elsif (($curchar eq 's') or ($curchar eq 'S')) {
- $addchar = 5;
- }
- elsif (($curchar eq 't') or ($curchar eq 'T')) {
- $addchar = 7;
- }
- elsif (($curchar eq 'z') or ($curchar eq 'Z')) {
- $addchar = 2;
- }
- #Add current character to list and repeat
- $totalword = ($totalword . $addchar);
- }
- #Print final word
- print HYBRID "$totalword!\n";
- #Output as PLAIN with Front-End Cap
- print HYBRID ucfirst($totalword) . "!\n";
- #Output as PLAIN with all Caps
- print HYBRID uc $totalword . "!\n";
- #Done for this iteration
- close(HYBRID);
- }
- } #End routine for Lvl 6
- #END OF ALL COMPLEXITY LEVEL ROUTINES
- close(DICTLIST);
- } #End main function
- print "List generated!\n";
- exit();
- sub header{
- print qq{
- ----------------------------------------------------------------------
- Hybrid Maker
- Custom Built by Juno
- NBTDOTM
- ----------------------------------------------------------------------
- Usage: hybrid [dictionary] [complexity level]
- Example: hybrid passwords.txt 3
- This program will take a standard dictionary file (no combo lists) and
- create hybrid variations based off of each word in the supplied list.
- Additionally, the user may select a level of complexity to control the
- size of the output. For example, the password 'test' will
- result in the follow variations:
- Lvl 1 (332 variations): test, Test, TEST, test0-99, Test0-99, TEST0-99
- Common caps variation(CCV) with 2 digit numeric bruteforce appended.
- Lvl 2 (332 variations): test!, Test!, TEST!, test0-99!, Test0-99!, TEST0-99!
- Same as Lvl 1 with an exclamation mark appended.
- Lvl 3: Replaces first possible letter found with hybrid equivilent.
- Example: 'Password' becomes 'P4ssword'. No appended numbers. CCV.
- Lvl 4: Replaces every possible letter with hybrid equivilent.
- Example: 'Password' becomes 'P455w0rd'. No appended numbers. CCV.
- Lvl 5: Replaces first possible letter with hybrid equivilent and appends !.
- Example: 'Password' becomes 'P4ssword!'. CCV.
- Lvl 6: Replaces all possible letters with hybrid equivilents and appends !.
- Example: 'Password' becomes 'P455w0rd!'. CCV.
- The generated file is named hybrid.txt and placed in the current
- directory. This program may also be run again with another complexity
- level; the results will simply be appended to hybrid.txt. Cheers!
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement