Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.95 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. my $JOHN_PATH = "./john/run";
  4.  
  5. my $zipFile = $ARGV[0];
  6.  
  7. unless ( -e $zipFile) {die "Zip file not found\n";}
  8. unless ( -e $JOHN_PATH . "/john") {die "john executable not found, please change \$JOHN_PATH\n";}
  9. unless ( -e $JOHN_PATH . "/zip2john") {die "zip2john executable not found, please change \$JOHN_PATH\n";}
  10.  
  11. while (42) {
  12.  
  13.   my ($number) = ($zipFile =~ /(\d+)/);
  14.   my $password = "";
  15.   my $cmd = "$JOHN_PATH/zip2john level" . $number . ".zip 2>/dev/null > ./zip.hash";
  16.   `$cmd`;
  17.  
  18.   `$JOHN_PATH/john --wordlist=./american-english-insane.txt ./zip.hash`;
  19.   my $result = `$JOHN_PATH/john --show zip.hash`;
  20.  
  21.   if ( $result =~ /^level\d+\.zip\:(.*?)\n/gis ) {
  22.     $password = $1;
  23.   }
  24.  
  25.   $cmd = "unzip -o -P" . $password . " level" . $number . ".zip";
  26.   $result = `$cmd`;
  27.   print $result . "\n";
  28.  
  29.   if ( $result =~ /\s+extracting:\s+(.*?)\s*\R/gi ) {
  30.     $zipFile = $1;
  31.   }
  32.  
  33.   print $number . ":" . $password . "\n";
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement