SlideShare uma empresa Scribd logo
1 de 37
A CRYPTO-FAIL STORY
RootedCON Valencia
September 2017
2
Jose Selvi (@Jose Selvi)
+12 years in the infosec industry
Principal Penetration Tester
& Security Researcher
SANS Institute Community Instructor
GIAC Security Expert (GSE)
Blogger (sometimes): http://www.pentester.es
$ WHOIS JSELVI
3
I DID NOT MAKE A FULL VULNERABILITY RESEARCH
4
THIS IS NOT A CRYPTO TRAINING
5
6
7
TESTING CRYPTO IN 30 MINUTES
test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
REUSE SALT, REUSE IV
test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
test1@test.com : 000000 -> 2E C7 7C 2A 19 6E 02 2B AA 68 7E F0 61 67 51 B0
test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
test2@test.com : 123456 -> 7B 49 CF 4D E4 32 1E 77 93 21 1A B5 74 8B 44 DA
BASED ON EMAIL & PASSWORD
BLOCK CIPHER (REVERSIBLE) ENCRYPTION
B6 78 78 BD F5 72 FC BE 04 8B D5 33 44 98 7B 02
23 97 F8 B5 BD 63 3F 6D F8 AB 13 64 76 DD 37 BE
5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
8
SECURITY STRIKES BACK
9
NO EXPLOITATION, NO FUN
POTENTIALLY EXPLOITABLE
WE PRESUME THAT WITH ENOUGH EFFORT IT COULD BE EXPLOITED
10
QUICK LOOK AT THE BINARY
$ rabin2 -i server.exe | grep -i crypt
ordinal=001 plt=0x005c80c4 bind=NONE type=FUNC name=CRYPTUI.dll_CryptUIDlgViewCertificateW
ordinal=001 plt=0x005c8098 bind=NONE type=FUNC name=CRYPT32.dll_CertEnumCertificatesInStore
ordinal=002 plt=0x005c809c bind=NONE type=FUNC name=CRYPT32.dll_CertCloseStore
ordinal=003 plt=0x005c80a0 bind=NONE type=FUNC name=CRYPT32.dll_CertFreeCertificateContext
ordinal=004 plt=0x005c80a4 bind=NONE type=FUNC name=CRYPT32.dll_CertGetCertificateContextProperty
ordinal=005 plt=0x005c80a8 bind=NONE type=FUNC name=CRYPT32.dll_CertDuplicateCertificateContext
ordinal=006 plt=0x005c80ac bind=NONE type=FUNC name=CRYPT32.dll_CertGetEnhancedKeyUsage
ordinal=007 plt=0x005c80b0 bind=NONE type=FUNC name=CRYPT32.dll_CertGetNameStringW
ordinal=008 plt=0x005c80b4 bind=NONE type=FUNC name=CRYPT32.dll_CertOpenStore
ordinal=009 plt=0x005c80b8 bind=NONE type=FUNC name=CRYPT32.dll_CryptProtectData
ordinal=010 plt=0x005c80bc bind=NONE type=FUNC name=CRYPT32.dll_CryptUnprotectData
$ rabin2 -zz server.exe | grep -i crypt
vaddr=0x00626ff6 paddr=0x002257f6 ordinal=21488 sz=27 len=26 section=.rdata type=ascii
string=CryptUIDlgViewCertificateW
vaddr=0x00627012 paddr=0x00225812 ordinal=21489 sz=12 len=11 section=.rdata type=ascii string=CRYPTUI.dll
vaddr=0x0062755a paddr=0x00225d5a ordinal=21555 sz=17 len=16 section=.rdata type=ascii string=CryptProtectData
vaddr=0x0062756e paddr=0x00225d6e ordinal=21556 sz=19 len=18 section=.rdata type=ascii string=CryptUnprotectData
vaddr=0x00627582 paddr=0x00225d82 ordinal=21557 sz=12 len=11 section=.rdata type=ascii string=CRYPT32.dll
vaddr=0x0062f6e0 paddr=0x0022dae0 ordinal=22387 sz=40 len=39 section=.data type=ascii string=.?AU?
$Deleter@UCryptData@@P6AHPAU1@@Z@@
vaddr=0x0062f710 paddr=0x0022db10 ordinal=22388 sz=30 len=29 section=.data type=ascii string=.?AV?
$TPointer@UCryptData@@@@
vaddr=0x0062f738 paddr=0x0022db38 ordinal=22389 sz=34 len=33 section=.data type=ascii string=.?AV?
$TAutoFreeObj@UCryptData@@@@
11
12
HASHING ALGORITHMS
static void reset(uint32_t digest[], std::string &buffer, uint64_t &transforms)
{
/* SHA1 initialization constants */
digest[0] = 0x67452301;
digest[1] = 0xefcdab89;
digest[2] = 0x98badcfe;
digest[3] = 0x10325476;
digest[4] = 0xc3d2e1f0;
/* Reset counters */
buffer = "";
transforms = 0;
}
13
STREAM CIPHERS
14
BLOCK CIPHERS
15
16
17
AES has 10 rounds for 128-bit
keys, 12 rounds for 192-bit
keys, and 14 rounds for 256-bit
keys.
18
19
20
21
22
CRACKING THE “HASH”
$ ./crack my@email.com 52796b
User: my@email.com
Password: test123456
23
RESULT
24
DO NOT USE ECB MODE NEVER EVER
25
$ echo Testing1234 | openssl enc -aes-128-ecb -K 1234 -iv 1 | hexd
0000000 8d 47 5c 5f bb 1b 1c 0a 79 ca e5 45 6a 8f c4 58
$ echo Testing1234 | openssl enc -aes-128-ecb -K 1234 -iv 2 | hexd
0000000 8d 47 5c 5f bb 1b 1c 0a 79 ca e5 45 6a 8f c4 58
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv
0001 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv
0002 | hexdump
0000000 1b 28 1f e3 10 fa 69 14 8b 80 e2 64 97 2e 93 d0
26
https://github.com/golang/go/issues/5597
27
ALWAYS USE DIFFERENT IVs ON EACH MESSAGE
28
REUSING IVs ON AES
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
$ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump
0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
29
REUSING IVs ON STREAM CIPHERS
W E L C O M E T O T H I S
12 34 56 78 9A BC DE F0 12 34 56 78 9A BC DE F0
H I D D E N M E S S A G E ! .
12 34 56 78 9A BC DE F0 12 34 56 78 9A BC DE F0
(M1 ⊕ KEY) ⊕ (M2 ⊕ KEY)
M1 ⊕ M2
30
DO NOT USE REVERSIBLE ENCRYPTION FOR PASSWORDS
Credentials Storage
31
AUTHENTICATION & HASHING
pass1234
Client Side Server Side
XYZW
XYZW
Code
Credentials Storage
32
SALT & PEPPER
pass1234
Client Side Server Side
SALT$XYZW
SALT$XYZW
PEPPER
PEPPERSALT
33
PASSWORD SPECIFIC HASHING: PBKDF2, BCRYPT, SCRYPT, …
34
SERIOUSLY, DO NOT KEEP SECRETS AT CLIENT SIDE
XYZWABCD
Random Token Generator
Token Storage
35
RANDOM TOKENS
Client Side Server Side
XYZWABCD
JSON Token Generator
XYZWABCD
Token Storage
36
JSON WEB TOKENS (JWT)
Client Side Server Side
Certification Authority
CA
www.prosegur.comwww.prosegur.com
THANKS A LOT!
ANY QUESTIONS?
jose.selvi@prosegur.com
jselvi@pentester.es
@JoseSelvi

