-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binaries not working #4
Comments
Hello,
using System;
using System.IO;
namespace Dummy
{
public class Program
{
public Program()
{
File.WriteAllText(@"C:\Windows\Tasks\dummy.log","Executed from Dummy");
}
}
}
Let me know if you still have the same issues. |
Hello, When switching from EXE to DLL, the TestAssembly is correctly compiled and loaded well with GadgetToJScript in VBS, VBA and JS formats. When I generate a payload in HTA format, it doesn't work: I don't get the Msgbox execution (and the way to generate it is the same as the previous formats, only that it changes to hta) this is the command I use to generate the HTA:
On the other hand, I have modified my dummy executable, in the way you have proposed and it works correctly in VBS, VBA and JS (in HTA it is the same as with TestAssembly). Then, I'm seeing that generating the NET Assemblies as a DLL works all right, I still have to try with EXEs. Let's see if we can solve the HTA one and then they would all be verified. Greetings and thanks |
The HTA works just fine for me, if you can share the generated HTA here, i can have a look at it. Can you also please provide more information about the .NET version and arch (x86,x64) used to build both TestAssembly and G2JS. |
Hello, I'm using .NET Framework 4.6.1 (64 bits) in both projects. I share the HTA obtained. |
Hello, Didn't get a chance to get back to you sooner (busy times). This is a common behavior for generated JS scripts as well, I'm assuming that your Win Machine/VM is by default using the 32-bit HTA handler which corresponds to "C:\Windows\SysWOW64\mshta.exe" for running the HTA, you can confirm that by querying You can either set the previous registry key to the 64-bit HTA handler "C:\Windows\System32\mshta.exe" or run the HTA using the following command: Just for ref; same thing applies to other WSH scripts, just check which default handler is in use (32-bit or 64-bit version of cscript.exe) |
Hello, Right, you were right about the 32-bit mshta, it was being used by default, when I switched to 64-bit it worked. Everything works perfectly, thank you very much and congratulations for the tool! |
Great, Will close this issue for now, feel free to re-open it if you got any more questions. |
Hello,
I am testing the tool but I have detected several failures:
TestAssembly . When I compile the solution, both projects are compiled, GadgetToJScript compiles correctly but TestAssembly gives me the following error: "The program does not contain any static 'Main' method suitable for an entry point". If I modify the Main by setting the method to "public static void Main(string[] args)" then it compiles correctly.
Thinking that it could be a problem with my dummy.exe file, I also tried the TestAssembly (compiled with the changes I mentioned above) but it didn't work either, i.e. Msgbox wasn't shown. I have done the same procedure with vbs and vba (to see different formats), but neither of them has worked. I have also thought that it could be because of architecture issue, but I have compiled the GadgetToJScript in 64 bits version and in 32 bits version and it still doesn't work.
I am using Visual Studio 2019, and Windows 10 Professional, with the Windows Defender disabled.
I hope you can help me solve it, the tool seems very powerful and I look forward to using it.
Best regards
The text was updated successfully, but these errors were encountered: