T1622: 调试器规避
摘要
攻击者可能采用各种手段来检测和规避调试器。调试器通常被防御者用于跟踪和/或分析潜在恶意有效载荷的执行。(Citation: ProcessHacker Github) 调试器规避可能包括根据检查是否存在表明处于调试环境的痕迹的结果来改变行为。与[虚拟化/沙箱规避](https://attack.mitre.org/techniques/T1497)类似,如果攻击者检测到调试器,他们可能更改其恶意软件以脱离受害者或隐藏植入体的核心功能。他们还可能在投放次要或额外有效载荷之前搜索调试器痕迹。 具体检查因目标和/或攻击者而异。在 Windows 上,这可能涉及[原生 API](https://attack.mitre.org/techniques/T1106) 函数调用,如 <code>IsDebuggerPresent()</code> 和 <code>NtQueryInformationProcess()</code>,或手动检查进程环境块(PEB)的 <code>BeingDebugged</code> 标志。在 Linux 上,这可能涉及查询 `/proc/self/status` 的 `TracerPID` 字段,该字段指示进程是否正被动态分析工具跟踪。(Citation: Cado Security P2PInfect 2023)(Citation: Positive Technologies Hellhounds 2023) 其他针对调试痕迹的检查还可能试图枚举硬件断点、中断汇编操作码、时间检查,或测量当前进程中是否引发异常(假设存在调试器会“吞掉”或处理潜在错误)。(Citation: hasherezade debug)(Citation: AlKhaser Debug)(Citation: vxunderground debug) 恶意软件还可能利用结构化异常处理(SEH),通过引发异常并检测进程是否被挂起来检测调试器。SEH 同时处理硬件和软件异常,提供对异常的控制,包括对调试的支持。如果存在调试器,程序的控制权将转移到调试器,代码的执行将被挂起。如果不存在调试器,控制权将转移到 SEH 处理程序,它将自动处理异常并允许程序继续执行。(Citation: Apriorit) 攻击者可能在自动化发现期间使用从这些调试器检查中获得的信息来塑造后续行为。调试器还可以通过分离进程,或通过循环[原生 API](https://attack.mitre.org/techniques/T1106) 函数调用(如 <code>OutputDebugStringW()</code>)产生消息、用无意义数据淹没调试日志来规避。(Citation: wardle evilquest partii)(Citation: Checkpoint Dridex Jan 2021)
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- Linux
- macOS
- Windows
战术
Stealth
参考来源
- https://attack.mitre.org/techniques/T1622
- https://www.apriorit.com/dev-blog/367-anti-reverse-engineering-protection-techniques-to-use-before-releasing-software
- https://research.checkpoint.com/2021/stopping-serial-killer-catching-the-next-strike/
- https://github.com/hasherezade/malware_training_vol1/blob/main/slides/module3/Module3_2_fingerprinting.pdf
- https://www.cadosecurity.com/blog/p2pinfect-new-variant-targets-mips-devices
- https://github.com/LordNoteworthy/al-khaser/tree/master/al-khaser/AntiDebug
- https://objective-see.com/blog/blog_0x60.html
- https://github.com/processhacker/processhacker
- https://global.ptsecurity.com/analytics/pt-esc-threat-intelligence/hellhounds-operation-lahat
- https://web.archive.org/web/20250904153443/https://github.com/vxunderground/VX-API/tree/main#anti-debug