In this video, we are going to see how we can crack old zip file passwords with BC crack software.
Old ZIP encryption method did not actually encrypt the files, and used a method called store to save
files inside a zip archive.
Modern tools like WinZip and WinRAR now use modern methods, and you actually have to create this type
of archive manually.
But you may come across an old archive created with this type of method in the wild, for which you
can use this tool.
This is a known plaintext attack, which means you should know how files look like, or know a little
bit of the actual file content.
The known plaintext attack is an attack model for cryptanalysis, where the attacker has access to both
the plaintext and its encrypted version, called ciphertext, as a sample.
By using the advanced analysis method, an attacker can break the encryption and reveal the hidden file
content.
For demonstration purposes, we will be creating a vulnerable archive.
I will be using seven zip software.
So create an archive and ensure that the compression level is set to store, which will result in a
vulnerable archive.
Now let us see how we can break this encryption.
In step one.
Download the BC crack software from GitHub repository.
In step two, copy the archive in the same directory as BCC crack and then use the command bcc crack,
dash L and the archive name to list down the contents of the archive.
Now create a new text file with the content that you know will be present in one of the files.
Normally they can be comments like those found on top of the host file or any config file.
By default.
In step four, use the given command to recover the key.
Here test zip is the encrypted archive.
Test is the file you are targeting and have a plain text of plaintext.
Is the plain text file containing some data that you know will be present in the target cipher file.
This will recover the key of the archive.
Now you can use the recovered key to extract the encrypted file from the archive.
Here.
Decrypt txt is the output file and the dash k flag specifies the recovered key from the previous step.
This will extract our target cipher file.
Now we can also use this key to create a new archive with our own password, and then extract all files
from the archive.
So use the command as shown on the slide.
Now let us see the actual demonstration.
We are on a Windows 10 machine, and here we have two files on the desktop that we want to add to an
archive.
One of the files, test.txt, contains some commands on top of it and represents a typical config file.
An attacker may guess or know that this file contains this content on top of other content.
The other file contains some garbage data which the attacker does not know about.
To create a vulnerable archive, select these files and from the context menu, select seven zip and
then add to archive option.
Here ensure the compression level is set to store.
The encryption method is set to zip crypto and then set a password.
Click on okay to create the archive.
So we have an archive on the desktop.
Rename it to test zip.
Now open your web browser and search for BK crack.
Open the GitHub page for BK crack.
Scroll down and click the link to go to Pre-compiled packages.
We can use this tool on Linux or on windows as we are using windows.
So download the 64 bit package.
Once downloaded, extract it.
Now copy the target archive from the desktop to BCC crack folder.
Now we need to create a plain text file.
So open a new text document.
And paste the top lines from our actual file that has been encrypted in zip archive.
Save and close the file.
Now we have everything we need to crack the zip archive.
Click on the search icon and open the command prompt.
Change your current working directory to BC crack folder.
Use the command BC cracks and the archive name to list down the contents of the archive.
We can see that the compression method is store, which makes the archive vulnerable to this method.
Now use the command as shown on the screen to recover the key of the archive.
We are specifying the archive name, the cipher text file, and the plain text file.
BC crack will extract the key.
After some time, note that this key is not the same as the password, but it will serve our purpose.
Now, to recover the cipher file against the plain text file, we can use the command as shown on screen
with the extracted key.
Our cipher file will be extracted in the same folder.
And here we can see the full contents of the file.
Now, if we want to get all files from the target archive, we will need to create a new archive with
the extracted key by the command as shown on the screen.
Here we are creating a new archive with a new password.
Our new archive has been created.
So extract it now with the password you specified.
And here we have both the files from the target archive.
In this manner, we can break the old zip encryption algorithm and extract the files.
Therefore, it is recommended that while creating archives, you must ensure that you are using newer
protocols.
I hope you liked this video and thanks for supporting us.