+ All Categories
Home > Documents > PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm...

PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm...

Date post: 05-Mar-2018
Category:
Upload: vongoc
View: 217 times
Download: 4 times
Share this document with a friend
42
PRINCE modern password guessing algorithm
Transcript
Page 1: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCE

modern password guessing algorithm

Page 2: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

FUTURE OF PASSWORD HASHESWhy do we need a new attack-mode?

Jens Steube - PRINCE algorithm08.12.2014 2

Page 3: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Future of modern password hashes

Feature

• High iteration count

• Salted

• Memory-intensive

• Configurable parameters

• Anti-Parallelization

• …

Effect

• Slow

• Rainbow-Tables resistance

• GPU resistance

• Slow

• Slow

08.12.2014 Jens Steube - PRINCE algorithm 3

Page 4: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Algorithms used for password hashing, by performance*

Name Speed

NTLM, MD5, SHA1-512, Raw-Hashes 1 BH/s - 10 BH/s

Custom (Salt): VBull, IPB, MyBB 100 MH/s - 1 BH/s

DEScrypt 10 MH/s - 100 Mh/s

MD5crypt 1 MH - 10 MH/s

TrueCrypt, WPA/WPA2 (PBKDF2) 100kH/s - 1 MH/s

SHA512crypt, Bcrypt (Linux/Unix) 10kH/s - 100 kH/s

Custom (Iteration): Office, PDF, OSX 1kH/s - 10 kH/s

Scrypt (RAM intensive): Android 4.4+ FDE < 1 kH/s

* Performance oclHashcat v1.32Single GPUDefault settings for configurable algorithms

Jens Steube - PRINCE algorithm08.12.2014 4

Page 5: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Effects of modern password hashes

• Obsolete attack-modes:

– Brute-Force-attack

– Rainbow-Tables

Jens Steube - PRINCE algorithm08.12.2014 5

Page 6: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

REMAINING ATTACK VECTORSSo, what can the attacker do?

Jens Steube - PRINCE algorithm08.12.2014 6

Page 7: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Remaining attack vectors

• Hardware (FPGA/ASIC)

• Extract keys from RAM

• Efficiency

08.12.2014 Jens Steube - PRINCE algorithm 7

Page 8: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Remaining attack vectors

• Hardware (FPGA/ASIC)

• Extract keys from RAM

• Efficiency

• Easier to cool

• Lower power consumption

• Easier to cluster

• Clustering only linear

• Expensive development

• Unflexible?

08.12.2014 Jens Steube - PRINCE algorithm 8

Page 9: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Remaining attack vectors

• Hardware (FPGA/ASIC)

• Extract keys from RAM

• Efficiency

• Highest chance ofsuccess

• Requires physical access to the System

• System must run

08.12.2014 Jens Steube - PRINCE algorithm 9

Page 10: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Remaining attack vectors

• Hardware (FPGA/ASIC)

• Extract keys from RAM

• Efficiency

• Exploit human weakness:

– Psychology aspects

– Password reuse

– Pattern

• Limited keyspace

• Using rules:

– Limited pattern

– Takes time to develop

08.12.2014 Jens Steube - PRINCE algorithm 10

Page 11: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCE ATTACKFeatures and advantages compared to previous attack modes

Jens Steube - PRINCE algorithm08.12.2014 11

Page 12: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Advantages over other Attack-Modes

• Simple to use, by design

• Smooth transition

• Makes use of unused optimizations:

– Time works for attacker

– Personal aspects

08.12.2014 Jens Steube - PRINCE algorithm 12

Page 13: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Advantages over other Attack-Modes

• Simple to use, by design

• Smooth transition

• Makes use of unused optimizations:

– Time works for attacker

– Personal aspects

• No monitoring required

• No extension required

• No syntax required

08.12.2014 Jens Steube - PRINCE algorithm 13

Page 14: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Advantages over other Attack-Modes

• Simple to use, by design

• Smooth transition

• Makes use of unused optimizations:

– Time works for attacker

– Personal aspects

• Primary goal of the algorithm

• Starts with highest efficiency

– Wordlist

– Hybrid

