Transcript
Page 1: How i cracked millions of “pt br” hashed passwords

How I Cracked Millions of “pt_BR” Hashed Passwords

NullByte Security Conference 2015

Page 2: How i cracked millions of “pt br” hashed passwords

Aviso

O conteúdo aqui apresentado representa minhas próprias conclusões e opiniões e não as de meus empregadores, clientes e etc

Senhas apresentadas nesta palestra foram inseridas como exemplo fictício e qualquer semelhança com a realidade é mera coincidência.

Page 3: How i cracked millions of “pt br” hashed passwords

Algumas Definições

OSINT “Open source intelligence ou Inteligência de Fontes Abertas é o termo usado para descrever a inteligência no sentido de informações, (...) obtida através dados disponíveis para o público em geral, como jornais, revistas científicas, sql injection e emissões de TV. (...)” Wikipedia

SQL INJECTION “(...) WHAT'S THAT REALLY MEAN? People can possibly piggyback SQL commands into your statements. (...)" Puppy, Phrack 1998

PÚBLICO "público, pú.bli.co, adj (lat publicu) 1 Pertencente ou relativo a um povo ou ao povo. 2 Que serve para uso de todos. 3 A que todos têm o direito de assistir." http://michaelis.uol.com.br

Page 4: How i cracked millions of “pt br” hashed passwords

Equipamento

2x AMD Radeon HD 7970 Double Dissipation925 Core Clock (MHz)2048 Stream Processors 384 Bit Memory 5500 Memory Clock (MHz)

Page 5: How i cracked millions of “pt br” hashed passwords

Ferramentas

● Bash-fu (shellscripts)● oclHashcat● hashcat

Page 6: How i cracked millions of “pt br” hashed passwords

De quantos hashes estamos falando?

6.103.439 hashes MD5 provenientes somente de fontes nacionais

4.520.589 hashes únicas

Page 7: How i cracked millions of “pt br” hashed passwords

Objetivo

❏ Documentar processo e técnicas utilizadas

❏ Criar mecanismo para busca rápida (grep é muito lento!)

Page 8: How i cracked millions of “pt br” hashed passwords

Fácil e rápido

● Alphanumeric + Symbol● Length < 6● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 ?a?a?a?a?a?a

Recovered......: 489354/4520589 (0.00%) Digests, 0/1 (0.00%) Salts

bc06rfert42g

Page 9: How i cracked millions of “pt br” hashed passwords

Demo...

● Alphanumeric + Symbol● Length < 6● < 10 min

Page 10: How i cracked millions of “pt br” hashed passwords

Incluindo Charset pt_BR (ISO-8859-1)

● Alphanumeric + Symbol + ISO-8859-1 Charset● Length < 6● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 -1 charsets/standard/Portuguese/pt_ISO-8859-1.hcchr -2 ?1?a ?2?2?2?2?2?2?2?2

Recovered......: 87/4031235 (0.00%) Digests, 0/1 (0.00%) Salts

Page 11: How i cracked millions of “pt br” hashed passwords

Demo...

● Alphanumeric + Symbol + ISO-8859-1 Charset● Length < 6● < 10 min

tiçafênixbarça

CARTÃOchulé

Mengão

Page 12: How i cracked millions of “pt br” hashed passwords

Máximo de números possíveis

● Numeric● Length > 6 < 13● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 ?d?d?d?d?d?d?d?d?d?d?d?d?d

Recovered......: 248449/4031148 (0.00%) Digests, 0/1 (0.00%) Salts

24069656344300

3492565046

Page 13: How i cracked millions of “pt br” hashed passwords

Minúsculas pt_BR

● ISO-8859-1 Lowercase● Length < 7● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 -1 /c/tools/oclHashcat-1.37/charsets/standard/Portuguese/pt_ISO-8859-1.hcchr -2 ?1?l ?2?2?2?2?2?2?2

Recovered......: 71313/3782676 (0.00%) Digests, 0/1 (0.00%) Salts

Page 14: How i cracked millions of “pt br” hashed passwords

Maiúsculas pt_BR

● ISO-8859-1 Uppercase● Length > 6 < 7● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 -1 /c/tools/oclHashcat-1.37/charsets/standard/Portuguese/pt_ISO-8859-1.hcchr -2 ?1?u ?2?2?2?2?2?2?2

Recovered......: 2785/3711363 (0.00%) Digests, 0/1 (0.00%) Salts

Page 15: How i cracked millions of “pt br” hashed passwords

Só símbolos

● Symbol● Length < 8● < 10 min

oclHashcat64.bin -a 3 -m 0 --increment --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 ?s?s?s?s?s?s?s?s

Recovered......: 19/3707927 (0.00%) Digests, 0/1 (0.00%) Salts

Page 16: How i cracked millions of “pt br” hashed passwords

Wordlists

oclHashcat64.bin -a 0 -m 0 --remove --gpu-temp-retain 75 --outfile=elasticfriends.nouniq.md5.cracked elasticfriends.nouniq.md5 all_words.dic

