I am trying to unzip a file with a password that I know is between 900000000 and 900999999 but I am met with an bad crc error and a gov.csv that contains some non sense. How can I get past this without ending the program? I know what the actual password is, but creating this "brute force" attempt is part of a homework assignment. The error that I come across seems to be stemming from the unzip apt. My code is below. The yes was added because I was continually being asked to replace the file even though it was the wrong password.
for word in $(echo 900{000000..999999})
{
echo $word
yes | unzip -q -P $word $1
if [ -s gov.csv ]
then
echo "$word is the password"
exit
fi
}
I have tried adding an additional if statement that does nothing to improve the situation.
if yes | unzip -q -P $word $1 | grep -i "bad crc"
then
rm gov.csv
fi
I would also like to apologize if my formatting for the code section is bad, first time posting on this site.
question from:
https://stackoverflow.com/questions/65925925/bypassing-bad-crc-with-unzip-tool 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…