OP 09 February, 2021 - 06:30 PM
(This post was last modified: 19 March, 2021 - 03:46 PM by PaxDoc.)
Reply
DO NOT "THANK" IN REPLY BITCHES. INSTEAD LIKE THE POST
NOTE: This Works for Static IPs, if the IP is dynamic then prefer using HWID instead of IPHASH and use a Random String as SALT
None hidden Content, try and then send your gratitude in reply :)
Ok. I have worked out a simple Method to protect your software and sell it to specific People and make sure that if that person shares then the soft doesn't work.
Show ContentSpoiler:
1. Make your soft normally and build it. Let's Suppose it's Name is TestSoft.exe
2. Use the code Below to generate another .exe and send it to your Client and ask him to run it on the same machine on which he will use the soft and send you the output. DO NOT WORRY IT'S NOT a RAT. It will simply grab IP (sha256 hashed) and HWID of that machine and the soft will delete itself.
OUTPUT WILL BE IN FORMAT = IPHASH:HWID
3. Let's say the IP hash is "105dc49b703b1636ac1758b011fbf4a7c2a69b07f867647d8b339626bf4a0af6" and HWID is "XXXXXXXXXXXXXXXX"
4. Now Take this info and use it in the below code to generate a text file at desktop. Remember to change "PATH_TO_YOUR_TestSoft.exe" ,"IPHASH_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2" , "HWID_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2"
5. Now Last step. Create new Project (this will be sent to your client). Copy all Text in EncSoft.txt generate on desktop in step 4 and paste it in place of "YOUR_ENC_STRING". Remember to add reference dlls that were initially refrenced in TestSoft.exe. For example if your soft uses Leaf.xNet.dll then addd it to reference in this project too else it won't run.
using System;
using System.IO;
using System.IO.Compression;
using System.Management;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Security;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
private static byte[] Bin;
private static bool First = true;
private static readonly string EXE = "YOUR_ENC_STRING";
static void Main(string[] args)
{
try
{
if (First)
Bin = Decompress(AES_Decrypt(Convert.FromBase64String(EXE)));
First = false;
Run2(Bin, args);
}
catch (Exception)
{
Console.WriteLine(" >> Soft Failed to load. Contact the Bot owner.");
Console.ReadLine();
}
Console.ReadLine();
}
private static string Get1()
{
string localIP;
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0))
{
socket.Connect("8.8.8.8", 65530);
IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
using (SHA256 sha = new SHA256CryptoServiceProvider())
{
localIP = BitConverter.ToString(sha.ComputeHash(Encoding.UTF8.GetBytes(endPoint.Address.ToString()))).Replace("-", string.Empty);
}
}
return localIP;
}
private static string Get2()
{
var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");
ManagementObjectCollection mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
id = mo["ProcessorId"].ToString();
break;
}
return id;
}
public static byte[] Decompress(byte[] tounzip)
{
using (MemoryStream memoryStream1 = new MemoryStream(tounzip))
{
using (MemoryStream memoryStream2 = new MemoryStream())
{
using (GZipStream gzipStream = new GZipStream(memoryStream1, CompressionMode.Decompress))
gzipStream.CopyTo(memoryStream2);
return memoryStream2.ToArray();
}
}
}
[SuppressUnmanagedCodeSecurity]
public static void Run2(byte[] byt, string[] args)
{
Assembly a = Assembly.Load(byt);
MethodInfo method = a.EntryPoint;
if (method != null)
{
object o = a.CreateInstance(method.Name);
method.Invoke(o, new object[] { args });
}
}
public static byte[] AES_Decrypt(byte[] bytesToBeDecrypted)
{
byte[] decryptedBytes = null;
using (MemoryStream ms = new MemoryStream())
{
using (RijndaelManaged AES = new RijndaelManaged())
{
AES.KeySize = 256;
AES.BlockSize = 128;
var key = new Rfc2898DeriveBytes(Encoding.UTF8.GetBytes(Get1()), Encoding.UTF8.GetBytes(Get2()), 5120);
AES.Key = key.GetBytes(AES.KeySize / 8);
AES.IV = key.GetBytes(AES.BlockSize / 8);
AES.Mode = CipherMode.CBC;
using (var cs = new CryptoStream(ms, AES.CreateDecryptor(), CryptoStreamMode.Write))
{
cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length);
cs.Close();
}
decryptedBytes = ms.ToArray();
}
}
return decryptedBytes;
}
}
}
2. Use the code Below to generate another .exe and send it to your Client and ask him to run it on the same machine on which he will use the soft and send you the output. DO NOT WORRY IT'S NOT a RAT. It will simply grab IP (sha256 hashed) and HWID of that machine and the soft will delete itself.
Show ContentSpoiler:
using System;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
Console.Write(Get1() + ":" + Get2() + "\t Press Enter to exit.");
Console.ReadLine();
}
private static string Get1()
{
string localIP;
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0))
{
socket.Connect("8.8.8.8", 65530);
IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
using (SHA256 sha = new SHA256CryptoServiceProvider())
{
localIP = BitConverter.ToString(sha.ComputeHash(Encoding.UTF8.GetBytes(endPoint.Address.ToString()))).Replace("-", string.Empty);
}
}
return localIP;
}
private static string Get2()
{
var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");
ManagementObjectCollection mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
id = mo["ProcessorId"].ToString();
break;
}
return id;
}
static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
string batchCommands = string.Empty;
string exeFileName = Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", string.Empty).Replace("/", "\\");
batchCommands += "@echo OFF\n";
batchCommands += "echo j | del /F ";
batchCommands += exeFileName + "\n";
batchCommands += "echo j | del deleteMyProgram.bat";
File.WriteAllText("SelfDelete.bat", batchCommands);
Process.Start("SelfDelete.bat");
}
}
}
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
Console.Write(Get1() + ":" + Get2() + "\t Press Enter to exit.");
Console.ReadLine();
}
private static string Get1()
{
string localIP;
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0))
{
socket.Connect("8.8.8.8", 65530);
IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
using (SHA256 sha = new SHA256CryptoServiceProvider())
{
localIP = BitConverter.ToString(sha.ComputeHash(Encoding.UTF8.GetBytes(endPoint.Address.ToString()))).Replace("-", string.Empty);
}
}
return localIP;
}
private static string Get2()
{
var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");
ManagementObjectCollection mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
id = mo["ProcessorId"].ToString();
break;
}
return id;
}
static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
string batchCommands = string.Empty;
string exeFileName = Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", string.Empty).Replace("/", "\\");
batchCommands += "@echo OFF\n";
batchCommands += "echo j | del /F ";
batchCommands += exeFileName + "\n";
batchCommands += "echo j | del deleteMyProgram.bat";
File.WriteAllText("SelfDelete.bat", batchCommands);
Process.Start("SelfDelete.bat");
}
}
}
OUTPUT WILL BE IN FORMAT = IPHASH:HWID
3. Let's say the IP hash is "105dc49b703b1636ac1758b011fbf4a7c2a69b07f867647d8b339626bf4a0af6" and HWID is "XXXXXXXXXXXXXXXX"
4. Now Take this info and use it in the below code to generate a text file at desktop. Remember to change "PATH_TO_YOUR_TestSoft.exe" ,"IPHASH_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2" , "HWID_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2"
Show ContentSpoiler:
using System;
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
static void Main(string[] args)
{
File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\EncSoft.txt",AES_Encrypt(File.ReadAllBytes("PATH_TO_YOUR_TestSoft.exe"),"IPHASH_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2", "HWID_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2")); // Check Step 1 to know what's TestSoft.exe
Console.WriteLine("Done");
Console.ReadLine();
}
public static byte[] Compress(byte[] text)
{
using (MemoryStream memoryStream1 = new MemoryStream(text))
{
using (MemoryStream memoryStream2 = new MemoryStream())
{
using (GZipStream gzipStream = new GZipStream(memoryStream2, CompressionMode.Compress))
memoryStream1.CopyTo(gzipStream);
return memoryStream2.ToArray();
}
}
}
public static string AES_Encrypt(byte[] bytesToBeEncrypted,string IPHASH, string HWID)
{
bytesToBeEncrypted = Compress(bytesToBeEncrypted);
byte[] EncryptedBytes = null;
using (MemoryStream ms = new MemoryStream())
{
using (RijndaelManaged AES = new RijndaelManaged())
{
AES.KeySize = 256;
AES.BlockSize = 128;
var key = new Rfc2898DeriveBytes(Encoding.UTF8.GetBytes(IPHASH), Encoding.UTF8.GetBytes(HWID), 1000);
AES.Key = key.GetBytes(AES.KeySize / 8);
AES.IV = key.GetBytes(AES.BlockSize / 8);
AES.Mode = CipherMode.CBC;
using (var cs = new CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write))
{
cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length);
cs.Close();
}
EncryptedBytes = ms.ToArray();
}
}
return Convert.ToBase64String(EncryptedBytes);
}
}
}
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
static void Main(string[] args)
{
File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\EncSoft.txt",AES_Encrypt(File.ReadAllBytes("PATH_TO_YOUR_TestSoft.exe"),"IPHASH_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2", "HWID_THAT_YOU_GOT_FROM_CLIENT_IN_STEP2")); // Check Step 1 to know what's TestSoft.exe
Console.WriteLine("Done");
Console.ReadLine();
}
public static byte[] Compress(byte[] text)
{
using (MemoryStream memoryStream1 = new MemoryStream(text))
{
using (MemoryStream memoryStream2 = new MemoryStream())
{
using (GZipStream gzipStream = new GZipStream(memoryStream2, CompressionMode.Compress))
memoryStream1.CopyTo(gzipStream);
return memoryStream2.ToArray();
}
}
}
public static string AES_Encrypt(byte[] bytesToBeEncrypted,string IPHASH, string HWID)
{
bytesToBeEncrypted = Compress(bytesToBeEncrypted);
byte[] EncryptedBytes = null;
using (MemoryStream ms = new MemoryStream())
{
using (RijndaelManaged AES = new RijndaelManaged())
{
AES.KeySize = 256;
AES.BlockSize = 128;
var key = new Rfc2898DeriveBytes(Encoding.UTF8.GetBytes(IPHASH), Encoding.UTF8.GetBytes(HWID), 1000);
AES.Key = key.GetBytes(AES.KeySize / 8);
AES.IV = key.GetBytes(AES.BlockSize / 8);
AES.Mode = CipherMode.CBC;
using (var cs = new CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write))
{
cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length);
cs.Close();
}
EncryptedBytes = ms.ToArray();
}
}
return Convert.ToBase64String(EncryptedBytes);
}
}
}
5. Now Last step. Create new Project (this will be sent to your client). Copy all Text in EncSoft.txt generate on desktop in step 4 and paste it in place of "YOUR_ENC_STRING". Remember to add reference dlls that were initially refrenced in TestSoft.exe. For example if your soft uses Leaf.xNet.dll then addd it to reference in this project too else it won't run.
Show ContentSpoiler:
using System;
using System.IO;
using System.IO.Compression;
using System.Management;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Security;
using System.Security.Cryptography;
using System.Text;
namespace CTO
{
class Program
{
private static byte[] Bin;
private static bool First = true;
private static readonly string EXE = "YOUR_ENC_STRING";
static void Main(string[] args)
{
try
{
if (First)
Bin = Decompress(AES_Decrypt(Convert.FromBase64String(EXE)));
First = false;
Run2(Bin, args);
}
catch (Exception)
{
Console.WriteLine(" >> Soft Failed to load. Contact the Bot owner.");
Console.ReadLine();
}
Console.ReadLine();
}
private static string Get1()
{
string localIP;
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0))
{
socket.Connect("8.8.8.8", 65530);
IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
using (SHA256 sha = new SHA256CryptoServiceProvider())
{
localIP = BitConverter.ToString(sha.ComputeHash(Encoding.UTF8.GetBytes(endPoint.Address.ToString()))).Replace("-", string.Empty);
}
}
return localIP;
}
private static string Get2()
{
var mbs = new ManagementObjectSearcher("Select ProcessorId From Win32_processor");
ManagementObjectCollection mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
id = mo["ProcessorId"].ToString();
break;
}
return id;
}
public static byte[] Decompress(byte[] tounzip)
{
using (MemoryStream memoryStream1 = new MemoryStream(tounzip))
{
using (MemoryStream memoryStream2 = new MemoryStream())
{
using (GZipStream gzipStream = new GZipStream(memoryStream1, CompressionMode.Decompress))
gzipStream.CopyTo(memoryStream2);
return memoryStream2.ToArray();
}
}
}
[SuppressUnmanagedCodeSecurity]
public static void Run2(byte[] byt, string[] args)
{
Assembly a = Assembly.Load(byt);
MethodInfo method = a.EntryPoint;
if (method != null)
{
object o = a.CreateInstance(method.Name);
method.Invoke(o, new object[] { args });
}
}
public static byte[] AES_Decrypt(byte[] bytesToBeDecrypted)
{
byte[] decryptedBytes = null;
using (MemoryStream ms = new MemoryStream())
{
using (RijndaelManaged AES = new RijndaelManaged())
{
AES.KeySize = 256;
AES.BlockSize = 128;
var key = new Rfc2898DeriveBytes(Encoding.UTF8.GetBytes(Get1()), Encoding.UTF8.GetBytes(Get2()), 5120);
AES.Key = key.GetBytes(AES.KeySize / 8);
AES.IV = key.GetBytes(AES.BlockSize / 8);
AES.Mode = CipherMode.CBC;
using (var cs = new CryptoStream(ms, AES.CreateDecryptor(), CryptoStreamMode.Write))
{
cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length);
cs.Close();
}
decryptedBytes = ms.ToArray();
}
}
return decryptedBytes;
}
}
}
NOTE: This method secures your soft to the extent that only single IP can be used to run the soft. Start from step 2 if you need to give it to another client. This helps creating multiple programs with different sig each time and not allowing it to be shared by the client.
+REP and Like for more stuff like this
ParallaX Coming Soon