home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / rsasol.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  5.4 KB  |  187 lines

  1.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  2.     ▓▓    ____                     __       __           ▓▓▀█
  3.     ▓▓   /  _/_ _  __ _  ___  ____/ /____ _/ /           ▓▓ █▀█
  4.     ▓▓  _/ //  ' \/  ' \/ _ \/ __/ __/ _ `/ /            ▓▓ █ █
  5.     ▓▓ /___/_/_/_/_/_/_/\___/_/  \__/\_,_/_/             ▓▓ █ █
  6.     ▓▓   ____                          __          __    ▓▓ █ █
  7.     ▓▓  / __ \___ ___ _______ ___  ___/ /__ ____  / /____▓▓ █ █
  8.     ▓▓ / /_/ / -_|_-</ __/ -_) _ \/ _  / _ `/ _ \/ __(_-<▓▓ █ █
  9.     ▓▓/_____/\__/___/\__/\__/_//_/\_,_/\_,_/_//_/\__/___/▓▓ █ █
  10.     ▓▓                                                   ▓▓ █ █
  11.     ▓▓      Web: http://www.ImmortalDescendants.com      ▓▓ █ █
  12.     ▓▓                 Author: ACiD BuRN                 ▓▓ █ █
  13.     ▓▓                Date: 09/01/2000                   ▓▓ █ █
  14.     ▓▓         Topic: cracking TSCUBE's RSA CRACKME      ▓▓ █ █
  15.     ▓▓               Level: intermediate                 ▓▓ █ █
  16.     ▓▓                                                   ▓▓ █ █
  17.     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ █ █
  18.       █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █
  19.         █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
  20.  
  21.  
  22. Crackme is here: http://www.infini.fr/~lkubaski/reverse/RSAcrkme10.zip
  23.  
  24.  
  25. Introduction:
  26.  
  27. well , this crackme is RSA24 , so it is not that hard , but it is good to
  28. familiarise with RSA stuff ...
  29. I won't explain lot on how RSA works , but just explain how to reverse this crackme !
  30. There is already some docs on RSA , like the Lucifer48 'n Crackz ones ...
  31. you can find it at : http://www.multimania.com/lucifer48/ and http://www.wco.com/~micuan/
  32.  
  33.  
  34. Tools needed: 
  35.  
  36. - Factor.exe (to calcul p and q when we know n) and ce.exe ... 
  37.   url: http://134.155.63.117/~quantico/ghiribizzo/rsa/rsa.html
  38.  
  39. - abn.exe coded by TSCUBE, will be avaiable soon , i can't spread the beta version...
  40.  
  41. ****************
  42. * Basic of RSA:*
  43. ****************
  44.  
  45. p*q = n
  46.  
  47. We know n and we need to find p and q (p and q are primes numbers)
  48. it is not evident when n=512 bits ..
  49.  
  50. How to get "p" and "q" when we got "n" ?
  51. Well for this , i used "factor.exe"
  52.  
  53. let's look the crackme itself !
  54. Desasm it and look in string data references ! we see some numbers :
  55.  
  56. 12790891
  57. 5666933
  58. 8483678
  59. 9901
  60. ...
  61.  
  62. if we check the code in asm we see this:
  63.  
  64. * Possible StringData Ref from Data Obj ->"9901"       <-- e
  65.                                   |
  66. :004029CD 68DC004200              push 004200DC
  67. :004029D2 8D8C24E4000000          lea ecx, dword ptr [esp+000000E4]
  68. :004029D9 E852E7FFFF              call 00401130
  69.  
  70. * Possible StringData Ref from Data Obj ->"12790891"   <-- n (n > e so we know it is n)
  71.                                   |
  72. :004029DE 68D0004200              push 004200D0
  73. :004029E3 8D4C241C                lea ecx, dword ptr [esp+1C]
  74. :004029E7 C784246406000000000000  mov dword ptr [esp+00000664], 00000000
  75. :004029F2 E839E7FFFF              call 00401130
  76.  
  77. * Possible StringData Ref from Data Obj ->"8483678"   <-- 1st uncrypted part of the serial
  78.                                   |
  79. :004029F7 68C8004200              push 004200C8
  80. :004029FC 8D8C2474020000          lea ecx, dword ptr [esp+00000274]
  81. :00402A03 C684246406000001        mov byte ptr [esp+00000664], 01
  82. :00402A0B E820E7FFFF              call 00401130
  83.  
  84. * Possible StringData Ref from Data Obj ->"5666933"   <-- 2nd uncrypted part of the serial
  85.                                   |
  86.  
  87.  
  88.  
  89. This crackme use RSA 2 times !
  90. the final serial is the 1st crypted part + the 2nd crypted part , added as string
  91.  
  92. ok , enough blablabla , let's go
  93.  
  94.  
  95. 1st , we want to have "p" and "q" , fire up "factor.exe" ...
  96. it show us how to use it:
  97.  
  98. C:\rsa>factor.exe
  99.  
  100. Usage: factor <number>
  101. OR
  102. factor -f <formula>
  103. e.g. factor -f 10#100-19
  104.  
  105. To suppress the commentary, use flag -s
  106. To input from a file, use flag -i <filename>
  107. To input from a binary file, use flag -b <filename>
  108. To output to a file, use flag -o <filename>
  109. e.g. factor -f 10#100-7 -s -o factors.dat
  110.  
  111. ok so: factor.exe n
  112.  
  113.  
  114. we do factor.exe 12790891 and we obtain this :
  115.  
  116.  
  117. C:\rsa>factor.exe 12790891
  118. first trying brute force division by small primes
  119. PRIME FACTOR     1667
  120. PRIME FACTOR     7673
  121.  
  122. ok, good !! now we have p=1667 and q=7673
  123.  
  124.  
  125. We will need to calcul d now !
  126. For this we will use ce.exe !
  127.  
  128. Fire up it and look :
  129.  
  130.  
  131. Exponent Calculator v1.3 _ Ghiribizzo [OR&L/uKC] 1999
  132.  
  133. Usage: CE <p> <q> <e>
  134.  
  135. p=1667 and q=7673 and e=9901 (we have found "e" in string data reference)
  136.  
  137. let's enter this numbers:
  138.  
  139. C:\rsa>CE 1667 7673 9901
  140.  
  141. Exponent Calculator v1.3 _ Ghiribizzo [OR&L/uKC] 1999
  142.  
  143. Inverse Exponent:
  144. 10961333
  145.  
  146. so d=10961333 ...
  147.  
  148. ok, now we can finish our work !! we will cryp each uncrypted part of the crackme
  149. to make our final serial !!
  150. It is an serial only crackme , coz the name is not used for the calculation...
  151.  
  152. ( uncrypted ^ d ) % n = serial !
  153.  
  154. As this crackme use 2 parts as serial here comes the caculation :
  155.  
  156.  
  157. * 1st Part: (we use abn.exe for this calcul a=8483678 , b=10961333 , n=12790891)
  158.  
  159. (1st Message uncrypted ^ d ) mod n = 1st serial crypted
  160.  
  161. For us :
  162.  
  163. (8483678 ^ 10961333 ) mod 12790891  = 7167622 = 1st part
  164.  
  165.  
  166.  
  167. * 2nd part: (we use abn.exe for this calcul a=5666933 , b=10961333 , n=12790891)
  168.  
  169. (2nd Message uncrypted ^ d ) mod n = 1st serial crypted
  170.  
  171. For us :
  172.  
  173. (5666933 ^ 10961333 ) mod 12790891  = 3196885 = 2nd part
  174.  
  175.  
  176. so the final serial is: Part1 + Part2 (added as string)= Part1Part2
  177.  
  178. The serial is: 71676223196885
  179.  
  180.  
  181. Enter your name , this serial and we obtain:
  182.  
  183. Well done, ACiD BuRN ....
  184. Great , we did it !!!!!
  185.  
  186.  
  187.