Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to secure your .NET applications with LiteCode

Hey all!

Intro
  • I have written up a basic client/server example of how to use LiteCode in order to protect your .NET applications. LiteCode allows you to remotely execute code from a server application, and use that data securely. I have used a combination of LiteCode + .NETSeal in my applications, and they have yet to be cracked.

Project Overview

Globals
  • Public Key - key that users can view publicly (aka, store in project resources.)
  • Private Key(s) - keys that must not be stored client side. You should download your private key(s) from your webserver (stored encrypted), after you have authenticated the user. Then decrypt them. You can store them in your litecode server's resources, so long as your web server is not compromised.
  • ISharedClass - the shared class interface is just that - an interface that defines the functions that your shared client<->server class will contain. (It must be the same in both projects. Contains no actual code.)
  • SharedClass - the actual shared class that contains the sensitive code. (Only in server for obvious reasons.

Client
  • Client - your main application. It will connect to your server with a static username/password combination. I suggest not hardcoding these, rather, retrieve them from your webserver after a pre-authentication of your choosing (eg. Servatrix, NetSeal).
  • ClientProps - class where you define your server's IP Address, among other properties.

Server
  • Server - your server application. It will handle and authenticate connections from your client with your static username/password, as well as your private key(s).
  • ServerProps - the same as ClientProps, but properties for your server.

Example Project (C#)
https://github.com/debug-hf/LiteCode-Example
https://github.com/AnguisCaptor/LiteCode
https://github.com/AnguisCaptor/SecureSocketProtocol


Project Explanation



Sorry the volume is a bit low.


I plan to update this with pictures and all later, but right now this is all I have time for. Paruse the source, it's pretty straight forward. If you have any questions let me know.

Hope this helps secure your applications.
Enjoy!

All credits to LiteCode and SecureSocketProtocol goes to DragonHunter
Thanks for the awesome tutorial. Would it be possible for you to convert this into a VB.NET project?
(Nov 30, 2015 07:56 PM)Ajumma Wrote:  Thanks for the awesome tutorial. Would it be possible for you to convert this into a VB.NET project?
The libraries used are included as DLLs, so you would only have to convert ~ 6 classes, which can easily be done with an online converter. I may do it tomorrow if no one else posts it.
Don't get me wrong OP, this is a great contribution. But I think Razor's and LaPanthere's Servatrix licensing system is a better way of doing this.
[Image: giphy.gif?cid=790b7611b007c1bdd2cd47171b...y.gif&ct=g]
(Nov 30, 2015 08:14 PM)Tostig Wrote:  Don't get me wrong OP, this is a great contribution. But I think Razor's and LaPanthere's Servatrix licensing system is a better way of doing this.
The only problem I have with using just one licensing technique is that it becomes easy to reverse over time. The more people that use the same technique, the simpler it becomes to crack. Take net seal for example. Over time, automated tools were created to crack it.

That being said, Servatrix does seem promising. But I myself, prefer to use a combination of LiteCode + NetSeal, as well as other authentication methods in relation to securely distributing the private keys, in order to protect my programs.

When you use a combination of great existing software(LiteCode + NetSeal for example) mixed with your own tweaks, it becomes much harder for your code to be reversed simply, since it is so unique.

Just my $0.02.
(Nov 30, 2015 08:44 PM)debug Wrote:  The only problem I have with using just one licensing technique is that it becomes easy to reverse over time. The more people that use the same technique, the simpler it becomes to crack. Take net seal for example. Over time, automated tools were created to crack it.

That being said, Servatrix does seem promising. But I myself, prefer to use a combination of LiteCode + NetSeal, as well as other authentication methods in relation to securely distributing the private keys, in order to protect my programs.

When you use a combination of great existing software(LiteCode + NetSeal for example) mixed with your own tweaks, it becomes much harder for your code to be reversed simply, since it is so unique.

Just my $0.02.

You make a good case. Crack protection isn't the easiest thing to do, and you seem to know what you're doing. 🤝
[Image: giphy.gif?cid=790b7611b007c1bdd2cd47171b...y.gif&ct=g]
If possible, can you please post the process of producing private/public keys, and how to specifically add functions to the server/client?

Those are the two areas I am having challenges with, and maybe others as well.

But thank you for starting a tutorial thread for LiteCode!

I appreciate it very much! (:
(Nov 30, 2015 09:03 PM)CoderEX Wrote:  If possible, can you please post the process of producing private/public keys, and how to specifically add functions to the server/client?

Those are the two areas I am having challenges with, and maybe others as well.

But thank you for starting a tutorial thread for LiteCode!

I appreciate it very much! (:
For public private keys, they can be anything. For instance, the ones I supplied are a few default windows 7 images, I just renamed them. Your keys could be random letters, pictures, or anything really.

As for adding functions to the server/client, you have to do a few things.

Server AND Client side:
-Modify the interface file(ISharedClass) to include your new function.

Server side:
-Modify the SharedClass to implement the new function you have created in the interface(ISharedClass).

Client side:
-Modify the client class to call the new method you have created.

If you review the code I have supplied, you should be able to simply copy the existing method I have created in order to fit your needs.
(Nov 30, 2015 08:14 PM)Tostig Wrote:  Don't get me wrong OP, this is a great contribution. But I think Razor's and LaPanthere's Servatrix licensing system is a better way of doing this.

Servatrix has already been compromised, someone's created a tool to dump the remote vars.
(Nov 30, 2015 08:14 PM)Tostig Wrote:  Don't get me wrong OP, this is a great contribution. But I think Razor's and LaPanthere's Servatrix licensing system is a better way of doing this.

Wardow has been a lovely fellow and created an app to emulate already :)
n0th!ng always wins :)

Wait for RCE, or use Litecode if need be :)



Thanks for posting Aeon.
[Image: PVoDiqS.png]
Good job debug! @Lakitty wish you guys the best with the project.
(Dec 1, 2015 06:44 AM)Cecilia Wrote:  Wardow has been a lovely fellow and created an app to emulate already :)
n0th!ng always wins :)

