How to Crack Passwords with pwdump3 and John the Ripper
Hackers use multiple methods to crack those seemingly fool-proof passwords. John the Ripper and pwdump3 can be used to crack passwords for Windows and Linux/Unix. Follow the easy steps below.
How to crack Windows passwords
The following steps use two utilities to test the security of current passwords on Windows systems:
pwdump3 (to extract password hashes from the Windows SAM database)
John the Ripper (to crack the hashes of Windows and Linux/UNIX passwords)
The following test requires administrative access to either your Windows standalone workstation or the server:
Create a new directory called passwords from the root of your Windows C: drive.
Download and install a decompression tool if you don’t already have one.
Download, extract, and install the following software into the passwords directory you created, if you don’t already have it on your system:
Enter the following command to run pwdump3 and redirect its output to a file called cracked.txt:
c:\passwords\pwdump3 > cracked.txt
This file captures the Windows SAM password hashes that are cracked with John the Ripper. You can see the contents of the cracked.txt file that contains the local Windows SAM database password hashes.
Enter the following command to run John the Ripper against the Windows SAM password hashes to display the cracked passwords:
This process can take seconds or days, depending on the number of users and the complexity of their associated passwords.
How to crack UNIX/Linux passwords
John the Ripper can also crack UNIX/Linux passwords. You need root access to your system and to the password (/etc/passwd) and shadow password (/etc/shadow) files. Perform the following steps for cracking UNIX/Linux passwords:
Download the UNIX source files from www.openwall.com/john.
Extract the program by entering the following command:
[root@localhost kbeaver]#tar -zxf john-1.7.9.tar.gz
or whatever the current filename is.
You can also crack UNIX or Linux passwords on a Windows system by using the Windows/DOS version of John the Ripper.
Change to the /src directory that was created when you extracted the program and enter the following command:
Change to the /run directory and enter the following command to use the unshadow program to combine the passwd and shadow files and copy them to the file cracked.txt:
./unshadow /etc/passwd /etc/shadow > cracked.txt
The unshadow process won’t work with all UNIX variants.
Enter the following command to start the cracking process:
When John the Ripper is complete (and this could take some time), the output is similar to the results of the preceding Windows process.
After completing the preceding Windows or UNIX steps, you can either force users to change passwords that don’t meet specific password policy requirements, you can create a new password policy, or you can use the information to update your security awareness program. Just do something.
Be careful handling the results of your password cracking. You create an accountability issue because more than one person now knows the passwords. Always treat the password information of others as strictly confidential. If you end up storing them on your test system, make sure it’s extra secure. If it’s a laptop, encrypting the hard drive is the best defense.