May 29, 2020 01:35 PM
(This post was last modified: May 29, 2020 01:37 PM by wayofAK.)
Hello, I have a question regarding NT API un-hooking. There are a lot of ways explained in various write-ups, like this one [0]
As I far as I got, one way is to get into the syscalls, on our own, without depending on ntdll. This way, we're crossing to kernel mode without any help of the ntdlll which is (hooked) by an AV, like explained here [1].
This works well when talking about a 32 bit process on 32 windows or 64 bit process on 64 windows. There, u can get the syscall, put it urself in ur code, and bypass the hook. As we are directly using syscalls in the loaded ntdll.
For 32 process in 64 windows. This isn't made directly. ntdll (32 bit) points to WoW64 transition in another dll which points after some jumps to the one which calls syscalls (ntdll 64 bit as we are on 64 windows) see [2]
Knowing this I have some questions I hope any one with enough exp. to answer.
1- Where does the AV hooks in this case? the 64 bit ntdll (at /system32) or 32 bit one (at /WoW64) which will finally land to the 64 one. ( I guess it will be at the 64 one, but not sure)
2- Does this mean, I can drop the dependency on intermediate WoW64 dlls and just call sys calls according to the windows 32/64 myself ? ( so the plan is to check windows arch, if 64 use syscall with 64 codes else use syscall with 32 codes)
3- What are AVs which uses this technique to test my exes on?
_________
[0] https://hackforums.net/showthread.php?ti...id55198692
[1] https://outflank.nl/blog/2019/06/19/red-...ss-av-edr/
[2] https://medium.com/@fsx30/hooking-heaven...35e1aeed73
As I far as I got, one way is to get into the syscalls, on our own, without depending on ntdll. This way, we're crossing to kernel mode without any help of the ntdlll which is (hooked) by an AV, like explained here [1].
This works well when talking about a 32 bit process on 32 windows or 64 bit process on 64 windows. There, u can get the syscall, put it urself in ur code, and bypass the hook. As we are directly using syscalls in the loaded ntdll.
For 32 process in 64 windows. This isn't made directly. ntdll (32 bit) points to WoW64 transition in another dll which points after some jumps to the one which calls syscalls (ntdll 64 bit as we are on 64 windows) see [2]
Knowing this I have some questions I hope any one with enough exp. to answer.
1- Where does the AV hooks in this case? the 64 bit ntdll (at /system32) or 32 bit one (at /WoW64) which will finally land to the 64 one. ( I guess it will be at the 64 one, but not sure)
2- Does this mean, I can drop the dependency on intermediate WoW64 dlls and just call sys calls according to the windows 32/64 myself ? ( so the plan is to check windows arch, if 64 use syscall with 64 codes else use syscall with 32 codes)
3- What are AVs which uses this technique to test my exes on?
_________
[0] https://hackforums.net/showthread.php?ti...id55198692
[1] https://outflank.nl/blog/2019/06/19/red-...ss-av-edr/
[2] https://medium.com/@fsx30/hooking-heaven...35e1aeed73

