InfoSec News & Investigations

How to Use John The Ripper in a Google Collab for FREE!

How many times have you needed to use John The Ripper to do some password cracking but just not had whatever you needed, or for whatever reason wanted to use an online GPU? Well, now you can do this all thanks to Google Collab.

Google Colab is a free cloud service and now it supports free GPU! You can; improve your Python programming language coding skills. develop deep learning applications using popular libraries such as Keras, TensorFlow, PyTorch, and OpenCV and so much more depending on your creativity.

So first steps first, you are going to want to visit https://colab.research.google.com/notebooks/intro.ipynb and you will see a welcome page similar to this screenshot.

Click on the File Menu and then New Notebook

At this point you need to make sure you are logged in with your google account or you will see the Sign In screen. Go and sort that out, then come back here once all sorted.

Now I have my account set to use Dark Mode, so we will follow along using my account.

You should now be sitting at a screen similar to this:

Now I like to add Text instructions to my notebooks to remind me later on of what I was doing. So let’s do that. Click on the + Text button at the top of the screen and add something similar to the following. This is reminding me that each time I start the notebook, to ensure I am using the correct “runtime”.

Adding the # makes it use a larger font, like a header/title.

So now you know how to add text blocks (+Text button) we are doing to want to add some +Code blocks. Again simple, click on the + Code button at the top or hover your mouse near the bottom of the block and you can choose what your next code block will be.

All commands that are using python need to have a ! at the start of the line.
We are going to want to add a code block with the following command.

!nvidia-smi

Now click on the little play icon and it will execute the command and show the output

Now we know we have a GPU and we have a notebook we can use, lets start getting the rest of the stuff we need, so lets go and clone the github repo of John The Ripper and get a password list like rockyou.txt

!git clone https://github.com/magnumripper/JohnTheRipper.git

!wget https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt -O /content/rockyou.txt

For each command, you need to click on the play button and wait for it to execute. Once it is complete you can click on the next command. For each command from here on
ADD THE CODE
CLICK PLAY

With that said, you will want to get your password hashes. At this point, you can link your google drive to the notebook or just download the hashes from anywhere online.

A good link to read for linking your google drive is here https://colab.research.google.com/notebooks/io.ipynb or we can just wget the files from a github repo or a pastebin etc.

Now you will want to tell the system that you want to change the directory and start to compile the cloned repo. THIS WILL TAKE SOME TIME, JUST LET IT RUN.

All that is left to do is to start cracking passwords with John The Ripper.

Make sure you save your notebook and you can come back to it anytime you need it, click on the play buttons in order and you will have it setup and ready to run in a matter of minutes.

When all is done, you should see an output similar to the below.

I hope this tutorial has been of some use to you. Subscribe to my twitter to keep updated with new interesting tutorials and news.