Skip to content
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

The specified executable is not a valid application for this OS platform. #24

Open
axano opened this issue Oct 31, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@axano
Copy link

axano commented Oct 31, 2021

When I try to run the packed exe I get this error: The specified executable is not a valid application for this OS platform.

This is the used command:

python .\inceptor.py dotnet e_inj.exe -o packed.exe -s -sd www.microsoft.com -s -ss "C:\Windows\system32\ntdll.dll"

This is the output:

[+] .Net Artifact Generator Started At 2021-10-31 16:29:16.934982
[*] Phase 0: Loading...
[*] Phase 1: Converting binary into shellcode
  [>] Transformer: Pe2sh
  [WARNING] This is a console application! The recommended subsystem is GUI.
  [WARNING] e_inj.exe may not work in .NET
[*] Phase 2: Encoding
  [>] Encoder Chain: HexEncoder
  [>] Shellcode size: 58060
  [>] Shellcode Signature: 6d567a0c9b79df74844d9d33cad96814185a4416
[*] Phase 3: Generating source files using PE_LOAD
  [>] Phase 3.1: Writing CS file in .\temp\tmpm0gi_vr3.cs
[*] Phase 4: Compiling
[*] Phase 5: Sign dotnet binary
  [+] Signed with: SigThief
[*] Phase 6: Finalising
  [+] Success: file stored at packed.exe
[*] Phase 7: Cleaning up
[+] .Net Artifact Generator Finished At 2021-10-31 16:29:17.700150

And this is the error when i try to run the packed exe:

.\packed.exe
Program 'packed.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ .\packed.exe
+ ~~~~~~~~~~~~.
At line:1 char:1

The e_inj.exe executable is written in C with visual studio and compiled in x64.

I get the same error for"

python .\inceptor.py native e_inj.exe -o packed.exe -s -sd www.microsoft.com -s -ss "C:\Windows\system32\ntdll.dll"

python .\inceptor.py native e_inj.exe -o packed.exe -t pe2sh -s -sd www.microsoft.com -s -ss "C:\Windows\system32\ntdll.dll"

@klezVirus klezVirus added the bug Something isn't working label Nov 2, 2021
@klezVirus
Copy link
Owner

Hi @axano, thanks for that. This is an issue with how SigThief works. It seems to me that the signature cloning is not applying only the signature to the output binary, effectively breaking the payload. Let me take a look at this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants