Blogs
Tools
We can detect hooks by looking at the first 4 bytes of an API instruction.
Generally they are in sequence of 0x4c, 0x8b, 0xd1, 0xb8
If we don’t find this sequence then this indicates that API may be hooked.
We can use HookDetector to find all Hooked API calls. HookDetector can be executed using execute-assembly
in cobalt strike.
Blogs
Manual Mapping / Unhooking Techniques (same applies for kernel32.dll and others) - (Can be detected as the memory space changes from RX to RWX or there are multiple copies of NTDLL.dll in memory of process)
Direct Syscall Techniques - ( Can be detected as Syscall happens from process directly and not from ntdll.dll - read this , Also Call Stack/Sequence would be different )
**Indirect Syscall Techniques (**Ensures all systemcalls go through ntdll.dll or relevant syscall dll)
Syscall Tempering Techniques
Other Techniques
Using ACG(Arbitrary Code Guard)/BlockDll (CIG) mitigation policy