Skip main navigation

New offer! Get 30% off your first 2 months of Unlimited Monthly. Start your subscription for just £29.99 £19.99. New subscribers only. T&Cs apply

Find out more

Using Rules in a Dictionary Attack

This video will show how to use rules to apply transformations and filters to word lists, rules in existing word lists, and creating custom sections.
6.4
Hello, world. I’m Zanidd and welcome back to the Hands On Password Cracking and Security Course on Code Red. In this section, we are going to take a look at dictionary attacks. In this video, we’re going to take a look how to further use rules to crack passwords using dictionary attacks. We’ve learned from previous lessons that different rules can be used to apply transformations and filter to our word list. So how can we do this?
49.4
You just need to open the /etc/john/john.conf file in your favorite editor.
69.2
Then you can search for the according section, namely List.Rules, Wordlist.
80.5
And you can see that there are already a couple of rules in this file. Now, you can still use these rules or you can create your own section like this and add your rules beneath it.
122.3
One important thing is, you might want to open this file as a root user. So just type in sudo, the name of your favorite editor, and the path to the john.conf file.
171
You might need a root user privilege to edit this file. So just enter sudo, the name of your favorite editor, the path to the file, hit Enter, and you have opened the file as root user.
191.4
One little hint, if you’re unfamiliar with Vim, you can also use Nano or a console editor.
202.9
Or you can use Mousepad or a standard editor with a GUI.
213.8
So what passwords will you encounter in this exercise, just to prepare you for the rules you will be writing? These are some examples. These are not the actual passwords that you’re going to break. But these are the classification of the passwords. So one is like football, a lowercase letters only password. And the second type will be like terces, which is just secret reversed. So you will have to reverse the words. Then we have something like jordan23, which is a lowercase word with two numbers. We also have something like !slegna777, which is basically a special symbol in front of a reversed word, in this case, it’s angels, and then three numbers at the end.
271.8
Then we have something like flowers, where you’ll have to replace O’s with zero’s. And also something like Amanda, which is to capitalize the first letter and add a number suffix.
297.2
If you go into the repository, you will find a directory called dictionary rules.
311.4
In this directory, you’ll have a couple of files which contain MD5 hashes of passwords.
320.8
Now, every file is basically an explanation of the rule you’ll have to write to correct this file efficiently. For example, you can see lower case add two numbers will have a word that’s lower case and contains two numbers at the end. And capitalize and add number will be a word that starts with an uppercase letter, the rest will be lowercase. And at the end of the word will be a number, like Amanda9 in our example.
365.8
So, your exercise for this video is to create rules for the passwords shown before. But be cautious. The exercise passwords are just similar types, not the exact same passwords. Let’s see how efficient rules you can write and how fast you can crack the passwords. Thank you for watching this section about dictionary attacks. In the next section, we’re going to save computing time by using Rainbow tables.

This video will demonstrate how to use rules to apply transformations and filters to word lists.

You can use rules in existing word lists, or create your own custom sections, and add new rules beneath them.

Over to you: Write rules for the passwords mentioned in the video. Using these rules, crack the passwords using a dictionary attack. Share your experience with your fellow learners in the Comments section below.

This article is from the free online

Advanced Cyber Security Training: Hands-On Password Attacks

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now