Recovered......: 980236/3707908 (0.00%) Digests, 0/1 (0.00%) Salts

dazzlepod.dicmovies_nospace_lower.txtproverbs_nopunct_nospace.txttomsawyer.dicartists_nopunct.txtactors-characters_nopunct_lower.txtmovies.txtproverbs_nopunct_nospace_lower.txtsubjects_nospace.txtactors_nopunct_lower.txt

gaming.diceNtr0pY_ALL_sort_uniq_clean.dicauthors_nospace.txtproverbs_nopunct_lower.txtworks_nopunct_nospace.txtlabels_nopunct_lower.txtmovies_nopunct_nospace_lower.txtactors-characters_nopunct_nospace_lower.txtbigpot.pot(...)

Page 17: How i cracked millions of “pt br” hashed passwords

Onde estamos 3 horas depois?

● Recovered......: 489354/4520589 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 87/4031235 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 248449/4031148 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 71313/3782676 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 2785/3711363 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 19/3707927 (0.00%) Digests, 0/1 (0.00%) Salts● Recovered......: 980236/3707908 (0.00%) Digests, 0/1 (0.00%) Salts

1.792.243 out of 4.520.589 = 39.66%

Page 18: How i cracked millions of “pt br” hashed passwords

Indo além, técnicas conhecidas

● Combinator● Fingerprint● Hybrid● Rule-based● Brute-Force (markov)

Page 19: How i cracked millions of “pt br” hashed passwords

Combinator

● Você tem dois dicionários, um para cada "lado".● Cada palavra do dicionário da "direita" é anexada a cada palavra do lado

esquerdo.● Se seu dicionário do lado esquerdo tem 100 palavras e o dicionário do lado

direito tem 50, o número total de candidatos geradados é 100 * 50 = 5000

ricardosaudadeseternassoeuseiminhasenha2

MarceloRobertolarissalourençocoredevices23

TheOffspring1998AmericanaP@ssw0rd194543P@ssw0rd

Page 20: How i cracked millions of “pt br” hashed passwords

Fingerprint

● Automático e Cíclico● Sem interação humana● Expander sobre a lista de hashes quebradas + Combinator

Ex: Palavra “nullbyte” expandida gera 66 candidatos que quando combinados podem encontrar senhas como as abaixo:

null123bytenull

123nullbyte

Page 21: How i cracked millions of “pt br” hashed passwords

Hybrid

● Mácara + Dicionário● Dicionário + Máscara

mengo849578thiago828486mestre188416

13dejulho220391jurema

Page 22: How i cracked millions of “pt br” hashed passwords

Rule-Based

● Rules são como pequenas linguagens de programação, tanto Hashcat como John The Ripper tem um interpretador próprio (porém compatíveis em sua grande maioria de regras)

● Por exemplo uma regra para inserir um caractere no começo da palavra, inverter uma palavra, remover caracteres, etc

● Tanto John como Hashcat vem com alguns arquivos de .rule prontos para utilizar

● Utilizando o modo debug é possível gerar rules para cada hash quebrada

Page 23: How i cracked millions of “pt br” hashed passwords

Rule-Based

● Best69● Leetspeak + Toggles● cat rules/* > /tmp/all.rules

c1t3d0wn325476/esP@ssw0rdN@ty29o2

Page 24: How i cracked millions of “pt br” hashed passwords

Markov Brute

● Usa a tool hcstatgen (hashcat-utils) para gerar arquivo hcstat● Otimiza por posição através de “ranking”

[s] [e] [n] [h] [a]

1a. s , b , t , r , p2a. a , e , i , k , h3a. r , t , e , w , s

Page 25: How i cracked millions of “pt br” hashed passwords

Pipal, PACK, maskgen....(...)Character setsloweralphanum: 826625 (42.13%)numeric: 469265 (23.92%)loweralpha: 351744 (17.93%)upperalphanum: 202274 (10.31%)mixedalphanum: 36764 (1.87%)loweralphaspecialnum: 20968 (1.07%)upperalpha: 16518 (0.84%)mixedalpha: 11328 (0.58%)loweralphaspecial: 9131 (0.47%)specialnum: 4281 (0.22%)mixedalphaspecialnum: 4019 (0.2%)mixedalphaspecial: 1290 (0.07%)upperalphaspecialnum: 863 (0.04%)upperalphaspecial: 263 (0.01%)special: 69 (0.0%)

Page 26: How i cracked millions of “pt br” hashed passwords

Mecanismo de busca rápida

Como?

Page 27: How i cracked millions of “pt br” hashed passwords

Big Data Techniques FTW!

Elasticsearch + Kibana

Page 28: How i cracked millions of “pt br” hashed passwords

Big Data Techniques FTW!

es_nullbyte_populate.py

Page 29: How i cracked millions of “pt br” hashed passwords

Big Data Techniques FTW!

es_nullbyte_search.py

Page 30: How i cracked millions of “pt br” hashed passwords

Obrigado

uss.thebug [a] gmail.com@usscastro


Recommended