Wait for RCE, or use Litecode if need be :)



Thanks for posting Aeon.
Ooh, I'd love to see how he did it. But lets keep this on topic ;)

If I have time later today I will update this post with more information, possibly on how to securely integrate with NetSeal.
(Dec 1, 2015 06:44 AM)Cecilia Wrote:  Wardow has been a lovely fellow and created an app to emulate already :)
n0th!ng always wins :)

Wait for RCE, or use Litecode if need be :)



Thanks for posting Aeon.

Here is how it looks:

[img]http://prntscr.com/996f68/direct[/img]

I'm not gonna release it though.
(Dec 1, 2015 11:36 AM)Wardow Wrote:  Here is how it looks:

[img]http://prntscr.com/996f68/direct[/img]

I'm not gonna release it though.
Looks nice. I challenge you to make one for Litecode ;)

Updated OP with video explanation.
(Dec 1, 2015 11:36 AM)Wardow Wrote:  Here is how it looks:

[img]http://prntscr.com/996f68/direct[/img]

I'm not gonna release it though.

You haven't made anything, that's why you're not releasing it. We've all seen the stupid ass code you've posted and you trying to "prove a point", there's no way in hell you made something like that even though it's not even that hard.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by StaticCGJul 3, 2025 02:00 AM 19 1,178 Jul 3, 2025 02:00 AM
Last Post: john ronaldsad
[.NET] by ClusterzIncMar 11, 2019 09:48 AM 10 1,248 Mar 11, 2019 09:48 AM
Last Post: ClusterzInc
[C#] by gigajewDec 2, 2018 12:22 PM 6 489 Dec 2, 2018 12:22 PM
Last Post: Nick (Name)