Project 3: Passwords

  • This project is due at 11:59pm on Saturday, February 29, 2020.

Description and Deliverables

In this project, you will gain hands on experience cracking passwords and you will hopefully adopt better password practices that you take with you in your career. As such, this project has two distinct parts. I highly recommend that you start part one immediately: the necessary computations can take days to complete!

To receive full credit for this project, you will turn in the following two things:

  • A file named cracked.txt that contains the usernames and cracked passwords for the 50 users contained in this leaked /etc/shadow file.
  • A file named password_policy.txt that explains your choices in the second part of the assignment.
  • You will need to login to the project website using your U2F token several times. You will need to register a passphrase and enter it into the system a few times.

Each of these deliverables is described in greater detail below.

Part 1: Password Cracking

Linux systems typically store cryptographically hashed user passwords in crypt format in the /etc/shadow file. If you have sudo access to a Linux system, you can view this file on your own system (don’t try to look at this file on systems you don’t own, like the Khoury College Linux machines). The file format for the /etc/shadow file is described here.

In this part of the project, you will crack the hashed passwords contained in this leaked /etc/shadow file. There are 50 usernames and passwords in the file, meaning that it will take several days of compute power to crack all 50 passwords, so start this process early!

Cracking Tools

We recommend that students use well-known, heavily optimized cracking tools like John the Ripper or HashCat for this part of the project. Both tools are available for multiple platforms, although they are trivial to install on Debian-based Linux systems:

sudo apt install john
sudo apt install hashcat

Both tools have built-in support for the /etc/shadow file format, have the ability to pause and resume cracking sessions (a useful feature, since cracking can take hours/days), and support multiple different strategies for guessing passwords (e.g. brute force, word lists, etc.). We leave it to you to determine which tool you prefer and learn its command line syntax. Students are welcome to use whatever password guessing approach they want; many wordlists are available for free online, including from the John the Ripper homepage.

John the Ripper and HashCat both have the ability to run in multi-threaded configurations (i.e. they try to crack multiple passwords in parallel). We highly recommend that students utilize these features; for example, on a quad-core laptop, running John the Ripper with the “–fork=3” option to use three CPU cores is a reasonable approach. Alternatively, if your computer has a GPU, we highly recommend using the GPU-optimized, OpenCL modes available in both programs, since GPUs are several orders of magnitude faster at password cracking than CPUs.

Cracking Approach

The leaked shadow file is designed to have a sliding difficulty scale. Without doing anything fancy, roughly half of the passwords should crack in just a few minutes. Why do you think these passwords were so easy to crack?

With a reasonably comprehensive wordlist/dictionary (links to examples are provided in Part 2 of the project) combined with common permutation rules, another ~15 passwords should crack within 24 hours. For example, using John the Ripper the following command will attempt to crack the passwords using a wordlist of your choice and John’s built-in permutation rules (e.g. capitalizing the first and last letters of words, adding random numbers to the end of words, etc.).

$ john –wordlist=[path to your wordlist] –rules –fork=3 [path to the shadow file]
The remaining ~10 passwords are more challenging, and require more expansive permutation rules (hint: symbols) or even raw brute force to crack. For example, using John the Ripper, you can attempt a brute force attack against the shadow file using all combinations of ASCII characters with length <14 using the following command:
$ john –incremental=ASCII –fork=3 [path to the shadow file]
Note that this kind of brute force approach will take a long time to complete.

File Format for Part 1

To complete part 1 of this project, you will turn in a file named cracked.txt that contains the usernames and cracked passwords for the 50 users in the leaked shadow file. Each user and corresponding password should appear on one line in cracked.txt separated by a colon. For example, the format of a valid submission might look like this:

romeo:really_strong_password6@
juliet:1337cr4ck1ngsk1llz
tybalt:weak1234
mercutio:lalala

Part 2: Good Password Habits

