Debugger Evasion

T1622

Technique.View on attack.mitre.org

About this technique

Adversaries may employ various means to detect and avoid debuggers. Debuggers are typically used by defenders to trace and/or analyze the execution of potential malware payloads.

Debugger evasion may include changing behaviors based on the results of the checks for the presence of artifacts indicative of a debugged environment. Similar to Virtualization/Sandbox Evasion, if the adversary detects a debugger, they may alter their malware to disengage from the victim or conceal the core functions of the implant. They may also search for debugger artifacts before dropping secondary or additional payloads.

Specific checks will vary based on the target and/or adversary. On Windows, this may involve Native API function calls such as IsDebuggerPresent() and NtQueryInformationProcess(), or manually checking the BeingDebugged flag of the Process Environment Block (PEB). On Linux, this may involve querying `/proc/self/status` for the `TracerPID` field, which indicates whether or not the process is being traced by dynamic analysis tools. Other checks for debugging artifacts may also seek to enumerate hardware breakpoints, interrupt assembly opcodes, time checks, or measurements if exceptions are raised in the current process (assuming a present debugger would “swallow” or handle the potential error).

Malware may also leverage Structured Exception Handling (SEH) to detect debuggers by throwing an exception and detecting whether the process is suspended. SEH handles both hardware and software expectations, providing control over the exceptions including support for debugging. If a debugger is present, the program’s control will be transferred to the debugger, and the execution of the code will be suspended. If the debugger is not present, control will be transferred to the SEH handler, which will automatically handle the exception and allow the program’s execution to continue.

Adversaries may use the information learned from these debugger checks during automated discovery to shape follow-on behaviors. Debuggers can also be evaded by detaching the process or flooding debug logs with meaningless data via messages produced by looping Native API function calls such as OutputDebugStringW().

Detection rules1

Rules on DetectionCode tagged with T1622.

Sigma1

RuleLevelLog source
PUA - Process Hacker Executionmediumwindows / process_creation

Splunk0

No Splunk rules are mapped to this technique yet.

Groups1

Software24

Campaigns1

Procedure examples26

Groups1

Used byProcedure example
GroupMustang Panda

Mustang Panda has embedded debug strings with messages to distract analysts. Mustang Panda has also made calls to Windows API `CheckRemoteDebuggerPresent` and exits if it detects a debugger.

Software24

Used byProcedure example
MalwareANELLDR

ANELLDR can call `ZwSetInformationThread` with the second argument set to `ThreadHideFromDebugger (0x11)` to evade being debugged.

ToolAsyncRAT

AsyncRAT can use the `CheckRemoteDebuggerPresent` function to detect the presence of a debugger.

MalwareBlack Basta

The Black Basta dropper can check system flags, CPU registers, CPU instructions, process timing, system libraries, and APIs to determine if a debugger is present.

MalwareBumblebee

Bumblebee can search for tools used in static analysis.

MalwareDarkGate

DarkGate checks the BeingDebugged flag in the PEB structure during execution to identify if the malware is being debugged.

MalwareDarkTortilla

DarkTortilla can detect debuggers by using functions such as `DebuggerIsAttached` and `DebuggerIsLogging`. DarkTortilla can also detect profilers by verifying the `COR_ENABLE_PROFILING` environment variable is present and active.

MalwareDRATzarus

DRATzarus can use `IsDebuggerPresent` to detect whether a debugger is present on a victim.

MalwareLatrodectus

Latrodectus has the ability to check for the presence of debuggers.

View all 24 software examples

Campaigns1

Used byProcedure example
CampaignOperation Dream Job

During Operation Dream Job, Lazarus Group used tools that used the `IsDebuggerPresent` call to detect debuggers.

References9

  1. AlKhaser Debug Open source
    Noteworthy. (2019, January 6). Al-Khaser. Retrieved April 1, 2022.
  2. Apriorit Open source
    Apriorit. (2024, June 4). Anti Debugging Protection Techniques with Examples. Retrieved March 4, 2025.
  3. Cado Security P2PInfect 2023 Open source
    jbowen. (2023, December 4). P2Pinfect - New Variant Targets MIPS Devices. Retrieved March 18, 2025.
  4. Checkpoint Dridex Jan 2021 Open source
    Check Point Research. (2021, January 4). Stopping Serial Killer: Catching the Next Strike. Retrieved September 7, 2021.
  5. Positive Technologies Hellhounds 2023 Open source
    PT Expert Security Center. (2023, November 29). Hellhounds: operation Lahat. Retrieved March 18, 2025.
  6. ProcessHacker Github Open source
    ProcessHacker. (2009, October 27). Process Hacker. Retrieved April 11, 2022.
  7. hasherezade debug Open source
    hasherezade. (2021, June 30). Module 3 - Understanding and countering malware's evasion and self-defence. Retrieved April 1, 2022.
  8. vxunderground debug Open source
    vxunderground. (2021, June 30). VX-API. Retrieved April 1, 2022.
  9. wardle evilquest partii Open source
    Patrick Wardle. (2020, July 3). OSX.EvilQuest Uncovered part ii: insidious capabilities. Retrieved March 21, 2021.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.