cracke-dit ("Cracked It") makes it easier to perform regular password audits against Active Directory environments.
Ensuring your users have strong passwords throughout the organisation is still your best line of defence against common attacks. Many organisations over estimate just how secure their users' passwords are. "London123", "Winter2017", "Passw0rd" - all complex passwords, according to the default Group Policy rules, and probably your users.
By performing regular audits, you can identify users with weak passwords and take action inline with your policies and procedures.
Python 2.7+ and pip are required. Then just:
git clone https://github.com/eth0izzle/cracke-dit.git
- (optional) Create a virtualenv with
pip install virtualenv && virtualenv .virtualenv && source .virtualenv/bin/activate
pip install -r requirements.txt
python cracke-dit.py --help
(and see Usage)
The first step in your password cracking adventure is to extract a copy of the Active Directory database, ntds.dit, which contains the password hashes. Depending on your persuasion you have a few options - choose one:
If you are on the same network as a domain controller you can extract the hashes directly.
python cracke-dit.py --username administrator --password passw0rd --target 192.168.1.1
(where 192.168.1.1 is a DC).- Move on to Step 3.
- On a Domain Controller open up an elevated command prompt.
- Run
ntdsutil "ac i ntds" "ifm" "create full c:\temp" q q
. - Securely extract
c:\temp\Active Directory\ntds.dit
andc:\temp\registry\SYSTEM
to your system with cracke-dit. - Move on to Step 2.
(not required if you followed Step 1a and remotely extracted with cracke-dit)
All password hashes are protected with 3 layers of encryption. Thankfully everything we need to decrypt is within the SYSTEM hive. The next step is to extract the hashes and usernames in to a separate file for cracking:
- Run
python cracke-dit.py --system SYSTEM --ntds ntds.dit
(optionally with--no-history
flag if you don't care about historic passwords) - Once complete, your username:hash file will be at
<domain>.hashes.ntlm
- delicious.
cracke-dit doesn't actually crack passwords, you will need to use your favourite password cracker for that. cracke-dit just needs a .pot
file (hash:password) for processing. I'm partial to hashcat so:
hashcat -m 1000 --potfile-path <domain>.pot --username <domain>.hashes.ntlm /usr/share/Wordlists/rockyou.txt
which will be pretty quick.- I'd recommend a second pass with H0bRules:
hashcat -m 1000 --potfile-path <domain>.pot --username <domain>.hashes.ntlm /usr/share/Wordlists/rockyou.txt -r hob064.rule
Now we have cracked a bunch of hashes, let's load them in to cracke-dit!
python cracke-dit.py --pot <domain>.pot --domain <domain>
(where domain is FQDN, i.e. acme.local). Optionally pass in--only-users
or--only-enabled
- hopefully they are self explanatory.
Using the ntds.dit and SYSTEM in ./samples
we get the following output:
-
Users highlighted in green are enabled, red are disabled, and gray is an historic password.
-
Password scores are based on Dropbox's zxcvbn:
Score Description Guesses 0 Too guessable: risky password. < 10^3 1 Very guessable: protection from throttled online attacks. < 10^6 2 Somewhat guessable: protection from unthrottled online attacks. < 10^8 3 Safely unguessable: moderate protection from offline slow-hash scenario. < 10^10 4 Very unguessable: strong protection from offline slow-hash scenario. => 10^10 -
By default passwords are checked against Have I Been Pwned to see if they appear in breach lists. Passwords are never transmitted as we use the k-Anonymity model.
Results can be processed by different output modules via the --output
argument.
The default output module and shown in the demo above. Shows interesting stats, top 10 passwords by reuse, the top 5 worst passwords and if any passwords use month or day names.
E-mails the top 25 passwords (by reuse).
Spits out a wordcloud of all passwords, colored by password score.
-
Introduce internal training on what a secure password is, why they are important and embed it in to your induction programme.
-
Consider rolling out a password manager and adequate training for all of your users. Stronger, longer and more unique passwords is better for everyone.
-
Gradually increase your password minimum length requirement to 12 characters. Generally longer passwords are more secure.
-
Phase out forcing your users to "reset password every X days". There is research to suggest that this doesn't help create strong passwords, but in fact has the opposite effect. Don't forget the actual cost of this.
-
Carry out a password audit quarterly. You can very easily cron the steps above and run with the
email
output to have automated password cracking. -
Do not name and shame people with poor password hygiene - educate them! Get HR buy-in and introduce a "3 strike system" that will carry a formal warning.
Check out the issue tracker and see what takes your fancy.
- Fork it, baby!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
cracke-dit is under MIT. See LICENSE Impacket is under a slightly modified version of the Apache Software License. See LICENSE
Huge thanks CoreSecurity's Impacket!