Best practice for .NET Obfuscating:-
To Obfuscate Assembly(.dll) in .Net install these tools first:-
- JustDecompile
- ConfuserEx
JustDecompile:-
It is Telerik open source engine. It is used for
- See the source code and verify you yourself what the code does
- You can study the code and learn the best way to write code as people are writing.
ConfuserEx:-
Features:
- Anti debugger
- Anti memory dumping
- Anti decompiler
- Prevent any tampering of the assemblies
- Encrypt codes
- Encrypt constants (i.e. numbers & strings)
- Encrypt resources
- Control flow obfuscation
- External/Internal reference proxy
- Renaming
Let's Take a simple "Hello World" string returning assembly (.dll) and Obfuscating it and then try to Decompile it using Telerik JustDecompile Tool
I have class library named ClassLibrary1.
referencing it into the project ConsoleApplication1.
Now i am going to rebuild ClassLibrary1. Open Folder ClassLibrary1/bin/Debug here you will find ClassLibrary1.dll which we are going to obfuscate.
Once you have installed Confuser, open it.
Now drag ClassLibrary1.dll into Confuser.
Now go to Rules Tab and add your patterns. Here i have left it as it is and Preset to Minimum. Then Click OK.
Once you have clicked on OK. Now Click on Tab Confuse!. Automatically you would see your .dll will be obfuscated. Now switch over to ClassLibrary/bin/debug you would see Confused Folder Created.
Now i am trying to Decompile it using JustDecompile Tool.
Drag Original .dll file which was create first before Obfuscating.
You would be able to see the complete code.
After Obfuscating:-
In the above image you would find Hello world be converted into unreadable code.
Accordingly you can change the Confuser Rule and Preset. Again after Obfuscating you would be able to use the Obfuscated .dll to your running application.
No comments:
Post a Comment