Files & Archives Cracking
Protected Files
Importance of File Encryption
Encryption ensures confidentiality in personal and business communication.
Lack of encryption in emails containing sensitive data is negligent and potentially violates laws (e.g., GDPR in the EU).
Symmetric encryption (e.g., AES-256):
Uses the same key for encryption and decryption.
Asymmetric encryption:
Requires a public key (to encrypt) and a private key (to decrypt).
Common tools and passwords can crack poorly implemented encryption.
File Hunting and Identifying Sensitive Files
Command for Hunting Specific File Extensions
Purpose: Locate files with extensions that might store sensitive information.
Filtering: Avoid unnecessary system paths like libraries and fonts.
Finding SSH Keys
Purpose: Search for SSH keys across the filesystem.
Encrypted SSH keys:
Header indicates encryption method (e.g., AES-128-CBC).
Requires a passphrase to decrypt.
Cracking Encrypted Files
Tools for Extracting Hashes
Locate scripts for various file types:
Examples:
ssh2john.py
: For SSH keys.office2john.py
: For Microsoft Office files.pdf2john.py
: For PDFs.
Steps to Crack Files
Convert File to Hash:
Crack Hash Using Wordlist:
Display Cracked Passwords:
Example: Cracking SSH Keys
Document Cracking
Cracking Office Documents
Cracking PDF Documents
Protected Archives
What Are Archives?
Archives are compressed file formats that can bundle multiple files (e.g., PDFs, Word documents, etc.) into one for better organization and transfer.
Examples of archive file extensions:
Common Formats:
.tar
,.gz
,.zip
,.rar
,.7z
Encrypted/Specialized Formats:
.luks
,.truecrypt
,.bitlocker
,.kdbx
Password-Protected Archives
Not all archive formats natively support password protection.
Tools like OpenSSL or GPG are often used to encrypt unprotected archive types like
.tar
.
Cracking Password-Protected Archives
1. ZIP Archives
Commonly used for bundling files in Windows environments.
Steps to Crack ZIP Passwords
Extract Hashes
Example Output:
Use John the Ripper to Crack Hash
Example Output:
View Cracked Password
2. OpenSSL-Encrypted Archives
Gzip files can be encrypted with OpenSSL.
Steps to Crack OpenSSL Encrypted Archives
Identify Encryption
Example Output:
Crack Password with a For-Loop
Verify Extraction
Example Output:
3. BitLocker Encrypted Drives
Used by Windows for partition or external drive encryption.
Based on AES encryption (128/256-bit).
Steps to Crack BitLocker Password
Extract Hashes
Use Hashcat to Crack Hash
Example Output:
View Cracked Password
Example: