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.[1]
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, but may involve Native API function calls such as IsDebuggerPresent()
and NtQueryInformationProcess()
, or manually checking the BeingDebugged
flag of the Process Environment Block (PEB). 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).[2][3][4]
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()
.[5][6]
ID | Name | Description |
---|---|---|
S1087 | AsyncRAT |
AsyncRAT can use the |
S1070 | Black 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.[8] |
S1039 | Bumblebee | |
S1111 | DarkGate |
DarkGate checks the |
S1066 | DarkTortilla |
DarkTortilla can detect debuggers by using functions such as |
S0694 | DRATzarus |
DRATzarus can use |
S1160 | Latrodectus |
Latrodectus has the ability to check for the presence of debuggers.[13] |
S1060 | Mafalda |
Mafalda can search for debugging tools on a compromised host.[14] |
C0022 | Operation Dream Job |
During Operation Dream Job, Lazarus Group used tools that used the |
S1145 | Pikabot |
Pikabot features several methods to evade debugging by analysts, including checks for active debuggers, the use of breakpoints during execution, and checking various system information items such as system memory and the number of processors.[15][16][17] |
S1130 | Raspberry Robin |
Raspberry Robin leverages anti-debugging mechanisms through the use of |
S0240 | ROKRAT | |
S1018 | Saint Bot |
Saint Bot has used |
S0595 | ThiefQuest |
ThiefQuest uses a function named |
This type of attack technique cannot be easily mitigated with preventive controls since it is based on the abuse of system features.
ID | Data Source | Data Component | Detects |
---|---|---|---|
DS0015 | Application Log | Application Log Content |
Monitor debugger logs for signs of abnormal and potentially malicious activity. |
DS0017 | Command | Command Execution |
Monitor executed commands and arguments that may employ various means to detect and avoid debugged environments. Detecting actions related to debugger identification may be difficult depending on the adversary's implementation and monitoring required. |
DS0009 | Process | OS API Execution |
Monitor for API calls (such as |
Process Creation |
Monitoring for suspicious processes being spawned that gather a variety of system information or perform other forms of Discovery, especially in a short period of time, may aid in detection. Debugger related system checks will likely occur in the first steps of an operation but may also occur throughout as an adversary learns the environment. Data and events should not be viewed in isolation, but as part of a chain of behavior that could lead to other activities, such as lateral movement, based on the information obtained. |