Files with sensitive information are often encrypted. These include password protected PDF and ZIP files, Linux shadow files that contain passwords that are encrypted and so on. Different tools use different encryption mechanisms. A file may be encrypted using weak algorithms such as the older PKZIP algorithm or the strong AES-256 encryption. Zydra is a tool that can be used to crack these passwords and give you access to such protected files. Here we list the steps for doing so:
- First download Zydra from GitHub. You can easily do this using the wget utility. Zydra comes as a python file.
- Zydra requires some dependencies to run properly, namely it uses Python 3. Use pip3 to install the same on your system.
- Now you can run Zydra using the python3 command – python3 zydra.py
- The starting banner shows the usage example and the common options. You can run the above command with –help option to see more usage details.
- You will need to download a wordlist which contains the possible list of words that can be used as passwords. Many such lists are available for download on the internet. Example: https://github.com/danielmiessler/SecLists
- Cracking RAR and ZIP files – Zydra can operate in two modes: Dictionary and brute force. In dictionary mode you will need to supply a wordlist with the –d flag and the file you are trying to crack using the –f flag. In brute force mode you can set the character types using –b flag and the minimum and maximum password length using the –m and –x flags. The dictionary method is faster than the brute force method.
- Cracking PDF files – For Zydra to work with PDF files you will need to install qpdf first with the following command: sudo apt install qpdf
- Now you can use Zydra to crack the PDF file by providing the wordlist and the file.
- Cracking Shadow Files – Zydra will automatically try to crack the password hashes for all users found in the Linux shadow file. You just need to specify the file name and wordlist.
The success of Zydra in cracking file or user passwords depends largely on the wordlist used. The more comprehensive the word list, the better will be your chances of cracking the password protection. However, you should keep in mind that providing large wordlists may also significantly increase the amount of time taken to crack the password. Nevertheless this is a useful tool to have in the repertoire of any ethical hacker or if you are prone to forgetting the passwords of your encrypted files.