Skip to content

Instantly share code, notes, and snippets.

bohops / Application_Guard_WDAC_Policy.xml
Created Jul 21, 2021
Microsoft Defender Application Guard WDAC policy (for Edge). Converted using @mattifestation's ConvertTo-CIPolicy PowerShell Script []
View Application_Guard_WDAC_Policy.xml
<?xml version="1.0"?>
<SiPolicy xmlns:xsd="" xmlns:xsi="" xmlns="urn:schemas-microsoft-com:sipolicy">
bohops / Unload_DotNet_DLLs.cs
Last active Mar 16, 2021
View Unload_DotNet_DLLs.cs
//Unload .NET runtime modules (DLLs) with DInvoke [by @theWover]
// License ->
MIT License
Copyright (c) 2020 TheWover
Permission is hereby granted, free of charge, to any person obtaining a copy
bohops / env_var_spoofing_NGenAssemblyUsageLog_poc.cpp
Last active Mar 19, 2021
View env_var_spoofing_NGenAssemblyUsageLog_poc.cpp
// I borrowed this great POC from Adam Chester [@_xpn_] to demonstrate spoofing for evading .NET 'Usage Logging'.
// This code will launch the target a suspended PowerShell.exe process, read PEB, update the ptr used to store environment variables, and resume the process
// Adam's original POC and blog for evading ETW with COMPlus_ETWEnabled can be found at these URLs:
// Applicable detection guidance (with a few possible tweaks) can be found here:
bohops / fsharp.fsscript
Created Oct 22, 2020 — forked from NickTyrer/fsharp.fsscript
fsi.exe inline execution
View fsharp.fsscript
#r @"C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll"
open System.Management.Automation
open System.Management.Automation.Runspaces
open System
let runSpace = RunspaceFactory.CreateRunspace()
let pipeline = runSpace.CreatePipeline()
View ETW_Assembly_Load_Monitor.cs
//A Quick POC for monitoring .NET Assembly Load Events with ETW
// References:
// - Microsoft CLR Provider:
// - ETW Assembly Load Events:
// - Source Code Sample:
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Parsers;
using Microsoft.Diagnostics.Tracing.Session;
using System;
View Excel_VBA_Macro_JScript
Sub Workbook_Open()
End Sub
Function RunMe()
Dim ScriptEngine
Set ScriptEngine = CreateObject("MSScriptControl.ScriptControl")
ScriptEngine.Language = "JScript"
ScriptEngine.Eval ("var shell = new ActiveXObject('WScript.Shell');shell.Popup('text');")
End Function
bohops / SimpleExportExampleDll.cpp
Last active Jun 12, 2020
Simple Export Dll Example
View SimpleExportExampleDll.cpp
#include "pch.h"
#define EXPORT extern "C" __declspec(dllexport)
EXPORT void HelloWorld()
MessageBox(0, L"Hello World!", 0, 0);
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
bohops /
Created Apr 30, 2020
GhostLoader - AppDomainManager - Injection - 攻壳机动队

GhostLoader Steps :)

1. Create C:\Tools
2. Copy Some .NET, any .NET binary to C:\Tools
3. In this example, we use FileHistory.exe, but any .NET app will do.
4. Ensure FileHistory.exe.config is in the same path
5. Execute C:\Tools\FileHistory.exe
View simple_msbuild.csproj
<Project ToolsVersion="4.0" xmlns="">
<UsingTask TaskName="HelloWorld" TaskFactory="CodeTaskFactory" AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll">
<Code Type="Fragment" Language="cs">
<![CDATA[Console.WriteLine(":-) CSHARP :-)");]]>
<Target Name="Build">
<HelloWorld />
bohops / dsdbutil.exe
Last active Mar 29, 2020
yet another native AD database extraction utility
View dsdbutil.exe
- dsdbutil (dsdbutil.exe) is utility for performing maintenance on AD/LDS databases []
- dsdbutil supports VSS snapshot creation
- dsdbutil can be used to extract the AD database (ntds.dit) for offline analysis (with
- Example #1: Using Snapshot GUID obtained from cmd output
dsdbutil.exe "activate instance ntds" "snapshot" "create" "quit" "quit"