Mais conteúdo relacionado

Semelhante a José Selvi - Historia de un CryptoFAIL [rootedvlc4]

Star bed 2018.07.19
Star bed 2018.07.19Star bed 2018.07.19
Star bed 2018.07.19Ruo Ando
 
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...MITRE - ATT&CKcon
 
Algebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions ManualAlgebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions Manualkejeqadaqo
 
ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"Doug Hawkins
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON
 
DEP/ASLR bypass without ROP/JIT
DEP/ASLR bypass without ROP/JITDEP/ASLR bypass without ROP/JIT
DEP/ASLR bypass without ROP/JITArtem I. Baranov
 
DEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsDEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsFelipe Prado
 
JEEConf 2017 - How to find deadlock not getting into it
JEEConf 2017 - How to find deadlock not getting into itJEEConf 2017 - How to find deadlock not getting into it
JEEConf 2017 - How to find deadlock not getting into itNikita Koval
 
(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and backDavid Rodenas
 
Open daylight and Openstack
Open daylight and OpenstackOpen daylight and Openstack
Open daylight and OpenstackDave Neary
 
CQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slidesCQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slidesZuzannaKornecka
 
Configurações distribuídas com Spring Cloud Config
Configurações distribuídas com Spring Cloud ConfigConfigurações distribuídas com Spring Cloud Config
Configurações distribuídas com Spring Cloud ConfigEmmanuel Neri
 
PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner Neotys
 
Should I be dead? a very personal genomics
Should I be dead? a very personal genomicsShould I be dead? a very personal genomics
Should I be dead? a very personal genomicsNeil Saunders
 
Bind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareBind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareSage Computing Services
 
APIs and Synthetic Biology
APIs and Synthetic BiologyAPIs and Synthetic Biology
APIs and Synthetic BiologyUri Laserson
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupJorge Nerín
 

Semelhante a José Selvi - Historia de un CryptoFAIL [rootedvlc4] (20)

Star bed 2018.07.19
Star bed 2018.07.19Star bed 2018.07.19
Star bed 2018.07.19
 
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
MITRE ATT&CKcon 2018: From Technique to Detection, Paul Ewing and Ross Wolf, ...
 
Data Encryption at Rest
Data Encryption at RestData Encryption at Rest
Data Encryption at Rest
 
Algebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions ManualAlgebra and Trigonometry 9th Edition Larson Solutions Manual
Algebra and Trigonometry 9th Edition Larson Solutions Manual
 
ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"ReadyNow: Azul's Unconventional "AOT"
ReadyNow: Azul's Unconventional "AOT"
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
 
DEP/ASLR bypass without ROP/JIT
DEP/ASLR bypass without ROP/JITDEP/ASLR bypass without ROP/JIT
DEP/ASLR bypass without ROP/JIT
 
DEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chipsDEF CON 23 - COLIN O'FLYNN - dont whisper my chips
DEF CON 23 - COLIN O'FLYNN - dont whisper my chips
 
JEEConf 2017 - How to find deadlock not getting into it
JEEConf 2017 - How to find deadlock not getting into itJEEConf 2017 - How to find deadlock not getting into it
JEEConf 2017 - How to find deadlock not getting into it
 
(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back
 
Open daylight and Openstack
Open daylight and OpenstackOpen daylight and Openstack
Open daylight and Openstack
 
Checking Bitcoin
 Checking Bitcoin Checking Bitcoin
Checking Bitcoin
 
CQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slidesCQURE_BHAsia19_Paula_Januszkiewicz_slides
CQURE_BHAsia19_Paula_Januszkiewicz_slides
 
Configurações distribuídas com Spring Cloud Config
Configurações distribuídas com Spring Cloud ConfigConfigurações distribuídas com Spring Cloud Config
Configurações distribuídas com Spring Cloud Config
 
PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner
 
Should I be dead? a very personal genomics
Should I be dead? a very personal genomicsShould I be dead? a very personal genomics
Should I be dead? a very personal genomics
 
Bind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareBind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning Nightmare
 
VLSI lab manual
VLSI lab manualVLSI lab manual
VLSI lab manual
 
APIs and Synthetic Biology
APIs and Synthetic BiologyAPIs and Synthetic Biology
APIs and Synthetic Biology
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user group
 

Mais de RootedCON

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRootedCON
 
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...RootedCON
 
Rooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRootedCON
 
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_RootedCON
 
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...RootedCON
 
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...RootedCON
 
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...RootedCON
 
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRootedCON
 
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...RootedCON
 
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRootedCON
 
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...RootedCON
 
Rooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRootedCON
 
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...RootedCON
 
Rooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRootedCON
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRootedCON
 
Rooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRootedCON
 
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...RootedCON
 
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...RootedCON
 
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRootedCON
 
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRootedCON
 

Mais de RootedCON (20)

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
 
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
 
Rooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amado
 
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
 
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
 
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
 
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
 
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
 
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
 
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
 
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
 
Rooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molina
 
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
 
Rooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopez
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
 
Rooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jara
 
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
 
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
 
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
 
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

José Selvi - Historia de un CryptoFAIL [rootedvlc4]

  • 1. A CRYPTO-FAIL STORY RootedCON Valencia September 2017
  • 2. 2 Jose Selvi (@Jose Selvi) +12 years in the infosec industry Principal Penetration Tester & Security Researcher SANS Institute Community Instructor GIAC Security Expert (GSE) Blogger (sometimes): http://www.pentester.es $ WHOIS JSELVI
  • 3. 3 I DID NOT MAKE A FULL VULNERABILITY RESEARCH
  • 4. 4 THIS IS NOT A CRYPTO TRAINING
  • 5. 5
  • 6. 6
  • 7. 7 TESTING CRYPTO IN 30 MINUTES test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F REUSE SALT, REUSE IV test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F test1@test.com : 000000 -> 2E C7 7C 2A 19 6E 02 2B AA 68 7E F0 61 67 51 B0 test1@test.com : 123456 -> 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F test2@test.com : 123456 -> 7B 49 CF 4D E4 32 1E 77 93 21 1A B5 74 8B 44 DA BASED ON EMAIL & PASSWORD BLOCK CIPHER (REVERSIBLE) ENCRYPTION B6 78 78 BD F5 72 FC BE 04 8B D5 33 44 98 7B 02 23 97 F8 B5 BD 63 3F 6D F8 AB 13 64 76 DD 37 BE 5A 8D 7D B4 DB B4 05 E9 AB CC 2D 46 AD AD 21 7F
  • 9. 9 NO EXPLOITATION, NO FUN POTENTIALLY EXPLOITABLE WE PRESUME THAT WITH ENOUGH EFFORT IT COULD BE EXPLOITED
  • 10. 10 QUICK LOOK AT THE BINARY $ rabin2 -i server.exe | grep -i crypt ordinal=001 plt=0x005c80c4 bind=NONE type=FUNC name=CRYPTUI.dll_CryptUIDlgViewCertificateW ordinal=001 plt=0x005c8098 bind=NONE type=FUNC name=CRYPT32.dll_CertEnumCertificatesInStore ordinal=002 plt=0x005c809c bind=NONE type=FUNC name=CRYPT32.dll_CertCloseStore ordinal=003 plt=0x005c80a0 bind=NONE type=FUNC name=CRYPT32.dll_CertFreeCertificateContext ordinal=004 plt=0x005c80a4 bind=NONE type=FUNC name=CRYPT32.dll_CertGetCertificateContextProperty ordinal=005 plt=0x005c80a8 bind=NONE type=FUNC name=CRYPT32.dll_CertDuplicateCertificateContext ordinal=006 plt=0x005c80ac bind=NONE type=FUNC name=CRYPT32.dll_CertGetEnhancedKeyUsage ordinal=007 plt=0x005c80b0 bind=NONE type=FUNC name=CRYPT32.dll_CertGetNameStringW ordinal=008 plt=0x005c80b4 bind=NONE type=FUNC name=CRYPT32.dll_CertOpenStore ordinal=009 plt=0x005c80b8 bind=NONE type=FUNC name=CRYPT32.dll_CryptProtectData ordinal=010 plt=0x005c80bc bind=NONE type=FUNC name=CRYPT32.dll_CryptUnprotectData $ rabin2 -zz server.exe | grep -i crypt vaddr=0x00626ff6 paddr=0x002257f6 ordinal=21488 sz=27 len=26 section=.rdata type=ascii string=CryptUIDlgViewCertificateW vaddr=0x00627012 paddr=0x00225812 ordinal=21489 sz=12 len=11 section=.rdata type=ascii string=CRYPTUI.dll vaddr=0x0062755a paddr=0x00225d5a ordinal=21555 sz=17 len=16 section=.rdata type=ascii string=CryptProtectData vaddr=0x0062756e paddr=0x00225d6e ordinal=21556 sz=19 len=18 section=.rdata type=ascii string=CryptUnprotectData vaddr=0x00627582 paddr=0x00225d82 ordinal=21557 sz=12 len=11 section=.rdata type=ascii string=CRYPT32.dll vaddr=0x0062f6e0 paddr=0x0022dae0 ordinal=22387 sz=40 len=39 section=.data type=ascii string=.?AU? $Deleter@UCryptData@@P6AHPAU1@@Z@@ vaddr=0x0062f710 paddr=0x0022db10 ordinal=22388 sz=30 len=29 section=.data type=ascii string=.?AV? $TPointer@UCryptData@@@@ vaddr=0x0062f738 paddr=0x0022db38 ordinal=22389 sz=34 len=33 section=.data type=ascii string=.?AV? $TAutoFreeObj@UCryptData@@@@
  • 11. 11
  • 12. 12 HASHING ALGORITHMS static void reset(uint32_t digest[], std::string &buffer, uint64_t &transforms) { /* SHA1 initialization constants */ digest[0] = 0x67452301; digest[1] = 0xefcdab89; digest[2] = 0x98badcfe; digest[3] = 0x10325476; digest[4] = 0xc3d2e1f0; /* Reset counters */ buffer = ""; transforms = 0; }
  • 15. 15
  • 16. 16
  • 17. 17 AES has 10 rounds for 128-bit keys, 12 rounds for 192-bit keys, and 14 rounds for 256-bit keys.
  • 18. 18
  • 19. 19
  • 20. 20
  • 21. 21
  • 22. 22 CRACKING THE “HASH” $ ./crack my@email.com 52796b User: my@email.com Password: test123456
  • 24. 24 DO NOT USE ECB MODE NEVER EVER
  • 25. 25 $ echo Testing1234 | openssl enc -aes-128-ecb -K 1234 -iv 1 | hexd 0000000 8d 47 5c 5f bb 1b 1c 0a 79 ca e5 45 6a 8f c4 58 $ echo Testing1234 | openssl enc -aes-128-ecb -K 1234 -iv 2 | hexd 0000000 8d 47 5c 5f bb 1b 1c 0a 79 ca e5 45 6a 8f c4 58 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 0001 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 0002 | hexdump 0000000 1b 28 1f e3 10 fa 69 14 8b 80 e2 64 97 2e 93 d0
  • 27. 27 ALWAYS USE DIFFERENT IVs ON EACH MESSAGE
  • 28. 28 REUSING IVs ON AES $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7 $ echo Testing1234 | openssl enc -aes-128-cbc -K 1234 -iv 1 | hexdump 0000000 d5 1e 92 d4 ce 72 dc ab 6d e9 c0 b6 bb 39 de f7
  • 29. 29 REUSING IVs ON STREAM CIPHERS W E L C O M E T O T H I S 12 34 56 78 9A BC DE F0 12 34 56 78 9A BC DE F0 H I D D E N M E S S A G E ! . 12 34 56 78 9A BC DE F0 12 34 56 78 9A BC DE F0 (M1 ⊕ KEY) ⊕ (M2 ⊕ KEY) M1 ⊕ M2
  • 30. 30 DO NOT USE REVERSIBLE ENCRYPTION FOR PASSWORDS
  • 31. Credentials Storage 31 AUTHENTICATION & HASHING pass1234 Client Side Server Side XYZW XYZW
  • 32. Code Credentials Storage 32 SALT & PEPPER pass1234 Client Side Server Side SALT$XYZW SALT$XYZW PEPPER PEPPERSALT
  • 33. 33 PASSWORD SPECIFIC HASHING: PBKDF2, BCRYPT, SCRYPT, …
  • 34. 34 SERIOUSLY, DO NOT KEEP SECRETS AT CLIENT SIDE
  • 35. XYZWABCD Random Token Generator Token Storage 35 RANDOM TOKENS Client Side Server Side XYZWABCD
  • 36. JSON Token Generator XYZWABCD Token Storage 36 JSON WEB TOKENS (JWT) Client Side Server Side Certification Authority CA
  • 37. www.prosegur.comwww.prosegur.com THANKS A LOT! ANY QUESTIONS? jose.selvi@prosegur.com jselvi@pentester.es @JoseSelvi