Rainbow Tables

3,065 views

Published on

My Presentation at Barcamp ID in Jakarta 12 th Dec 2009 [revised]

Published in: Technology
3 Comments
3 Likes
Statistics
Notes
No Downloads
Views
Total views
3,065
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
96
Comments
3
Likes
3
Embeds 0
No embeds

No notes for slide

Rainbow Tables

  1. 1. Jakarta , December 12th 2009<br />Rainbow Tables<br />Testing Passwords Security<br />
  2. 2. About me<br />PanggiLibersaa.k.amalcoder<br />Student at Indonesia’s Computer University <br />Like to take picture <br />Almost get his CEH certification ( waiting for exam)<br />Member of GNU/Linux User Group at Bandung [ Klub Linux Bandung ]<br />Small web hosting owner [ hostinggokil.com , ofirnetwork.com (in progress) ]<br />Web : malcoder.infoandopensecuritylab.org<br />Find me :<br />@panggimalcoder panggi_y2k<br />panggi.libersapanggipanggi<br />
  3. 3. “Some things Man was never meant to know. For everything else, there&apos;s Google” Geeky Quote<br />
  4. 4. Why Do I talk about this ?<br />Awareness of Security<br /><ul><li>I promise that this will change your view on Password Security
  5. 5. Haven’t met anyone that isn’t surprised at the power of this stuff’s ability to make cracking password become so easy</li></li></ul><li>So , What is Password ?<br />A password is a secret word or string of characters that is used for authentication, to prove identity or gain access to a resource .The password must be kept secret from those not allowed access.<br /> (source : http://en.wikipedia.org/wiki/Password)<br />
  6. 6. Password Usage<br />
  7. 7. How to keep it secret ?<br />Don’t tell to anybody else , keep it in mind (personal)<br />Store the password records on a secure environment (provider)<br />
  8. 8. Type of storing password<br />Cleartext (ex : this-is-so-secret , 260987)<br />Encrypted<br /><ul><li>Reversible encryption without key ( ex : base64 cipher)
  9. 9. Reversible encryption with key (ex : poly alphabetic substitution cipher)
  10. 10. One Way Hash ( ex : md5 , sha1 )
  11. 11. One Way Hash with salt ( ex : md5 + salt )</li></li></ul><li>Example of the encryption usage<br />Base64 ( functions : encode and decode)<br /><ul><li>Encode : cleartext -> ciphertext
  12. 12. Decode : ciphertext -> cleartext</li></ul>cleartext : panggi<br />ciphertext :<br />cGFuZ2dp<br />encode<br />ciphertext :<br />cGFuZ2dp<br />decode<br />cleartext : panggi<br />
  13. 13. Polyalphabetic substitution cipher<br /><ul><li>ex : Vigenèrecipher
  14. 14. Usage :</li></ul>Key: ABCDEF AB CDEFA BCD EFABCDEFABCD <br />Plaintext: CRYPTOIS SHORT FOR CRYPTOGRAPHY <br />Ciphertext: CSASXTIT UKSWT GQU GWYQVRKWAQJB<br />
  15. 15. <ul><li>One Way Hash
  16. 16. CAN NOT BE DECODED , feel secured ? Wait </li></li></ul><li>One way hash + salt <br /><ul><li>I will explain later .. </li></ul>NEXT <br />
  17. 17. Our Focus Today<br />Cracking One Way Hash Cipher<br /><ul><li>MD5
  18. 18. LM (LAN MANAGER) for MS Windows Password</li></li></ul><li>Characteristics<br />MD5 : The 128-bit (16-byte) MD5 hashes (also termed message digests) are typically represented as a sequence of 32 hexadecimal digits<br /><ul><li>Example : </li></ul>test = 098f6bcd4621d373cade4e832627b4f6<br />
  19. 19. LM : <br /><ul><li>The user’s ANSI password is converted to uppercase.
  20. 20. This password is null-padded to 14 bytes.
  21. 21. The “fixed-length” password is split into two 7-byte halves.
  22. 22. These values are used to create two DES keys, one from each 7-byte half, by converting the seven bytes into a bit stream, and inserting a parity-bit after every seven bits. This generates the 64 bits needed for the DES key.
  23. 23. Each of these keys is used to DES-encrypt the constant ASCII string “KGS!@#$%”, resulting in two 8-byte ciphertext values. The DES CipherMode should Set to ECB, and PaddingMode should set to NONE.
  24. 24. These two ciphertext values are concatenated to form a 16-byte value, which is the LM hash.</li></li></ul><li>Example :<br />percobaan:1016:3EABC00C9F7B74B09A0F5D12D8F612D0:34976BC196DADD52A6D02AE530F806C3:::<br /><ul><li>percobaan = username
  25. 25. 1016 = ID
  26. 26. 3EABC00C9F7B74B09A0F5D12D8F612D0 (LEFT side of LM password , it means the password is more than 7 chars)
  27. 27. 34976BC196DADD52A6D02AE530F806C3 (RIGHT side of LM pass , so we just have to crack 7 chars and fit it together  )</li></li></ul><li>Methods of cracking the passwords<br />Brute Force<br />Dictionary<br />Rainbow Tables  our focus<br />Etc…<br />
  28. 28. Brute force<br />Using all possible combination in sequence<br />Example :<br />Targeted hash : 4a8a08f09d37b73795649038408b5f33<br />OK.. Crack it ..<br />a = 0cc175b9c0f1b6a831c399e269772661 &lt;= no<br />b = 92eb5ffee6ae2fec3ad71c777531578f &lt;= no<br />c = 4a8a08f09d37b73795649038408b5f33 &lt;= yes <br />Result : <br />Plaintext of 4a8a08f09d37b73795649038408b5f33 is “c”<br />
  29. 29. Dictionary<br />Given the wordlist of common passwords<br />Example :<br />Targetted hash : 3858f62230ac3c915f300c664312c63f<br />dic-crack3858f62230ac3c915f300c664312c63f- L “path-of-wordlist/wordlist.txt”<br /> searching….<br />…<br />fooa &lt;= 72b55c624205d69cc145cc610880e1f9 &lt;= no <br />foobar &lt;= 3858f62230ac3c915f300c664312c63f &lt;= yes<br />…<br />
  30. 30. Rainbow Tables ?<br />A rainbow table is a lookup table offering a time-memory tradeoff used in recovering the plaintext password from a password hash generated by a hash function, often a cryptographic hash function. A common application is to make attacks against hashed passwords feasible<br /> (http://en.wikipedia.org/wiki/Rainbow_tables)<br />
  31. 31.
  32. 32. English please…<br />Lookup table ?<br />Trade-memory tradeoff ?<br /> &lt;=?<br />
  33. 33. Time for the Demo<br />Example : md5_hash.txt<br />20392298d6b78e0890cd22a7bf071c49<br />c9122fd7bae0681b62a39ddfc1c7fb19<br />469590a45cc7f985b53d15113157e6ea<br />31c9febeeb68929cd6c097239cf3e9d3<br />2e19ab163556288cf239f5339927e408<br />dcb76da384ae3028d6aa9b2ebcea01c9<br />d1cbedff31b828ac2f15548357988073<br />c94630fe9dea660ba53ddf5d3a41e802<br />73e405227c02a626e66f0dc4dd3a53a3<br />9486f7a4fdf724cf6cacbdc103661fce<br />26f803e714f7d39c0b5a9dd67d03f887<br />0248750eb423b999bd684b10668f7241<br />9ac17fc47347d505c92e3ca31fee675d<br />b65a81125dbfaab4a3ecdff26a979309<br />3fde6bb0541387e4ebdadf7c2ff31123<br />d695f8f703c1b3b0dce9d588a4d4abad<br />86acaeb6d0f7241ea54b73528fa204ca<br />78c5d5ed7ea4372435e9f006b29ea745<br />75003783871e9404cd0793ca81594841<br />e63d33d7ad4b4360f761634de070a860<br />a9684b0defabebc108720fda1627f43d<br />b150e73aa5fc110c27320c98effcc0f1<br />464b59d944c93b6a5eb3dfd0abf15114<br />4e3d682f0821b23f6d49fa1ac2cf154a<br />d740ee7f1cd46b3d536a6f4331a4c77f<br />13781c244d5bb85a296bcbe4ac7992f7<br />bcdc908a16dbfe1297b4b0891ccf9ed7<br />10f97476043d02db1a236b877232c0a6<br />d81bf97286c617c77b679478ce8b72b2<br />7279f67e313cc35e518f94c775a42196<br />
  34. 34. Result<br />D:hashcrack&gt;rcrack d:md5_tables*.rt -l md5_hash.txt<br />md5_alpha#1-7_0_2400x40000000_panggi#000.rt:<br />640000000 bytes read, disk access time: 9.99 s<br />verifying the file...<br />searching for 30 hashes...<br />plaintext of 20392298d6b78e0890cd22a7bf071c49 is PANGGI<br />plaintext of c9122fd7bae0681b62a39ddfc1c7fb19 is LOVE<br />plaintext of 469590a45cc7f985b53d15113157e6ea is MUSTIKA<br />cryptanalysis time: 377.34 s<br />md5_alpha-numeric#1-7_0_2400x40000000_panggi#000.rt:<br />640000000 bytes read, disk access time: 73.13 s<br />verifying the file...<br />searching for 27 hashes...<br />plaintext of 31c9febeeb68929cd6c097239cf3e9d3 is P4ST1<br />plaintext of d81bf97286c617c77b679478ce8b72b2 is 050479<br />cryptanalysis time: 102.56 s<br />md5_alpha-numeric#1-7_0_2400x40000000_panggi#001.rt:<br />640000000 bytes read, disk access time: 60.70 s<br />verifying the file...<br />searching for 25 hashes...<br />plaintext of 10f97476043d02db1a236b877232c0a6 is 7201421<br />cryptanalysis time: 28.19 s<br />md5_alpha-numeric#1-7_0_2400x40000000_panggi#002.rt:<br />640000000 bytes read, disk access time: 68.28 s<br />verifying the file...<br />searching for 24 hashes...<br />cryptanalysis time: 28.24 s<br />md5_alpha-numeric#1-7_0_2400x40000000_panggi#003.rt:<br />640000000 bytes read, disk access time: 67.72 s<br />verifying the file...<br />searching for 24 hashes...<br />cryptanalysis time: 27.81 s<br />
  35. 35. md5_loweralpha#1-7_0_2100x8000000_panggi.rt:<br />128000000 bytes read, disk access time: 36.22 s<br />verifying the file...<br />searching for 24 hashes...<br />plaintext of d1cbedff31b828ac2f15548357988073 is nashien<br />plaintext of c94630fe9dea660ba53ddf5d3a41e802 is herc<br />plaintext of 73e405227c02a626e66f0dc4dd3a53a3 is hayati<br />cryptanalysis time: 79.63 s<br />md5_loweralpha#1-7_1_2100x8000000_panggi.rt:<br />128000000 bytes read, disk access time: 2.86 s<br />verifying the file...<br />searching for 21 hashes...<br />plaintext of 2e19ab163556288cf239f5339927e408 is nunung<br />plaintext of dcb76da384ae3028d6aa9b2ebcea01c9 is sayang<br />cryptanalysis time: 73.33 s<br />md5_loweralpha#1-7_2_2100x8000000_panggi.rt:<br />128000000 bytes read, disk access time: 9.56 s<br />verifying the file...<br />searching for 19 hashes...<br />cryptanalysis time: 69.08 s<br />md5_loweralpha#1-7_3_2100x8000000_panggi.rt:<br />128000000 bytes read, disk access time: 2.45 s<br />verifying the file...<br />searching for 19 hashes...<br />cryptanalysis time: 69.38 s<br />md5_loweralpha#1-7_4_2100x8000000_panggi.rt:<br />128000000 bytes read, disk access time: 12.00 s<br />verifying the file...<br />searching for 19 hashes...<br />cryptanalysis time: 69.20 s<br />md5_loweralpha-numeric#1-7_0_2400x40000000_panggi#000.rt:<br />640000000 bytes read, disk access time: 17.91 s<br />verifying the file...<br />searching for 19 hashes...<br />plaintext of 3fde6bb0541387e4ebdadf7c2ff31123 is 1q2w3e<br />cryptanalysis time: 75.73 s<br />md5_loweralpha-numeric#1-7_0_2400x40000000_panggi#001.rt:<br />640000000 bytes read, disk access time: 14.73 s<br />verifying the file...<br />searching for 18 hashes...<br />plaintext of 26f803e714f7d39c0b5a9dd67d03f887 is 8u7y6t<br />cryptanalysis time: 21.09 s<br />
  36. 36. md5_loweralpha-numeric#1-7_0_2400x40000000_panggi#002.rt:<br />640000000 bytes read, disk access time: 13.91 s<br />verifying the file...<br />searching for 17 hashes...<br />cryptanalysis time: 20.03 s<br />md5_loweralpha-numeric#1-7_0_2400x40000000_panggi#003.rt:<br />640000000 bytes read, disk access time: 14.20 s<br />verifying the file...<br />searching for 17 hashes...<br />plaintext of 9486f7a4fdf724cf6cacbdc103661fce is metty77<br />cryptanalysis time: 19.31 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#000.rt:<br />640000000 bytes read, disk access time: 14.41 s<br />verifying the file...<br />searching for 16 hashes...<br />plaintext of 9ac17fc47347d505c92e3ca31fee675d is 4Dm1n<br />plaintext of b65a81125dbfaab4a3ecdff26a979309 is Pa55<br />plaintext of d695f8f703c1b3b0dce9d588a4d4abad is UN1k0M<br />plaintext of 75003783871e9404cd0793ca81594841 is G0D$<br />plaintext of 464b59d944c93b6a5eb3dfd0abf15114 is c(%H2n<br />plaintext of d740ee7f1cd46b3d536a6f4331a4c77f is *$^#&3<br />plaintext of 13781c244d5bb85a296bcbe4ac7992f7 is h@xX0r<br />cryptanalysis time: 33.47 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#001.rt:<br />640000000 bytes read, disk access time: 12.95 s<br />verifying the file...<br />searching for 9 hashes...<br />plaintext of 0248750eb423b999bd684b10668f7241 is iMoeTh<br />plaintext of e63d33d7ad4b4360f761634de070a860 is w_Bu5H<br />plaintext of 4e3d682f0821b23f6d49fa1ac2cf154a is R@54In<br />cryptanalysis time: 3.86 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#002.rt:<br />640000000 bytes read, disk access time: 12.92 s<br />verifying the file...<br />searching for 6 hashes...<br />plaintext of 78c5d5ed7ea4372435e9f006b29ea745 is !Q@W#E<br />plaintext of a9684b0defabebc108720fda1627f43d is 1!q^YW<br />cryptanalysis time: 2.36 s<br />
  37. 37. md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#003.rt:<br />640000000 bytes read, disk access time: 18.03 s<br />verifying the file...<br />searching for 4 hashes...<br />plaintext of 86acaeb6d0f7241ea54b73528fa204ca is 5TR0n6<br />cryptanalysis time: 1.78 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#004.rt:<br />640000000 bytes read, disk access time: 12.38 s<br />verifying the file...<br />searching for 3 hashes...<br />cryptanalysis time: 1.38 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#005.rt:<br />640000000 bytes read, disk access time: 12.41 s<br />verifying the file...<br />searching for 3 hashes...<br />plaintext of b150e73aa5fc110c27320c98effcc0f1 is p@N66i<br />cryptanalysis time: 1.38 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#006.rt:<br />640000000 bytes read, disk access time: 12.44 s<br />verifying the file...<br />searching for 2 hashes...<br />cryptanalysis time: 0.94 s<br />md5_numeric#1-9_0_3000x3000000_panggi#000.rt:<br />48000000 bytes read, disk access time: 0.72 s<br />verifying the file...<br />searching for 2 hashes...<br />plaintext of bcdc908a16dbfe1297b4b0891ccf9ed7 is 29041987<br />plaintext of 7279f67e313cc35e518f94c775a42196 is 776284123<br />cryptanalysis time: 23.86 s<br />statistics<br />-------------------------------------------------------<br />plaintext found: 30 of 30 (100.00%)<br />total disk access time: 499.91 s<br />total cryptanalysis time: 1129.94 s<br />total chain walk step: 453610884<br />total false alarm: 853120<br />total chain walk step due to false alarm: 675710917<br />
  38. 38. result<br />-------------------------------------------------------<br />20392298d6b78e0890cd22a7bf071c49 PANGGI hex:50414e474749<br />c9122fd7bae0681b62a39ddfc1c7fb19 LOVE hex:4c4f5645<br />469590a45cc7f985b53d15113157e6ea MUSTIKA hex:4d555354494b41<br />31c9febeeb68929cd6c097239cf3e9d3 P4ST1 hex:5034535431<br />2e19ab163556288cf239f5339927e408 nunung hex:6e756e756e67<br />dcb76da384ae3028d6aa9b2ebcea01c9 sayang hex:736179616e67<br />d1cbedff31b828ac2f15548357988073 nashien hex:6e61736869656e<br />c94630fe9dea660ba53ddf5d3a41e802 herc hex:68657263<br />73e405227c02a626e66f0dc4dd3a53a3 hayati hex:686179617469<br />9486f7a4fdf724cf6cacbdc103661fce metty77 hex:6d657474793737<br />26f803e714f7d39c0b5a9dd67d03f887 8u7y6t hex:387537793674<br />0248750eb423b999bd684b10668f7241 iMoeTh hex:694d6f655468<br />9ac17fc47347d505c92e3ca31fee675d 4Dm1n hex:34446d316e<br />b65a81125dbfaab4a3ecdff26a979309 Pa55 hex:50613535<br />3fde6bb0541387e4ebdadf7c2ff31123 1q2w3e hex:317132773365<br />d695f8f703c1b3b0dce9d588a4d4abad UN1k0M hex:554e316b304d<br />86acaeb6d0f7241ea54b73528fa204ca 5TR0n6 hex:355452306e36<br />78c5d5ed7ea4372435e9f006b29ea745 !Q@W#E hex:215140572345<br />75003783871e9404cd0793ca81594841 G0D$ hex:47304424<br />e63d33d7ad4b4360f761634de070a860 w_Bu5H hex:775f42753548<br />a9684b0defabebc108720fda1627f43d 1!q^YW hex:3121715e5957<br />b150e73aa5fc110c27320c98effcc0f1 p@N66i hex:70404e363669<br />464b59d944c93b6a5eb3dfd0abf15114 c(%H2n hex:63282548326e<br />4e3d682f0821b23f6d49fa1ac2cf154a R@54In hex:52403534496e<br />d740ee7f1cd46b3d536a6f4331a4c77f *$^#&3 hex:2a245e232633<br />13781c244d5bb85a296bcbe4ac7992f7 h@xX0r hex:684078583072<br />bcdc908a16dbfe1297b4b0891ccf9ed7 29041987 hex:3239303431393837<br />10f97476043d02db1a236b877232c0a6 7201421 hex:37323031343231<br />d81bf97286c617c77b679478ce8b72b2 050479 hex:303530343739<br />7279f67e313cc35e518f94c775a42196 776284123 hex:373736323834313233<br />D:hashcrack&gt;<br />
  39. 39. Mr. @ialexs‘s request (pass : maLam1)<br />K: ainbowhashcrack&gt;rcrack k: ainbowmd5_tablesmd5_mixalpha-numeric*.rt -h 7d<br />62eaa2e2a3da203573dc408d31cd0d<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#000.rt:<br />640000000 bytes read, disk access time: 40.91 s<br />verifying the file...<br />searching for 1 hash...<br />cryptanalysis time: 3.41 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#001.rt:<br />640000000 bytes read, disk access time: 45.14 s<br />verifying the file...<br />searching for 1 hash...<br />cryptanalysis time: 0.45 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#002.rt:<br />640000000 bytes read, disk access time: 47.19 s<br />verifying the file...<br />searching for 1 hash...<br />cryptanalysis time: 0.47 s<br />md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#003.rt:<br />640000000 bytes read, disk access time: 45.22 s<br />verifying the file...<br />searching for 1 hash...<br />cryptanalysis time: 0.44 s<br />
  40. 40. md5_mixalpha-numeric-symbol14-space#1-6_0_2400x40000000_panggi#004.rt:<br />640000000 bytes read, disk access time: 46.28 s<br />verifying the file...<br />searching for 1 hash...<br />plaintext of 7d62eaa2e2a3da203573dc408d31cd0d is maLam1<br />cryptanalysis time: 0.22 s<br />statistics<br />-------------------------------------------------------<br />plaintext found: 1 of 1 (100.00%)<br />total disk access time: 224.73 s  See the time.. <br />total cryptanalysis time: 4.98 s<br />total chain walk step: 2876401<br />total false alarm: 2252<br />total chain walk step due to false alarm: 1882084<br />result<br />-------------------------------------------------------<br />7d62eaa2e2a3da203573dc408d31cd0d maLam1 hex:6d614c616d31<br />K: ainbowhashcrack&gt;<br />
  41. 41. Windows Password (LM)<br />Dump it first<br />K:Pwdump7&gt;PwDump7.exe &gt; pass_win.txt<br />Pwdump v7.1 - raw password extractor<br />Author: Andres TarascoAcuna<br />url: http://www.514.es<br />K:Pwdump7&gt;<br />
  42. 42. pass_win.txt ( $ sign is censored by me )<br />Administrator:500:NO PASSWORD*********************:95C735766$$$$$$$$EAC22EC$$$$18CF:::<br />Guest:501:NO PASSWORD*********************:NO PASSWORD*********************:::<br />__vmware_user__:1011:NO PASSWORD*********************:2E4D88$$$$$$$$$$$$701F71FD7F63B9:::<br />apache2triad:1013:A215FD4C479AAEC8$$$$$$$$$$465971:6B93A1E44490938$$$$$$$$$$E4C4D63:::<br />okay:1014:3EABC00C9F7B74B09A0F5D12D8F612D0:34976BC196DADD52A6D02AE530F806C3:::<br />HelpAssistant:1015:F681E43E4269$$$$$$3D27C551$$$$$$:32EB$$$$$$159997D$$$$$$1EC24BA2A:::<br />percobaan:1016:3EABC00C9F7B74B09A0F5D12D8F612D0:34976BC196DADD52A6D02AE530F806C3::: crack it<br />
  43. 43. irc://irc.plaintext.info#rainbowcrack<br />
  44. 44. How to secure it ?<br />MD5<br />Use salted password ( not naked )<br />Example :<br />&lt;?function enchsetenev($toencode,$times){    $salt = &apos;s+(_a*&apos;;    for($zo=0;$zo&lt;$times;$zo=$zo+1)    {        $toencode = hash(&apos;sha512&apos;,salt.$toencode);        $toencode = md5($toencode.$salt);    }    return $toencode;}<br />?&gt;how to use it ?simply..<br />&lt;?$password=&quot;this password is super ultra mega secure and no one would decrypt it for atleast 10 years.. or even alot more :)&quot;;$supersecurepassword=enchsetenev($password,1000); <br />?&gt;<br />
  45. 45. LM Hash<br />percobaan:1016:3EABC00C9F7B74B09A0F5D12D8F612D0:34976BC196DADD52A6D02AE530F806C3:::<br />Use at least 15 characters and Windows will change it’s algorithm to more secure one ( NTLM )<br />
  46. 46. Thank You<br />

×