I’m trying to unzip a file using perl on linux. The file is password protected, and am looping through possible password in a brute force attack (yes this is a homework assignment)
I have isolated and removed ther error code 20992 (bad password), but am still getting another error code which is not listed anywhere in the docs, and couldn’t find anything relevant using The Googles either.
The error is:
512 error: invalid compressed data to inflate secret_brute.txt
Has anyone seen this error message? If so, what mean?
#!/usr/bin/perl
@aaaa_zzzz = ("aaaa" .. "zzzz");
foreach(@aaaa_zzzz){
$output = system("unzip -P $_ -q -o secret_brute.zip");
if($output !~ m/20992/){ # <-- filtering out other error message
chomp($output);
print "$_ : $output\n";
}
}
Edit
Per request: Secret_brute.zip
Here is a list of exit codes from unzip.
As mentioned, perldoc -f system explains how to get the exit value of
unzip:In this case, a value of
512would map to:On the other hand,
20992would map to: