med0x2e / GadgetToJScript

A tool for generating .NET serialized gadgets that can trigger .NET assembly load/execution when deserialized using BinaryFormatter from JS/VBS/VBA based scripts.
GNU General Public License v3.0
850 stars 157 forks source link

Not working correctly #6

Closed hookthieves closed 3 years ago

hookthieves commented 3 years ago

Hello I downloaded this and Opened the .sln file onto Visual Studio Code I build it and it built successfully without any errors GadgetToJScript.exe -b -w js -c dropper.cs -o test

The dropper.cs file is one that is automatically generated when starting a PoshC2 instance.

It gives me this error: [+]: Generating the js payload [+]: First stage gadget generation done. [+]: Compiling your .NET code located at:dropper.cs Error _AssemblyLoader: Error (CS1056): Unexpected character '$': 574 : at GadgetToJScript._AssemblyLoader.compile(String csFile, String references) in C:\Users\User1\Documents\data\GadgetToJScript-master\GadgetToJScript-master\GadgetToJScript_AssemblyLoader.cs:line 48

I go into Assemblyloader line 48 and see the line below. Is there something I am doing wrong? image

Please assist if you can.

Thank you so much!

med0x2e commented 3 years ago

Hi There,

Seems like the error could be related to code you have placed within dropper.cs source file (Line number 574), if it is not the case, then it will be helpful if you can share the "dropper.cs" (remove shellcode var) file in order to reproduce the issue and work on a fix.

med0x2e commented 3 years ago

Will close this issue, feel free to re-open if still facing the same issue.