![]() |
Introduction to Cracking - (Part III)
Summary of previous partsIn Part-I, and Part -II we saw Reflector can very accurately de-compile .NET apps and we also studies some basics of packing and obfuscation. We saw that Reflector cannot directly de-obfuscate obfuscated assemblies, so we need external tools to de-obfuscate .NET assemblies. {smartkill} is one such tool that can de-obfuscate assemblies obfuscated by {smartassembly}. Reflector can't also unpack/decrypt packed/crypted exes, so we need unpackers and decryptors. PEiD can identify huge array of packed and crypted exes, to make our lives easier. IntroductionI think readers are starting to lose interest as I cover only theoretical aspects of cracking. So, in this part I will actually CRACK an app :wink: As I have written only about .NET cracking till now, so I would crack a .NET app. We will cover other languages gradually. Here is the link to the target of this article is : http://crackmes.de/users/w02057/crac...02057/download BackgroundThe target is a Level-2 crackme, solved my me. This crackme was an easy one, designed by w02057. The author(w02057) gives the following information about his crackme: (*) Language : .NET (*) Platform : Windows The rule that the author stated for solving are: (*) No Patching : that would make it too easy :p (*) No Bruteforcing : that would make it time-consuming and boring ACTION :)(1) Load the crack me into Reflector: File --> Open --> Select crackme location (2) Expand the following: CrackMe5 --> frmMain --> btnValidate_Click (3) See that it works with the following: ..(*) txtKey : a textbox obviously ..(*) txtSerial : another textbox obviously ..(*) getserial : a function ..(*) check : a function (4) Click ' check' to goto the associated code. You will see this:Code: vb.net
getserial' to goto associated code. You will observe this:Code: vb.net
Code: vb.net
NOTE FOR NEWBIES : Don't be afraid of seeing so much code. Your work is simple (as you will see when you read further). At max, you'll have to write about 10 lines :eek: of code. (7) So, now we have enough information, about what's going on inside :wink: : ..(*) The check function checks if the entered key is valid...(*) If key is valid, it generates a serial and matches the entered serial with it. Simple, isn't it ? (8) So, what we do to crack this easily is.. we try to understand what the check function expects as a GOOD key. Lets's analyze : OBSERVATION : Observe the Do...Loop While(num2 <= 9) loop inside the 'Try' block.CONCLUSION : It ensures that, there are not repeated digits in the key. Thus, note that, the key consists only of DIGITS no alphabets. OBSERVATION : Next move to the sequence of 'If' Checks. [ There are 8 'If's ]. If an 'If' is satisfied, num is increased by 1 ( 'cuz num += 1). At the end the function checks if num = 8. CONCLUSION : So, ALL 'If's must be satisfied. (9) Study the 'If's now. BTW, hover mouse over 'Substring' and 'Conversions' to know about them. See that, the author extracts the i'th character in the string str (which is the key), by using the command 'str.Substring(i-1, 1)'. So, 'str.Substring(1, 1)' would give the 2nd character in the key. Note that, the author uses i = 9 at max because he uses 'str.Substring(8, 1)' at maximum. So, we got a hint -- the author checks ONLY the first 9 chars of key. (10) Now, what does he check ?? Note again that, 'Conversion.Int(c)' returns the digit contained in the character c. As the key consists only of digits, 'Conversion.Int(str.Substring(i-1, 1))' would return the i'th digit in the key. (11) So, finally we get to know that the function 'check' does this: Code: Algorithm
Code:
0 1 2 <-- 15(13) Representation of 15 as sum of 3 distinct natural numbers : Code: Algorithm
2 x x x x 1 4 3 x Now we can fill up logically as follows: Code: Algorithm
2 x x 9 x 1 4 3 8 Code: Algorithm
2 7 6 9 5 1 4 3 8 So, the key corresponding to this is 276951438. NOTE: All other keys can be formed by simply rotating and transposing. (14) Now we know the valid keys. The getserial function can fetch us a valid serial for a key, so we don't need to be bothered about calculating a serial. We can just copy the getserial function (and the hash function, because getserial uses it) to VB.NET and can pass the keys as arguments to get the serials :wink:(15) So, we are done ! We have just finished a keygen for w02057's Crackme :happy: All the valid keys and serial combination are : Code: Output
I hope you enjoyed making the keygen, as much as I enjoyed it. Greets to shabbir and all my friends here at G4EF and thanks to you for reading this long article ! Take care and good bye :smile: |
Re: Introduction to Cracking - (Part III)
Nomination this Article for Article of the month - May 2009
|
Re: Introduction to Cracking - (Part III)
i have checked it’s really great
|
Re: Introduction to Cracking - (Part III)
Thanx for the feedback ! :)
|
Re: Introduction to Cracking - (Part III)
Vote for this article in Article of the month - May 2009
|
Re: Introduction to Cracking - (Part III)
Im new at this. Could you tell me how you plugged in the numbers for the magic cube? The 2, 3 and 4. I understood they equal 15 but not how they were placed where they were. Thanks :)
|
Re: Introduction to Cracking - (Part III)
You can do that in two ways :
(1) Use a logical approach as I mentioned in POINT (13) : You calculate "in how many different valid combinations, does a digit occur". From that knowledge, you can easily know its position. (2) Brute-force ! Write a program in any language of your choice to brute-force all the valid combinations. If you still have doubts, I can post a simple C++ Bruter here. Or I can explain POINT 13. |
Re: Introduction to Cracking - (Part III)
Good one...
|
Re: Introduction to Cracking - (Part III)
Thanx !Newbie!. Glad that you liked it.
|
Re: Introduction to Cracking - (Part III)
Awesome Man :)
|
| All times are GMT +5.5. The time now is 07:02. |