Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- my $JOHN_PATH = "./john/run";
- my $JOHN_WORDLIST = "./rockyou.txt";
- my $zipFile = $ARGV[0];
- unless ( -e $zipFile) {die "Zip file not found\n";}
- unless ( -e $JOHN_PATH . "/john") {die "john executable not found, please change \$JOHN_PATH\n";}
- unless ( -e $JOHN_PATH . "/zip2john") {die "zip2john executable not found, please change \$JOHN_PATH\n";}
- while (42) {
- my ($number) = ($zipFile =~ /(\d+)/);
- my $password = "";
- my $cmd = "$JOHN_PATH/zip2john level" . $number . ".zip 2>/dev/null > ./zip.hash";
- `$cmd`;
- $cmd = "$JOHN_PATH/john --wordlist=$JOHN_WORDLIST ./zip.hash";
- `$cmd`;
- $cmd = "$JOHN_PATH/john --show zip.hash";
- my $result = `$cmd`;
- if ( $result =~ /^level\d+\.zip\:(.*?)\n/gis ) {
- $password = $1;
- }
- $cmd = "unzip -o -P" . $password . " level" . $number . ".zip";
- $result = `$cmd`;
- # print $result . "\n";
- if ( $result =~ /\s+extracting:\s+(.*?)\s*\R/gi ) {
- $zipFile = $1;
- }
- else {
- last;
- }
- print $number . ":" . $password . "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement