Created the Monday 18 March 2019. Updated 3 years, 6 months ago.

CheckRemoteDebuggerPresent is a kernel32.dll function that sets (-1)0xffffffff in the DebuggerPresent parameter if a debugger is present. Internally, it also uses NtQueryInformationProcess with ProcessDebugPort as a ProcessInformationClass parameter.

Technique Identifier


Code Snippets

#include "windows.h"
int main(void)
    BOOL HasDebugPort = FALSE;
    if (CheckRemoteDebuggerPresent(GetCurrentProcess(), &HasDebugPort))
           ExitProcess(0); // Running in ring-3 debugger
    // Running outside ring-3 debugger
    return 0;

Detection Rules

    name: check for debugger via API
    namespace: anti-analysis/anti-debugging/debugger-detection
    scope: function
      - Anti-Behavioral Analysis::Debugger Detection::CheckRemoteDebuggerPresent [B0001.002]
      - Anti-Behavioral Analysis::Debugger Detection::WudfIsAnyDebuggerPresent [B0001.031]
      - al-khaser_x86.exe_:0x420000
    - or:
      - api: kernel32.CheckRemoteDebuggerPresent
      - api: WUDFPlatform.WudfIsAnyDebuggerPresent
      - api: WUDFPlatform.WudfIsKernelDebuggerPresent
      - api: WUDFPlatform.WudfIsUserDebuggerPresent

Additional Resources

External Links

Subscribe to our Newsletter

The information entered into this form is mandatory. It will be subjected to computer processing. It is processed by computer in order to support our users and readers. The recipients of the data will be :

According to the Data Protection Act of January 6th, 1978, you have at any time, a right of access to and rectification of all of your personal data. If you wish to exercise this right and gain access to your personal data, please write to Thomas Roccia at

You may also oppose, for legitimate reasons, the processing of your personal data.