Password Cracking Basics

Collin Dewey

09/19/2024

Presentation Slides

Password Cracking Basics

For CTF Competitions bg right:42%


Preface - Different Representations of ASCII

These are not passwords, rather different representations of the letters.

BaseEncodingASCIIResult TextNote
2BinaryMoon01001101 01101111 01101111 01101110Digits 0-1
8OctalMagic115 141 147 151 143Digits 0-7
10DecimalSunset83 117 110 115 101 116Digits 0-9
16HexElements45 6C 65 6D 65 6E 74 73Digits 0-9 and A-F
64Base64Celestial!Q2VsZXN0aWFsIQ==a-z, A-Z, 0-9. = or == as padding

Why do passwords need to be “cracked”?

Passwords are hashed

If you hit “Forgot Password” and were emailed your password back, think again about using that service.


Password Salting

Passwords are often “salted”

AlgorithmTo Be HashedHashed Value
md5(“Cyber”)Cyber046e43ea3926a2f12f416a870f995a62
md5(“Cyber”+“hSgcC”)CyberhSgcC79cca74badfe10909be5fd43a61e2f30
md5(“Cyber”+“FQnJK”)CyberFQnLK02401e65e4eb1f305e3cb6ae921198b6

Approaches


Hash Tables

Hash tables are precomputed lookup tables of passwords and their hashed variants which leads to near-instant decoding of hashes.


Brute Force

Try every combination of characters for increasing lengths

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

+ Foreign Language Characters


Dictionary Attacks

RockYou


Common Hash Types

Hash-NameExample Hash
MD57ebc76247f2dc80d490199fad2113358
SHA12fc8f79f194c7a080bb629cf0a04f0c5cf653387
md5crypt$1$oFJabixr$P3CVha87xhby59qf2Hkpq/
NT:LM9BC9CDAFDFDBFDF55BFA81527A37D05E:F6332EE5142AC368C401F065B6F57E69

List of Example Hashes

Name That Hash


Online Hash Cracking Services

http://rainbowtables.it64.com/

https://hashes.com/en/decrypt/hash/

https://crackstation.net/


ophcrack

ophcrack is a free Windows (LM/NTLM) password cracker using Rainbow Tables

TableCharsetLengthGiB
XP Free Small[0-9],[a-z],[A-Z]1-14.7
XP Special*[0-9],[a-z],[A-Z], !"#$%&’()*+,-./:;<=>?@[\]^_`{|}~1-147.5
Vista Proba 60G[0-9],[a-z],[A-Z], !"#$%&’()*+,-./:;<=>?@[\]^_`{|}~5-1060
Vista SpecialXL[0-9],[a-z],[A-Z], !"#$%&’()*+,-./:;<=>?@[\]^_`{|}~1-7107
Vista eightXL[0-9],[a-z],[A-Z], !"#$%&’()*+,-./:;<=>?@[\]^_`{|}~82007

John The Ripper

bg right:59%

CPU Password Cracker


Hashcat

bg right:42%

GPU Accelerated Password Cracker


Hashcat Attack Modes

Mode #Attack TypeMethod
0Dictionary AttackTries every password in the list
1Combinator AttackCombines words from multiple wordlists
3Mask AttackSmart brute-forcing
6Hybrid AttackWordlist + a mask
7Hybrid AttackA mask + Wordlist

Picking a Wordlist


Hashcat Arguments

Specify hash type with -m #

Specify attack mode with -a #

Speedup Arguments


Dictionary Attack (Mode 0)

hashcat -m 0 -a 0 MD5_Hash_File.txt wordlist.txt

password

Combinator Attack (Mode 1)

hashcat -m 0 -a 1 MD5_Hash_File.txt animal_names.txt city_names.txt

WolfChicago


Mask Attacks (Mode 3)

hashcat -m 0 -a 3 MD5_Hash_File.txt CTF-?u?u?u?u-?d?d?d?d

CTF-AAAA-0000 through CTF-ZZZZ-9999

CharsetCharsCharsetChars
?labcd….xyz?uABCD….XYZ
?d0123456789?h0123456789abcdef
?H0123456789ABCDEF?s!"#$%&’()*+,-./:;<=>?@[\]^_`{|}~
?a?l?u?d?s?b0x00 - 0xff

Hybrid Attacks (Mode 6)

hashcat -m 0 -a 6 MD5_Hash_File.txt wordlist.txt ?d?d?d?d

password0000 through lastpassword9999

Hybrid Attacks (Mode 7)

hashcat -m 0 -a 7 MD5_Hash_File.txt ?d?d?d?d wordlist.txt

0000password through 9999lastpassword


Rules

Works on Dictionary Attacks and Hybrid Attacks

hashcat -m 0 -r leetspeak.rule -r toggles1.rule -a 0 MD5_Hash_File.txt wordlist.txt

Passw0rd pa55woRd


aircrack-ng

Crack WEP/WPA-PSK passwords

aircrack-ng -w dictionary.txt wireless.cap

hcxtools

Convert wireless captures to JtR/Hashcat


Useful Links

Hashcat Example Hashes

Name That Hash

John The Ripper Tools Online


Wordlist Sites

Weakpass

SecLists

wordlistctl CLI tool


Hashcat Rules

One Rule To Rule Them All

Pantagrule

Kaonashi

Hashcat Rules


>> Home