– Keyboard walks / Passphrases

– Brute-Force + Markov

• Not a scripted batch

08.12.2014 Jens Steube - PRINCE algorithm 14

Page 15: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Advantages over other Attack-Modes

• Simple to use, by design

• Smooth transition

• Makes use of unused optimizations:

– Time works for attacker

– Personal aspects

• Does not run out of (good) wordlists

– Time-consuming monitoring

• Does not need ideas

– Time-consuming extension

08.12.2014 Jens Steube - PRINCE algorithm 15

Page 16: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Advantages over other Attack-Modes

• Simple to use, by design

• Smooth transition

• Makes use of unused optimizations:

– Time works for attacker

– Personal aspects

• Personal Aspects

– Religion

– Political wing

– Red car

• Not hobbies, friends, dates, …

– Already covered with Wordlist-Attack

– Common knowledge not to use them

08.12.2014 Jens Steube - PRINCE algorithm 16

Page 17: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCE ATTACKAlgorithm details

Jens Steube - PRINCE algorithm08.12.2014 17

Page 18: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCE-attack

• PRobability

• INfinite

• Chained

• Elements

Jens Steube - PRINCE algorithm08.12.2014 18

Page 19: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Attack basic components

• Element

• Chain

• Keyspace

08.12.2014 Jens Steube - PRINCE algorithm 19

Page 20: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Attack basic components

• Element

• Chain

• Keyspace

• Smallest entity

• An unmodified line (word) of your wordlist

• No splitting / modification of the line

• Sorted by their length into element database

08.12.2014 Jens Steube - PRINCE algorithm 20

Page 21: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Element example

• 123456

• password

• 1

• qwerty

• ...

• Table: 6

• Table: 8

• Table: 1

• Table: 6

• ...

08.12.2014 Jens Steube - PRINCE algorithm 21

Page 22: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Attack basic components

• Element

• Chain

• Keyspace

• Sum of all elements lengths in a chain = chain output length

• Fixed output length

• Best view on this is in reverse order, eg. a chain of length 8 can not hold an element of length 9

08.12.2014 Jens Steube - PRINCE algorithm 22

Page 23: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Chains example, general

• Chains of output length 8 consists of the elements

• 8

• 2 + 6

• 3 + 5

• …

• 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

• Number of chains per length = 2 ^ (length - 1)

Jens Steube - PRINCE algorithm08.12.2014 23

Page 24: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Attack basic components

• Element

• Chain

• Keyspace

• Number of candidates that is getting produced, per chain

• Different for each chain

• The product of the count of the elements which build the chain

08.12.2014 Jens Steube - PRINCE algorithm 24

Page 25: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Element example (rockyou)

• length 1: 45

• length 2: 335

• length 3: 2461

• length 4: 17899

• …

08.12.2014 Jens Steube - PRINCE algorithm 25

Page 26: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Keyspaces of chains of length 4 (rockyou)

Chain Elements Keyspace

4 17,899 17,899

1 + 1 + 1 + 1 45 * 45 * 45 * 45 4,100,625

1 + 1 + 2 45 * 45 * 335 678,375

1 + 2 + 1 45 * 335 * 45 678,375

1 + 3 45 * 335 15,075

2 + 1 + 1 335 * 45 * 45 678,375

2 + 2 335 * 335 112,225

3 + 1 335 * 45 15,075

08.12.2014 Jens Steube - PRINCE algorithm 26

Page 27: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Keyspaces of chains of length 4 (rockyou)

Chain Elements Keyspace

3 + 1 335 * 45 15,075

1 + 3 45 * 335 15,075

4 17,899 17,899

2 + 2 335 * 335 112,225

2 + 1 + 1 335 * 45 * 45 678,375

1 + 2 + 1 45 * 335 * 45 678,375

1 + 1 + 2 45 * 45 * 335 678,375

1 + 1 + 1 + 1 45 * 45 * 45 * 45 4,100,625

08.12.2014 Jens Steube - PRINCE algorithm 27

Page 28: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Keyspace selection, general

• Sorting by lowest keyspace creates the floating effect inside the prince attack-mode:

– Wordlist

– Hybrid

– Keyboard walks / Passphrases

– Brute-Force + Markov

08.12.2014 Jens Steube - PRINCE algorithm 28

Page 29: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Candidate output length selection

• The Algorithm has to chose the order of the output length for candidates

• Word-length distribution in a wordlist is a known structure

• The algorithm recreates its own stats from the input wordlist

http://blog.erratasec.com/

08.12.2014 Jens Steube - PRINCE algorithm 29

Page 30: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Personal aspects

• To make use of this feature, you need a specific wordlist

– Use a tool like wordhound to compile such a wordlist (grabs data from URL, twitter, reddit, etc)

• Cookbook phase:

– Decide yourself if you want to use the raw list or

• Preprocess the wordlist with some rules applied

• Mix in like top 10k from rockyou

• Mix in some single chars for late BF

08.12.2014 Jens Steube - PRINCE algorithm 30

Page 31: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Problems of the attack

• Elements in the wordlist requires all lengths

• Chain-count for long outputs

• Generated dupes

08.12.2014 Jens Steube - PRINCE algorithm 31

Page 32: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Problems of the attack

• Elements in the wordlist requires all lengths

• Chain-count for long outputs

• Generated dupes

• For calculation length distribution

08.12.2014 Jens Steube - PRINCE algorithm 32

Page 33: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Problems of the attack

• Elements in the wordlist requires all lengths

• Chain-count for long outputs

• Generated dupes

• Can be suppressed with divisor parameter

08.12.2014 Jens Steube - PRINCE algorithm 33

Page 34: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Problems of the attack

• Elements in the wordlist requires all lengths

• Chain-count for long outputs

• Generated dupes

08.12.2014 Jens Steube - PRINCE algorithm 34

Page 35: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

Princeprocessor internal

• Load words from wordlist

• Store words in memory

• Generate element chains for each password length– Reject chains that does include an element which points to

a non-existing password length

• Sort chained-elements by keyspace of the chain

• Iterate through keyspace (mainloop)– Select the next chain of that password length

– Generate password with chain

– Print

Jens Steube - PRINCE algorithm08.12.2014 35

Page 36: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCE ATTACKUsage

Jens Steube - PRINCE algorithm08.12.2014 36

Page 37: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

How to use it from users view

• Download princeprocessor

• Choose an input wordlist which could be:

– One of your favourite wordlist (rockyou, etc…)

– Target-specific optimized wordlist

• Pipe princeprocessor to your cracker

– ./pp64 < wordlist.txt | ./oclHashcat hash.txt

Jens Steube - PRINCE algorithm08.12.2014 37

Page 38: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

How to use it from users view

• Optionally

– Choose password min / max length

– Choose character classes to pass / filter

– Choose start / stop range -> Distributed

– Choose minimum element length

– Choose output file, otherwise written to STDOUT

Jens Steube - PRINCE algorithm08.12.2014 38

Page 39: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

LIVE DEMO 1

• Wordlist

– Top 100k of rockyou.txt

• Hashlist

– Public leak „stratfor“, 822k raw MD5 hashes

• Preparation

– Removing raw dictionary hits first

Jens Steube - PRINCE algorithm08.12.2014 39

Page 40: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

LIVE DEMO 2

• Wordlist

– Generated by scraping stratfor site

• Hashlist

– Public leak „stratfor“, 822k raw MD5 hashes

• Preparation

– Removing raw dictionary hits first

08.12.2014 Jens Steube - PRINCE algorithm 40

Page 41: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

PRINCEPROCESSOR V0.10 RELEASE

Download from: https://hashcat.net/tools/princeprocessor/

- Linux

- Windows

- OSX

08.12.2014 Jens Steube - PRINCE algorithm 41

Page 42: PRINCE - hashcat · PDF fileinto element database 08.12.2014 Jens Steube - PRINCE algorithm 20. Element example •123456 •password •1 ... –Public leak „stratfor“, 822k raw

THANKS! QUESTIONS?

Email: [email protected]

IRC: freenode #hashcat

Jens Steube - PRINCE algorithm08.12.2014 42


Recommended