Sunday, August 19, 2007

.Net Password Cracking by Jacky Altal and Amir Davidi



.Net Password Cracking by Jacky Altal and Amir Davidi


Overview:

Papers saying that 95% of the .NET applications are vulnerable to a simple cracking method, in my experience most of the .NET are too easy to crack and most of them are considered to be level one cracking. I don’t think that a high programming level should be required to accomplish this task. Actually it is much easy to crack .NET files then any other type of EXE. You are going to need a Brain……

What are .NET assemblies?

- .NET assemblies (Apps, Dlls) are running on .NET Framework
- .Net solutions/projects compiled into MSIL (Microsoft Intermediate Language) and then assembled to .NET assemble


Tools:

.NET framework comes with two important tools:
ILDASM - .NET de-assemble
ILASM - .NET assemble

Logical Steps:

- .NET de-assembling
- MSIL code editing
- .NET re-assembling

Let's start cracking…………….InternetTV

1. Install the application.
2. Insert any password that you want and take a note of the error message.
3. Locate the exe file.
4. Open ILDASM.
5. Change (C)onditional jumps to the opposite value (82 to 83)
6. Re-assemble file


ILDASM

ILDASM is a Microsoft tool that used to examine .NET assembly files. With ILDASM we can generate ILCODE from a given assembly file.

Let's open the InternetTV executable file:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>ildasm "C:\Documents and Settings\jacky\MyDocuments\VisualStudio2005\Projects\ InternetTV \bin\Debug\AyalonHighWayViewer.exe" /out="c:\InternetTV.il" /text

Now we have a disassembly file that we can work on. And named InternetTV.il

Open the new file (InternetTv.il) with your favorite editor and start editing it. Actually our goal is to remove the Secure Name Protection from the code and then search for username and password values. This step is very trivial and easy (if you want to understand more about the method just google it). As for now we will just remove it from our code and move on to the credentials values.

Search for "publickey" and remove it (if exists) then search for Password and User fields Get your values and you are set……


Re-Assembly

We will use the ILASM file to re assembly our file (comes with VS.NET)

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin>ilasm C:\ILCODE\ InternetTV.il /resource=C:\ILCODE\ InternetTV.res /output=C:\InternetTV.exe



Last step:

Copy the new InternetTV.EXE file to your installed directory and run it……….


In the next tutorial we will learn how to inject functions into another .NET application…..

Enjoy.

Download
http://www.hackingdefined.com/cracking-net.rar
Info:
http://visualbasic.about.com/gi/dynamic/offsite.htm?site=http://sourceforge.net/projects/sharpdevelop

1 comment:

Yuli said...

I wish I had time to study .NET reversing. I hope to find it soon.

Great Post!
Way to go!

SecurityFocus Vulnerabilities

SearchSecurity: Security Wire Daily News

Packet Storm Security Exploits

SecurityFocus News

Securityvulns exploits channel