T1056.004: 凭证 API 钩取
摘要
攻击者可能钩取 Windows 应用程序编程接口(API)函数和 Linux 系统函数,以收集用户凭证。恶意钩取机制可能捕获包含可泄露用户身份验证凭证参数的 API 或函数调用。(Citation: Microsoft TrojanSpy:Win32/Ursnif.gen!I Sept 2017) 与 [Keylogging](https://attack.mitre.org/techniques/T1056/001) 不同,此技术专门针对包含可泄露用户凭证参数的 API 函数。 在 Windows 中,钩取涉及重定向对这些函数的调用,可通过以下方式实现: * **钩子过程(Hooks procedures)**,响应消息、击键和鼠标输入等事件来截获并执行指定代码。(Citation: Microsoft Hook Overview)(Citation: Elastic Process Injection July 2017) * **导入地址表(IAT)钩取**,利用对进程 IAT 的修改,IAT 中存储着指向所导入 API 函数的指针。(Citation: Elastic Process Injection July 2017)(Citation: Adlice Software IAT Hooks Oct 2014)(Citation: MWRInfoSecurity Dynamic Hooking 2015) * **内联钩取(Inline hooking)**,覆盖 API 函数中的开头字节以重定向代码流。(Citation: Elastic Process Injection July 2017)(Citation: HighTech Bridge Inline Hooking Sept 2011)(Citation: MWRInfoSecurity Dynamic Hooking 2015) 在 Linux 和 macOS 中,攻击者可能通过 `LD_PRELOAD`(Linux)或 `DYLD_INSERT_LIBRARIES`(macOS)环境变量钩取系统函数,这使共享库能够被加载到程序的地址空间中。例如,攻击者可以通过钩取 SSH 或 SCP 所利用的 `libc read` 函数来捕获凭证。(Citation: Intezer Symbiote 2022)
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- Windows
- Linux
- macOS
战术
收集
参考来源
- https://attack.mitre.org/techniques/T1056/004
- https://eyeofrablog.wordpress.com/2017/06/27/windows-keylogger-part-2-defense-against-user-land/
- https://zairon.wordpress.com/2006/12/06/any-application-defined-hook-procedure-on-my-machine/
- http://www.gmer.net/
- https://www.mwrinfosecurity.com/our-thinking/dynamic-hooking-techniques-user-mode/
- https://www.endgame.com/blog/technical-blog/ten-process-injection-techniques-technical-survey-common-and-trending-process
- https://intezer.com/blog/research/new-linux-threat-symbiote/
- https://www.scribd.com/document/68671361/Inline-Hooking-in-Windows
- https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=TrojanSpy:Win32/Ursnif.gen!I&threatId=-2147336918
- https://msdn.microsoft.com/library/windows/desktop/ms644959.aspx
- https://msdn.microsoft.com/library/windows/desktop/ms686701.aspx
- https://github.com/prekageo/winhook
- https://github.com/jay/gethooks
- https://security.stackexchange.com/questions/17904/what-are-the-methods-to-find-hooked-functions-and-apis
- https://www.adlice.com/userland-rootkits-part-1-iat-hooks/
- https://volatility-labs.blogspot.com/2012/09/movp-31-detecting-malware-hooks-in.html