Cracking /etc/shadow Password Hash using John the Ripper


crack /etc/shadow file

You have mid-engaged with Linux. Recently you installed Linux in your system. But few days later, you forgot your system password. “I remember when I was doing a penetration testing of a company. We saved /etc/shadow hash in a TXT file.” I don’t remember correctly whether that file is saved in the system or not. Wow, we are lucky. We have got the hash file. But I have no idea how to decrypt the hash file.
What will you do?
Once you have retrieved hash from your system, you want to crack them. In this article, we will use one of the most favorite tools for cracking the password is the john the ripper tool that is pre-installed in Kali Linux.

What is Shadow File ?

In the Linux operating system, the Shadow file is a system file, In which the user’s password remains stored as a hash. Shadow file inside the /etc/ folder. /etc/ is a configuration file.

Consider the following summary:- You have entered on your Linux Operating System and want to see the Linux hash that remains stored inside the/etc/ folder. We will put the command cat /etc/shadow or follow the below command In which help you see the hash file of Linux.

cat /etc/shadow | grep pentestblog

cat /etc/shadow

We have saved all hash in a new_file. If you want to look at the new_file hash, then apply the command given below.


cat new_hash

cat new_hash

In this stage, we will decrypt the new_file hash using john the ripper tool. We have a wordlist that we generated with the help of the crunch tool. If you are a fresher, then you should visit our YouTube channel. We have made a video on crunch tool. Back to topic, for getting more information, follow the below command.

john –wordlist=/root/rockyou.txt new_hash

john –wordlist=/root/rockyout.txt new_hash

In the end, John has decrypted the hash. In the image, with the help of the command, I have shown how to view your password. As I said many times, follow the below command.


john –show new_file

john –show new_hash

Wow, we are glad. I never expected that I would get my password again, I have marked the password in the below image. I would like to thanks John the Ripper tool.


Latest Posts


3 Comments

Add a Comment

Your email address will not be published. Required fields are marked *