Crack sensitive files: Linux
Hunting for Encoded Files
Crack ssh key with ssh2john.py
Most SSH keys we will find nowadays are encrypted. We can recognize this by the header of the SSH key because this shows the encryption method in use.
encrypted SSH keys are protected with a passphrase that must be entered before use. However, many are often careless in the password selection and its complexity because SSH is considered a secure protocol, and many do not know that even lightweight AES-128-CBC can be cracked.
There is a Python script called ssh2john.py
for SSH keys, which generates the corresponding hashes for encrypted SSH keys, which we can then store in files. It's preinstalled in Kali linux:
Now we can crack the hash with johntheripper:
Crack password of Microsoft Word file
The office2john
script is preinstalled in kali linux:
Cracking PDFs protected file
Cracking password of a zip file
List compressed files:
Cracking OpenSSL Encrypted Archives
openssl
can be used to encrypt the gzip
format.
Checking file format and encryption:
Extract files with openssl
in a for loop
:
Once the for-loop has finished, we can look in the current folder again to check if the cracking of the archive was successful.
Cracking BitLocker Encrypted Drives
BitLocker is an encryption program for entire partitions and external drives. Microsoft developed it for the Windows operating system. It has been available since Windows Vista and uses the AES
encryption algorithm with 128-bit or 256-bit length.
The recovery key is a 48-digit string of numbers generated during BitLocker setup that also can be brute-forced.
We can use a script called bitlocker2john
to extract the hash we need to crack:
Using hashcat:
Once we have cracked the password, we will be able to open the encrypted drives. The easiest way to mount a BitLocker encrypted virtual drive is to transfer it to a Windows system and mount it.
To do this, we only have to double-click on the virtual drive. Since it is password protected, Windows will show us an error. After mounting, we can again double-click BitLocker to prompt us for the password.
Last update: 2025-01-19 Created: January 19, 2025 22:33:25