XSL脚本处理

XSL脚本处理是攻击者利用可扩展样式表语言(XSL)的文件结构与脚本执行功能,绕过应用控制策略并执行恶意代码的技术。通过微软官方工具(如msxsl.exe)或Windows管理组件(如WMIC)解析嵌入了脚本的XSL文件,攻击者可在不触发传统白名单机制的情况下实现代码执行。防御方通常通过监控可疑工具调用(如异常参数或远程资源加载)、分析进程树完整性以及审查XSL文件内容来检测此类攻击。

为规避基于静态特征检测和行为规则匹配的防御机制,攻击者持续演进XSL脚本处理技术,发展出混淆嵌入、格式伪装、云端化加载和工具链协同等高级匿迹手法,将恶意操作分解为多个符合正常管理场景的原子化步骤,显著降低单点检测可能性。

现有XSL脚本处理匿迹技术的核心在于合法资源滥用。攻击者通过三重维度实现隐蔽性提升:首先,深度利用系统信任资源,将恶意负载嵌入符合XSL规范的文件结构,并依托微软签名的工具链执行,规避应用控制策略;其次,采用格式伪装与动态加载技术,切断攻击链的物理存储依赖,使防御方难以获取完整攻击样本;最后,通过多工具协同调用构建符合运维场景的操作序列,将恶意行为特征稀释在大量合法管理活动中。典型技术如远程XSL加载通过云端化分离攻击阶段,文件类型伪装利用格式认知差异绕过检测,工具链调用则模仿正常系统管理行为模式,共同形成"表面合规、内在恶意"的新型攻击范式。

匿迹技术的演进迫使防御方突破传统文件特征检测模式,需加强进程行为链分析能力,建立跨工具调用关系的异常模式识别机制,并实施网络流量与命令行参数的深度关联分析。同时,应对XSL文件解析过程实施运行时监控,阻断未经授权的脚本执行上下文。

ID: T1220
Sub-techniques:  T1220.001, T1220.002
Tactic: 防御规避
Platforms: Windows
System Requirements: Microsoft Core XML Services (MSXML) or access to wmic.exe
Defense Bypassed: Anti-virus, Application Control, Digital Certificate Validation
Contributors: Avneet Singh; Casey Smith; Praetorian
Version: 1.2
Created: 17 October 2018
Last Modified: 12 September 2024

匿迹效应

效应类型 是否存在
特征伪装
行为透明
数据遮蔽
时空释痕

特征伪装

攻击者通过篡改文件扩展名、伪造文件签名以及嵌入复合格式内容,将恶意XSL文件伪装成图像、文档等非可执行文件类型。同时利用XSL标准支持的合法脚本标签对恶意代码进行语法合规性封装,使静态分析工具误判为正常样式表文件,实现攻击载荷的格式层隐匿。

行为透明

攻击者使用XSL文件执行恶意代码时,常常依赖于Windows内建的合法工具(如msxsl.exe和wmic.exe),攻击者的行为看起来与正常的系统操作没有显著区别。通过链式调用系统管理工具,将恶意操作拆解为多个符合运维场景的合法步骤,规避基于单进程异常行为的检测规则。

Procedure Examples

ID Name Description
S0373 Astaroth

Astaroth executes embedded JScript or VBScript in an XSL stylesheet located on a remote domain. [1]

G0080 Cobalt Group

Cobalt Group used msxsl.exe to bypass AppLocker and to invoke Jscript code from an XSL file.[2]

G0126 Higaisa

Higaisa used an XSL file to run VBScript code.[3]

C0022 Operation Dream Job

During Operation Dream Job, Lazarus Group used a remote XSL script to download a Base64-encoded DLL custom downloader.[4]

Mitigations

ID Mitigation Description
M1038 Execution Prevention

If msxsl.exe is unnecessary, then block its execution to prevent abuse by adversaries.

Detection

ID Data Source Data Component Detects
DS0011 Module Module Load

Monitor DLL/PE file events, specifically creation of these binary files as well as the loading of DLLs into processes. Look for DLLs that are not recognized or not normally loaded into a process.

DS0009 Process Process Creation

Use process monitoring to monitor the execution and arguments of msxsl.exe and wmic.exe. [5] [6] Command arguments used before and after the script invocation may also be useful in determining the origin and purpose of the payload being loaded. The presence of msxsl.exe or other utilities that enable proxy execution that are typically used for development, debugging, and reverse engineering on a system that is not used for these purposes may be suspicious.

References