In Episode 8 of my Linux Attack and Defense webinar series, I attack a Capture the Flag (CTF) virtual machine themed after the first Matrix movie. Over the course of the attack, I use a local file inclusion (LFI) vulnerability to pull the web server’s hashed password file. The password in that file “cracks,” that is, matches a hash, quite quickly. The rest of the attack hinges on this step.
Now, with that said, as a red teamer and penetration tester with quite a bit of experience in password security, I’d like to talk about password strength. In the webinar, we dealt with an LFI vulnerability, but what about the ease with which we were able to crack a password? We were able to crack the password in just seconds. This is partly due to the hash choice used in a web server htaccess file, but the real culprit here was a dictionary word password, with letters changed to numbers. Not all passwords are created equal, not by far.
If the fictional victims in this CTF had chosen stronger passwords, it’s possible that an attacker would have taken so long to crack that password that it would already be changed. To understand this better, let’s talk about how password cracking works. To “crack” a password, we mean that we find a password whose hashed version is the same as a password hash we found. In the webinar, we hash entries from the “RockYou.txt” password list and compare these to the stolen hash until we found a match. RockYou.txt is a list of the roughly 14 million passwords that were in use on the RockYou social network application when it was hacked in 2009. This list is so popular that it ships with Kali Linux. That popularity stems from the fact that most humans pick passwords so awful, so non-unique that a ten-year old sample of awful passwords contains many of them.
As information technology staff, we have a responsibility to tell people how to choose better passwords. For me, this means:
- Use a password generator, free, commercial, or even non-digital.
- Use different passwords for every service, since your password on any service might get stolen, disclosed, and/or cracked
- Use long passwords: at least 14 characters or 6 random words
- Use multi-factor authentication, but don’t let this dissuade you from using strong passwords anyway since MFA mechanisms can have their weaknesses
- For bonus points, make sure your passwords aren’t in any password cracking list, like RockYou.txt
With that said, check out the webinar, Linux Attack and Defense: The Matrix, to see the entire attack and to learn how to configure the system to break your attack. You can even play along, pausing the video as you stop to do the same thing or to improvise your own cyber attack path or defense. Just get your own copy of Kali Linux and download the Matrix: 2 virtual machine you’ll find on VulnHub.com at: https://www.vulnhub.com/entry/matrix-2,279/
Additional Resources on Improving Enterprise Password Security
Privileged Password Management Explained (white paper)
Password Safe (datasheet)
BeyondTrust Enterprise Password Management (web page)
Jay Beale, CEO, CTO at InGuardians, Inc.
Jay Beale has created several defensive security tools, including Bastille Linux/UNIX and the CIS Linux Scoring Tool, both of which were used widely throughout industry and government. He has served as an invited speaker at many industry and government conferences, a columnist for Information Security Magazine, SecurityPortal and SecurityFocus, and a contributor to nine books, including those in his Open Source Security Series and the “Stealing the Network” series. He has led training classes on Linux Hardening and other topics at Black Hat, CanSecWest, RSA, and IDG conferences, as well as in private corporate training. Jay is a co-founder, Chief Operating Officer and CTO of the information security consulting company InGuardians.