Zydra: A Comprehensive Guide to File Password Recovery and Shadow File Cracking
This guide will walk you through installation, commands, examples, and outputs, ensuring a deep understanding of how to use Zydra effectively.
Table of Contents
- What is Zydra?
- Prerequisites
- Installation
- Key Features
- Usage
- Vagrant Setup for Zydra
- Ethical Use and Disclaimer
- Conclusion
What is Zydra?
Zydra is a Python-based tool designed to recover passwords for protected files and to crack Linux shadow files. It provides the following capabilities:
- Supports RAR, ZIP, and PDF files.
- Cracks Linux shadow files to recover passwords for all system users.
- Offers both dictionary-based and brute force password recovery methods.
Prerequisites
Before using Zydra, ensure your system meets the following requirements:
- Python 3.3 or higher.
- A Debian-based Linux distribution (preferably Kali Linux).
Install the necessary packages:
sudo apt-get update sudo apt-get install qpdf unrar
Install Python dependencies using
pip3
:pip3 install zipfile rarfile crypt pyfiglet py-term
Install the epic font for figlet if not already installed:
sudo wget http://www.figlet.org/fonts/epic.flf -O /usr/share/figlet/epic.flf
Installation
Clone the Zydra repository from GitHub:
git clone https://github.com/hamedA2/Zydra.git
cd Zydra
Verify the installation by displaying the help menu:
python3 Zydra.py -h
You should see an output similar to this:
usage: Zydra.py [-h] [-f FILE] [-d DICTIONARY] [-b CHARSET] [-m MIN] [-x MAX]
optional arguments:
-h, --help Show this help message and exit
-f FILE File to crack (e.g., file.zip, file.rar, shadow)
-d DICTIONARY Path to dictionary file
-b CHARSET Character set for brute force (letters, digits, symbols)
-m MIN Minimum password length for brute force
-x MAX Maximum password length for brute force
Key Features
Supported File Types:
- RAR files
- Legacy ZIP files
- PDF files
- Linux shadow files
Attack Methods:
- Dictionary Search: Uses a pre-defined wordlist to test potential passwords.
- Brute Force Search: Tests passwords by systematically trying all possible combinations of characters.
Customizable Options:
- Specify minimum and maximum password lengths.
- Define character sets (letters, digits, symbols).
Multiprocessing: Uses all CPU cores for faster processing.
Progress Bar: Tracks the progress of the password recovery process.
Usage
Command Syntax
Zydra’s basic command syntax is:
python3 Zydra.py -f <file> [options]
Here are the options you can use:
-f <file>
: Specify the target file (e.g.,file.zip
,shadow
).-d <dictionary>
: Use a dictionary file for password recovery.-b <charset>
: Character set for brute force (letters
,digits
,symbols
).-m <min>
: Minimum password length (brute force only).-x <max>
: Maximum password length (brute force only).
Examples and Outputs
1. Dictionary Attack on a ZIP File
Command:
python3 Zydra.py -f file.zip -d rockyou.txt
Explanation:
file.zip
: Target file to crack.rockyou.txt
: A commonly used password dictionary.
Output:
Starting dictionary attack... Processing: rockyou.txt Password found: P@ssw0rd123
2. Brute Force Attack on a Shadow File
Command:
python3 Zydra.py -f shadow -b letters,digits -m 4 -x 6
Explanation:
shadow
: Linux shadow file.letters,digits
: Character set to include letters and digits.-m 4
: Minimum password length is 4 characters.-x 6
: Maximum password length is 6 characters.
Output:
Starting brute force attack...
Trying combinations: aaaa, aaab, aaac, ...
Password for user 'root': admin123
Password for user 'john': pass456
3. Cracking a Password-Protected PDF
Command:
python3 Zydra.py -f document.pdf -d rockyou.txt
Output:
Starting dictionary attack...
Processing: rockyou.txt
Password found: securepassword
Vagrant Setup for Zydra
Zydra can also be run in a virtual environment using Vagrant:
Initialize the virtual machine:
vagrant up
Access the virtual machine:
vagrant ssh
To exit the virtual machine:
exit
Destroy the virtual machine when done:
vagrant destroy
Note: Edit the Vagrantfile
to adjust CPU and memory allocation for better performance.
Ethical Use and Disclaimer
Zydra is intended for academic and testing purposes only. Unauthorized use of this tool on systems or files you do not own is illegal and unethical. Always ensure you have explicit permission before using Zydra.
Conclusion
Zydra is a robust and efficient tool for recovering file passwords and cracking shadow files. With its support for dictionary and brute force attacks, multiprocessing, and various customization options, it caters to a wide range of use cases.
By following this guide, you should now have a thorough understanding of how to install, configure, and use Zydra effectively. Always remember to use this tool responsibly and ethically.