A tool for generating .NET serialized gadgets that can trigger .NET assembly load/execution when deserialized using BinaryFormatter from JS/VBS/VBA based script
A tool for generating .NET serialized gadgets that can trigger .NET assembly load/execution when deserialized using BinaryFormatter from JS/VBS/VBA based script
A tool for generating .NET serialized gadgets that can trigger .NET assembly load/execution when deserialized using BinaryFormatter from JS/VBS/VBA scripts.
The current gadget triggers a call to Activator.CreateInstance() when deserialized using BinaryFormatter from jscript/vbscript/vba, this means it can be used to trigger execution of your .NET assembly of choice via the default/public constructor.
The tool was created mainly for automating WSH scripts weaponization for RT engagements (Initial Access, Lateral Movement, Persistence), the shellcode loader which was used for PoC is removed and replaced by an example assembly implemented in the TestAssembly project.
You can either use the binaries located in the Release folder or use VS2017 and retarget your project to .NET version 3.5 or 4.x in order to build G2JS from source.
| |-e, --encodeType=b64 | VBA gadgets encoding: b64 or hex (default set to b64) | |-o, --output=output | Generated payload output file, example: -o C:\Users\userX\Desktop\output (Without extension) | |-r, --regfree|registration-free activation of .NET based COM components, applicable to JS/HTA scripts only. | |-h, --help | Show Help`` |Use the .NET 3.5 version of G2JS to generate WSH Registration-free JScript/HTA scripts which can still bypass .NET framework 4.8+ type checking without having to disable such mitigation using the first TextFormattingRunProperties stage gadget. consider this as a better/cleaner bypass to execute Reg-free JScript/HTA payloads targeting .NET 4.8+ environments as it does not require:
Shell objectCOMPLUS_Version environment variable.-> less IOCs + targetting 3.5 made serializing/deserializing unserializable classes possible)
GadgetToJScript should be used for authorized red teaming and/or nonprofit educational purposes only. Any misuse of this software will not be the responsibility of the author. Use it at your own networks and/or with the network owner's permission.
No open issues yet, or sync has not completed.