AI Security AI安全 3d ago Updated 3d ago 更新于 3天前 46

TWINLOOT Abuses SharePoint and Teams to Steal Credentials and Move Across Networks TWINLOOT滥用SharePoint和Teams窃取凭证并在网络间横向移动

TWINLOOT is a modular, PyArmor-hardened Python implant that operates its entire C2 infrastructure inside trusted Microsoft services (SharePoint Online and Microsoft Teams) It uses SharePoint Online file dead-drops via Microsoft Graph API for tasking and WebRTC DataChannels relayed by Teams TURN servers for interactive operator access The implant harvests Windows credentials through pixel-perfect fake lock screens and enables lateral movement via a reverse SOCKS5 tunnel to internal services (SMB, TWINLOOT是首个将Microsoft 365死投C2、Teams TURN中继滥用与无头浏览器传输结合在一起的Python植入框架 通过SharePoint Online文件死投和Teams WebRTC DataChannels建立双通道C2,流量伪装成合法Microsoft服务活动 使用像素级逼真伪造锁屏窃取Windows凭据,并通过反向SOCKS5隧道实现网络横向移动 初始访问通过Teams社会工程学攻击,伪装IT支持诱导受害者运行PowerShell下载恶意载荷 该工具利用PyArmor加固,所有C2流量均通过受害者自身Edge浏览器转发,极难与正常活动区分

68
Hot 热度
72
Quality 质量
55
Impact 影响力

Analysis 深度分析

TL;DR

  • TWINLOOT is a modular, PyArmor-hardened Python implant that operates its entire C2 infrastructure inside trusted Microsoft services (SharePoint Online and Microsoft Teams)
  • It uses SharePoint Online file dead-drops via Microsoft Graph API for tasking and WebRTC DataChannels relayed by Teams TURN servers for interactive operator access
  • The implant harvests Windows credentials through pixel-perfect fake lock screens and enables lateral movement via a reverse SOCKS5 tunnel to internal services (SMB, RDP, WinRM, MSSQL)
  • Initial access is achieved through social engineering on Microsoft Teams, where attackers impersonate IT support to trick targets into running a PowerShell command that downloads the payload
  • This represents the first tool to combine Microsoft 365 dead drop C2, Teams TURN relay abuse, and headless browser transport under a single framework

Why It Matters

TWINLOOT demonstrates a sophisticated evolution in offensive tradecraft by completely hiding command-and-control traffic within legitimate Microsoft 365 services, making detection extremely challenging for security teams relying on traditional network monitoring. The framework's design reflects deep knowledge of Microsoft cloud architecture and represents a growing trend of threat actors abusing enterprise collaboration platforms as covert communication channels.

Technical Details

  • C2 Architecture: Two parallel channels operate from the victim machine — a SharePoint dead drop that authenticates to an attacker's Azure tenant and polls for commands every 15 seconds, and a reverse SOCKS5 tunnel for interactive access and lateral movement
  • Headless Browser Transport: Graph API traffic is driven through a headless instance of the victim's own Edge browser, making it virtually indistinguishable from legitimate network activity
  • Credential Harvesting: The implant uses "pixel-perfect fake lock screens" triggered by the "credz_waiting" command; passwords are never validated against Windows authentication — victims see an "incorrect password" error and re-enter credentials, which are then encrypted and exfiltrated via SharePoint
  • Lateral Movement: The SOCKS5 listener on the operator's machine (127.0.0.1:1080) proxies traffic into the victim's internal network, exiting from pythonw.exe to targets on ports 445 (SMB), 3389 (RDP), 5985 (WinRM), and 1433 (MSSQL)
  • Initial Access & Payload: Social engineering via Microsoft Teams impersonating IT support; PowerShell command downloads an archive containing Python runtime and a 39 MB compiled payload ("bootstrap-fat.pyc") that serves as the TWINLOOT loader
  • TURN Relay Implementation: Uses WebRTC DataChannels via aiortc library, differing from similar tools like Backdoor.Turn (which uses QUIC sessions) and msaRAT (which uses Twilio TURN with CDP-based browser control)

Industry Insight

  • Security teams should implement enhanced monitoring for anomalous Microsoft Graph API activity and WebRTC traffic patterns originating from Edge browsers, as traditional network-based detection will likely miss this type of legitimate-service abuse
  • The rapid adoption of TURN relay abuse by multiple threat actors (DragonForce, Chaos ransomware group) within a year of the "Ghost Calls" technique disclosure indicates this is becoming a standardized offensive capability that should be incorporated into threat intelligence frameworks and detection rules
  • Organizations should enforce strict PowerShell execution policies and user awareness training specifically targeting Teams-based social engineering, as the initial access vector exploits trust in internal IT communication channels

TL;DR

  • TWINLOOT是首个将Microsoft 365死投C2、Teams TURN中继滥用与无头浏览器传输结合在一起的Python植入框架
  • 通过SharePoint Online文件死投和Teams WebRTC DataChannels建立双通道C2,流量伪装成合法Microsoft服务活动
  • 使用像素级逼真伪造锁屏窃取Windows凭据,并通过反向SOCKS5隧道实现网络横向移动
  • 初始访问通过Teams社会工程学攻击,伪装IT支持诱导受害者运行PowerShell下载恶意载荷
  • 该工具利用PyArmor加固,所有C2流量均通过受害者自身Edge浏览器转发,极难与正常活动区分

为什么值得看

TWINLOOT展示了威胁行为者如何深度利用Microsoft云生态系统构建隐蔽的C2基础设施,为安全从业者提供了新型攻击模式的典型案例。该工具的技术实现反映了攻击者对Microsoft 365架构的深入理解,对云环境安全检测和响应策略具有重要参考价值。

技术解析

  • 双通道C2架构:TWINLOOT运行两个并行通道——SharePoint死投通道每15秒轮询攻击者Azure租户中的SharePoint驱动器获取指令,Teams TURN中继通道提供交互式访问和横向移动能力
  • 流量伪装技术:所有Graph API流量通过受害者Edge浏览器的无头实例传输,使恶意流量与合法网络活动几乎无法区分
  • 凭据窃取机制:通过"credz_waiting"命令触发像素级伪造锁屏,不验证密码正确性即显示错误提示诱导用户重新输入,捕获的凭据加密后上传至SharePoint
  • 横向移动实现:攻击者在本地127.0.0.1:1080建立SOCKS5监听器,通过pythonw.exe进程将流量代理至内网目标(SMB 445、RDP 3389、WinRM 5985、MSSQL 1433端口)
  • 技术演进对比:与Backdoor.Turn(QUIC会话)和msaRAT(Twilio TURN+CDP控制)相比,TWINLOOT采用WebRTC DataChannels via aiortc实现Teams中继,代表了TURN滥用技术的持续演进

行业启示

  • 云服务滥用趋势加剧:多个独立威胁组织在一年内相继采用TURN中继滥用技术(Ghost Calls),表明攻击者正系统性地将合法云服务转化为C2基础设施
  • Microsoft生态安全挑战:TWINLOOT展示了攻击者对Microsoft 365架构的深度利用能力,企业需重新评估云服务的边界检测和异常行为监控策略
  • 检测响应策略调整:传统网络流量分析难以识别此类攻击,建议结合浏览器行为监控、API调用模式分析和用户实体行为分析(UEBA)构建多层检测体系

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Security 安全 Research 科学研究