In this part of the project, you will practice good password habits by (a) learning how to pick a passphrase, (b) installing and using a password manager, and (c) registering your u2f key with external sites for second-factor authentication.

Good passwords

One big reason why people choose weak passwords that are easily cracked is because they have been taught that only confusing passwords are secure. People either reject this advice and leave themselves vulnerable, or adopt password creation heuristics that are not resilient to cracking in practice (e.g. English word plus one capital letter, one random number, and one random symbol).

Since the early 90s, security researchers have advocated various password strategies to avoid those pitfalls; a folklore strategy is to pick a passphrase consisting of easy-to-type words. Several websites expore this concept. For example, usepassphrase provides a slick interface to this idea.

However, why should we trust the random number generator in our browser to select a password? And why should we trust that the website above isn’t logging the result? To prepare a truly offline password, you will use the diceware approach explained. That author has produced a list of 7776 short words in this file. The idea is that you roll dice 5 times to select a word in this list (because $6^5 = 7776$). If you want a 5-word password, repeat this 5 times. The main question is whether this passphrase is “memorable.”

  • Your first step is to use the diceware approach to pick a passphrase you will use to create an account on a test server.

This method is a robust method for picking unguessable passwords which you can train yourself to remember. Some people store large amounts of money in Bitcoin and they do not want to trust a hardware device to store their Bitcoin wallet key—these people often use a method similar to this. In fact, that it has been formalized as Bitcoin Improvement Proposal 39 (BIP39). I know people who have stored substantial sums using this method, and have challenged attackers to guess their passphrase with nobody succeeding.

Password manager

Install a password manager on your main computer and your phone. Investigate several offerings such as Lockwise, 1Password, Dashlane, or LastPass.

  • Your second step is to learn how each of these managers work and then make a personal security assessment on which is the right manager for you. You will install this manager and hopefully begin transitioning your passwords to it. Your deliverable is to write about your decision process.

Two Factor authentication

Register an account at cy2550.neucrypt.org. Use your gitlab username to register an account using the 2-factor token that I gave you in class. It is important that you use your gitlab account credential so that the grading script finds your name and assigns credit.

Your task is:

  • Use your 2-factor device to login to cy2550.neucrypt.org at least 5 times (a login is considered different if it is separate by 5 hours). This means that you need to start this part a few days early.
  • Part of your task is to make sure that you do not lose your token. I unfortunately do not have extras!
  • Once logged in, you will need to register a password with the site. This needs to be a long passphrase that you generated during the first step. The point of this step is to see how easy it is to remember your passphrase. The idea is that periodic re-entry of the passphrase will help you remember it for the long term.

This component of the assignemnt is self-driven and you can get out from it what you want. I encourage you to add second factor authentication to yout gitlab account, to your NEU account, and to your google account.

Submission Details

Please follow these directions exactly.

  1. Create a directory project3 under your git repo.
  2. Add the file cracked.txt to this directory.
  3. Add the file password_policy.txt containing (a) which password managers you studied, and an explanation on why you picked the one you choose.
  4. Submit your project. Feel free to resubmit the project as many times as you like. It is ok to have extra files in the repository as well, just make sure you have those two for us to find.

Grading

This project is worth 10% of your final grade, broken down as follows (out of 100):

  • 40 points - cracking at least 40 the passwords in the leaked file
  • 10 points - cracking at least 48 of the passwords in the leaked file
  • 5 points - cracking all of the passwords in the leaked file
  • 20 pts - submitting a password_policy.txt file with at least 3 sentences explaining your decision process.
  • 5 pts - registering your token
  • 5 pts each (up to 20) - for each login that you complete with a succesful password entry.

Points can be lost for turning in files in incorrect formats (e.g. not ASCII), failing to follow specified formatting or naming conventions, failing to compile, failing to follow specified command line syntax, insufficient or incorrect randomization, etc., failing to follow specified formatting or length conventions, etc.

Tips

  • Cracking passwords can take days so start part 1 of the project as soon as possible!