Git Product home page Git Product logo

syswhispers2's Issues

Moving from SysWhispers1 to SysWhispers2

Correct me if im wrong but from what i understand to move from 1 -> 2 all i should have to do is replace .h file on the #include part of my code if the code using SysWhispers1 was working with that old .h syscalls file?
I ask because im getting a error when using x86_64-w64-mingw32. Error is "Undefined reference to '{INSERT syscall NAME}'

inlinegas rnd.h error

1.got the inline head file
python3 syswhispers.py --functions test,test -l inlinegas -o syscalls
2.include the file
syscallsinline.rnd.x64.h
3.complie
x86_64-w64-mingw32-gcc -w -o test.x64.o -c testc -DRANDSYSCALL -masm=intel

when i compile,i got this error

syscalls.h:260:9: error: missing terminating " character
260 | asm(".intel_syntax noprefix
| ^~~~~~~~~~~~~~~~~~~~~~~
syscalls.h:261:5: error: expected string literal before '.' token
261 | .global WhisperMain
| ^
syscalls.h:287:5: error: missing terminating " character

image

NtCreateThreadEx crashes the process

I have spent quite a few hours in debugging and finally nailed down why process injection is failing. The call to NtCreateThreadEX using SysWhispers2 isn't really working for me. The process crashes as soon as the thread is injected.

My code is very simple that I open the process using Pid, create a virtual memory and then create RemoteThreadEX. I have ported all the calls to Syswhispers from High level APis but when I call NtCreateThreadEX, the process is crashing. When I just call CreateRemoteThread Directly, it works fine.

This is how I am calling the function
NtCreateThreadEx(&hThread, GENERIC_EXECUTE, NULL, process_handle, pointer_after_allocated, pointer_after_allocated, FALSE, NULL, NULL, NULL, NULL);

I am trying to follow this tutorial but in my code, I take PID to inject.
https://sevrosecurity.com/2020/04/08/process-injection-part-1-createremotethread/

NtProtectVirtualMemory issue

How to solve symbol redefinition : NtProtectVirtualMemory and unmatched block nesting : NtProtectVirtualMemory issue

Cannot compile

Hi,
Got link error LNK 2005 for WhisperMain and any other sys call the was added.
already defined in syscallsstubs.md.x86/x64.obj

unable to compile in VS 2019 - 16.9.2

I have tried both SysWhisper and SysWhisper2. VS is throwing the following error messages. I have enabled the MASM in build customization and also the asm file is set to Macro Assembler.

1 . The first error on the line for NtAllocateVirtualMemory.
Error (active) | E0167 | argument of type "PULONG" is incompatible with parameter of type "PSIZE_T" | NewMetaPlayerLow | main.cpp | 127 |
status = NtAllocateVirtualMemory(process_handle, &pointer_after_allocated, 0, (PULONG)&allocation_size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);

The second error is on the ASM file.
Error | A2088 | END directive required at end of file | NewMetaPlayerLow |
c:\project\folder\syscalls_common.asm | 2872 |

The third error is
Error | MSB3721 | The command "ml64.exe /c /nologo /Zi /Fo"x64\Release\syscalls_common.obj" /W3 /errorReport:prompt /Tasyscalls_common.asm" exited with code 1. | NewMetaPlayerLow | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets | 70 |

Any help would be great or if you have a working visual studio project, that I can use to compare against my environment, would be big help too.

Missing prototypes of ONE Structure and SOME Functions.

I found some new functions were added in the newest Windows 10 build. But I can't look for their document. Will write the undocumented functions and a structure.

Functions:
NtPssCaptureVaSpaceBulk, NtAllocateUserPhysicalPagesEx, NtAcquireCrossVmMutant, NtCreateCrossVmMutant, NtDirectGraphicsCall, NtWriteErrorLogEntry, NtCreateWinStation, NtOpenWinStation, NtSetWinStationInformation, NtQueryWinStationInformation

Type:
CHANNEL_MESSAGE

RANDSYSCALL doesn't work with BOFs

I'm able to compile BOFs using the random syscall output with -DRANDSYSCALL; however, the BOF doesn't execute. No error is thrown by Cobalt Strike, it simply does nothing.

Using the embedded syscalls works absolutely fine. It's only the random jumps that fail.

Improvements/Suggestions (function names, x86, wow64)

First of all, great idea and work. Kudos on that! I discovered too late your work and unfortunately for me I had to create something similar years ago with lots of headaches...

Second, I would like to propose a few suggestions:

  • Add option to create or just create function prefixes (this is because if someone is using a library like phnt, or already has functions Nt/Zw defined it will horribly conflict)
  • Try to introduce x86 support as well (you need to create a compile time template and resolve the function arguments size)
  • Have a look at rewolf's wow64 gate, it may be possible to introduce wow64 support

Small help for x86:

0xB8, 0x0, 0x0, 0x0, 0x0, // mov eax, SYS INDEX
0xE8, 0x3, 0x0, 0x0, 0x0, // call sysentry
0xC2, 0x00, 0x0,  // ret ARGUMENTS LENGTH SIZE
// sysenter:
0x8B, 0xD4, // mov edx,esp
0x0F, 0x34, // sysenter
0xC3 // retn

These are just suggestions of course so please take it or leave it. I`m happy with just the x64 version for some future projects :)

can't compile project - cannot convert argument 4 from "PULONG" to "PSIZE_T"

Hi,

I take example code from your description (how inject DLL) but get 2 errors during compilation- both on line

NtAllocateVirtualMemory(hProcess, &lpAllocationStart, 0, (PULONG)&szAllocationSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);

Errors :
1 ) argument of type "PULONG" is incompatible with parameter of type "PSIZE_T"
2 ) cannot convert argument 4 from "PULONG" to "PSIZE_T"

All code and the errors can be seen on the link https://ibb.co/JzrBx4y

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.