Created the Monday 18 March 2019. Updated 3 months, 1 week ago.
The information that the system uses to determine how to create heap structures is stored at an undocumented location in the PEB at offset
0x68. If the value at this location is
0x70, we know that we are running in a debugger.
NtGlobalFlag field of the Process Environment Block (0x68 offset on 32-Bit and 0xBC on 64-bit Windows) is 0 by default. Attaching a debugger doesn’t change the value of NtGlobalFlag. However, if the process was created by a debugger, the following flags will be set:
The presence of a debugger can be detected by checking a combination of those flags.
The resources provided below are associated links that will give you even more detailed information and research on current evasion technique. It is important to note that, while these resources may be helpful, it is important to exercise caution when following external links. As always, be careful when clicking on links from unknown sources, as they may lead to malicious content.