Recover PDF file password in kali linux

John the ripper

At times it happens that you forget your Pdf file's password and the document is very important for you. In this situation the only option is to either you remember your password or bypass the Pdf password.
If you are using Kali linux then you must be aware of "John the ripper" tool.
Using this tool we are going to Recover Pdf file password.

Requirement : Kali linux , Internet connection, a password protected Pdf file.
Pdf file
Pdf file

As you can see I have Pdf file named "confidential" on the screen, but unfortunately i have forgotten it's password. So i am going to crack the password by John the ripper.



  • STEP 1 :

Open your Kali Terminal and clone the below GitHub Link
https://github.com/magnumripper/JohnTheRipper.git
Command : git clone https://github.com/magnumripper/JohnTheRipper.git
John the ripper
git link for John the ripper
Press Enter and the installation will start. It will take sometime to download.
John the ripper
Installing John the ripper
Here, I have stopped the installation as i have already downloaded the tool.

  • STEP 2 :

After installation, Navigate to your directory in terminal where you have downloaded your tool.
In my case I have downloaded it on Desktop.
After navigating to the directory.
Type : ls
It will show all the files and directories. Now you have to get inside your JohnThe Ripeer tool.
Typecd JohnTheRipper
Now you will be inside JohnTheRipper direcorty
Type : ls
Now you can see different files, You have to navigate to run file.
Type : cd run
Now you will be inside run folder
John the ripper
John the ripper

Type :  ls
All the tools will show up on the screen.
We have to use pdf2john.pl tool. It is a Perl scripted tool that we are going to use.
John the ripper tools
Tools

Type  : ./pdf2john.pl  'Your pdf file path' > 'path for saving your hashes' 
In my case the command is ./pdf2john.pl '/root/Desktop/Confidential.pdf' > '/root/Desktop/password.txt'
Here : /root/Desktop/Confidential.pdf  is my pdf path
Here : /root/Desktop/password.txt  is path for saving my hashes
pdf2john
pdf2john.pl

Now a file will be created with hashes in it where you have saved it.
Hash file
Hash file



  • STEP 3:

After all this steps the final step is to crack the hash file through john the ripper tool using brute force method.
Type : john --format=pdf  'Hash file path'
In my case the command is : john --format=pdf  '/root/Desktop/password.txt'
Here : '/root/Desktop/password.txt' is my hash file path
John the ripper
Cracking hashes
After this command your part of job is done. John tools will conduct brute force attack on those hashes to crack.
Brute force
Password cracked
As here you can see my password for the Pdf file is 123456.





Reactions

Post a Comment

0 Comments