This nim application get a clean copy of ntdll from a new process in a suspended state.We can use it to execute shellcode by direct system calls.
English README | 简体中文说明
- 20220315:Gets the Syscall address in the Ntdll, and then calls. The ability to bypass the inspection of the location where the Syscall instruction is executed
- Create a new process in a suspended state
- Get the ntdll base address
- Copy clean ntdll from the new process and kill it
- Save syscallStub from clean copy of ntdll
- Invoke the syscall
- Clone this repository
- Update which functions you required in
functions.txt
- Run
python3 NimSysCalls.py
to generate the inline assembly (syscalls.nim) file - example in the repo. - Compile and run it.
>> nim c -d:strip --opt:size -d:release -f -r example.nim
[*] Create process notepad.exe
[*] Read clean copy of ntdll from notepad.exe and kill the process
[*] Get export function from clean copy of ntdll
[*] Start create C:\Users\pw.log
[*] Syscall code: 85
[*] NtCreateFile return: 0
[*] Create file C:\Users\pw.log success