命令与脚本解释器滥用是指攻击者利用系统内置或常见的脚本环境执行恶意代码,其通过混淆代码逻辑、劫持合法进程、规避安全监控等手段实施攻击。传统防御手段侧重于监控异常进程创建、检测已知恶意脚本特征、限制非授权解释器执行等,通过日志审计与行为分析识别可疑的脚本活动。
为对抗日益增强的检测能力,攻击者发展出多维度的匿迹执行技术,通过消除磁盘痕迹、融合合法行为、动态变异特征等策略,将恶意脚本操作隐匿于系统正常活动中,形成"无特征、无驻留、无告警"的新型攻击范式。
当前匿迹技术的共性在于重构脚本执行的时空特征与上下文环境:内存驻留技术彻底规避磁盘审计,通过解释器运行时实现零接触攻击;工具链调用将恶意意图分散至多个合规工具,破坏单点行为关联分析;动态混淆与反射加载形成代码特征的持续变异,突破静态检测的防护边界;低频触发机制则利用系统运维节奏掩盖恶意周期;进程注入技术通过执行环境伪装实现权限隐身。这些技术通过分层隐匿架构,在代码形态、执行载体、行为模式、时序特征等维度构建多重混淆,使得传统基于规则匹配或单一维度异常检测的防御体系面临严峻挑战。
匿迹技术的演进迫使防御体系向多维行为建模转型,需加强内存取证、上下文关联分析、跨进程行为追踪等能力,构建解释器运行时完整性保护机制,并引入AI驱动的异常脚本模式识别技术,实现对隐蔽脚本攻击的全生命周期防护。
| 效应类型 | 是否存在 |
|---|---|
| 特征伪装 | ✅ |
| 行为透明 | ❌ |
| 数据遮蔽 | ✅ |
| 时空释痕 | ✅ |
攻击者通过动态代码混淆、合法工具滥用等手段,使恶意脚本在语法结构和行为特征上模仿合法管理脚本。例如将恶意PowerShell命令嵌入正常的系统管理流程,或使用常见运维工具链传递攻击载荷,使得恶意操作在日志审计中呈现为合规的系统维护行为。
采用内存加密加载和反射注入技术,恶意脚本在传输和执行过程中始终以密文或编码形式存在(如Base64编码的PowerShell命令),关键攻击指令仅在内存中解密执行。这导致基于网络流量分析或磁盘文件扫描的检测手段难以获取可识别的明文特征。
通过低频触发和时序伪装策略,将恶意脚本的执行周期与系统合法任务同步(如每月维护窗口),并将单次攻击动作控制在极短时间内完成。同时利用跨地域代理节点分发执行指令,使得攻击痕迹分散在长时间跨度和多进程环境中,破坏防御系统的关联分析能力。
| ID | Name | Description |
|---|---|---|
| G0073 | APT19 | |
| G0050 | APT32 |
APT32 has used COM scriptlets to download Cobalt Strike beacons.[2] |
| G0067 | APT37 | |
| G0087 | APT39 |
APT39 has utilized custom scripts to perform internal reconnaissance.[4][5] |
| S0234 | Bandook |
Bandook can support commands to execute Java-based payloads.[6] |
| S0486 | Bonadan |
Bonadan can create bind and reverse shells on the infected system.[7] |
| S0023 | CHOPSTICK |
CHOPSTICK is capable of performing remote command execution.[8][9] |
| C0029 | Cutting Edge |
During Cutting Edge, threat actors used Perl scripts to enable the deployment of the THINSPOOL shell script dropper and for enumerating host data.[10][11] |
| S0334 | DarkComet |
DarkComet can execute various types of scripts on the victim’s machine.[12] |
| S0695 | Donut |
Donut can generate shellcode outputs that execute via Ruby.[13] |
| G0035 | Dragonfly | |
| S0363 | Empire |
Empire uses a command-line interface to interact with systems.[15] |
| G0053 | FIN5 |
FIN5 scans processes on all victim systems in the environment and uses automated scripts to pull back the results.[16] |
| G0037 | FIN6 |
FIN6 has used scripting to iterate through a list of compromised PoS systems, copy data to a log file, and remove the original data files.[17][18] |
| G0046 | FIN7 |
FIN7 used SQL scripts to help perform tasks on the victim's machine.[19][20][19] |
| S0618 | FIVEHANDS |
FIVEHANDS can receive a command line argument to limit file encryption to specified directories.[21][22] |
| G0117 | Fox Kitten |
Fox Kitten has used a Perl reverse shell to communicate with C2.[23] |
| S0460 | Get2 |
Get2 has the ability to run executables with command-line arguments.[24] |
| S0032 | gh0st RAT |
gh0st RAT is able to open a remote shell to execute commands.[25][26] |
| S0434 | Imminent Monitor |
Imminent Monitor has a CommandPromptPacket and ScriptPacket module(s) for creating a remote shell and executing scripts.[27] |
| G0004 | Ke3chang |
Malware used by Ke3chang can run commands on the command-line interface.[28][29] |
| S0487 | Kessel |
Kessel can create a reverse shell between the infected host and a specified system.[7] |
| S0167 | Matryoshka |
Matryoshka is capable of providing Meterpreter shell access.[30] |
| G0049 | OilRig |
OilRig has used various types of scripting for execution.[31][32][33][34][35] |
| C0005 | Operation Spalax |
For Operation Spalax, the threat actors used Nullsoft Scriptable Install System (NSIS) scripts to install malware.[36] |
| S0598 | P.A.S. Webshell |
P.A.S. Webshell has the ability to create reverse shells with Perl scripts.[37] |
| S1130 | Raspberry Robin |
Raspberry Robin variants can be delivered via highly obfuscated Windows Script Files (WSF) for initial execution.[38] |
| G1031 | Saint Bear |
Saint Bear has used the Windows Script Host (wscript) to execute intermediate files written to victim machines.[39] |
| S1110 | SLIGHTPULSE |
SLIGHTPULSE contains functionality to execute arbitrary commands passed to it.[40] |
| S0374 | SpeakUp | |
| G0038 | Stealth Falcon |
Stealth Falcon malware uses WMI to script data collection and command execution on the victim.[42] |
| S1154 | VersaMem |
VersaMem was delivered as a Java Archive (JAR) that runs by attaching itself to the Apache Tomcat Java servlet and web server.[43] |
| G0107 | Whitefly |
Whitefly has used a simple remote shell tool that will call back to the C2 server and wait for commands.[44] |
| G0124 | Windigo |
Windigo has used a Perl script for information gathering.[7] |
| S0219 | WINERACK |
WINERACK can create a reverse shell that utilizes statically-linked Wine cmd.exe code to emulate Windows command prompt commands.[45] |
| G1035 | Winter Vivern |
Winter Vivern used XLM 4.0 macros for initial code execution for malicious document files.[46] |
| S1151 | ZeroCleare |
ZeroCleare can receive command line arguments from an operator to corrupt the file system using the RawDisk driver.[47] |
| S0330 | Zeus Panda |
Zeus Panda can launch remote scripts on the victim’s machine.[48] |
| ID | Mitigation | Description |
|---|---|---|
| M1049 | Antivirus/Antimalware |
Anti-virus can be used to automatically quarantine suspicious files. |
| M1047 | Audit |
Inventory systems for unauthorized command and scripting interpreter installations. |
| M1040 | Behavior Prevention on Endpoint |
On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent Visual Basic and JavaScript scripts from executing potentially malicious downloaded content [49]. |
| M1045 | Code Signing |
Where possible, only permit execution of signed scripts. |
| M1042 | Disable or Remove Feature or Program |
Disable or remove any unnecessary or unused shells or interpreters. |
| M1038 | Execution Prevention |
Use application control where appropriate. For example, PowerShell Constrained Language mode can be used to restrict access to sensitive or otherwise dangerous language elements such as those used to execute arbitrary Windows APIs or files (e.g., |
| M1033 | Limit Software Installation |
Prevent user installation of unrequired command and scripting interpreters. |
| M1026 | Privileged Account Management |
When PowerShell is necessary, consider restricting PowerShell execution policy to administrators. Be aware that there are methods of bypassing the PowerShell execution policy, depending on environment configuration.[51] PowerShell JEA (Just Enough Administration) may also be used to sandbox administration and limit what commands admins/users can execute through remote PowerShell sessions.[52] |
| M1021 | Restrict Web-Based Content |
Script blocking extensions can help prevent the execution of scripts and HTA files that may commonly be used during the exploitation process. For malicious code served up through ads, adblockers can help prevent that code from executing in the first place. |
| ID | Data Source | Data Component | Detects |
|---|---|---|---|
| DS0017 | Command | Command Execution |
Monitor command-line arguments for script execution and subsequent behavior. Actions may be related to network and system information Discovery, Collection, or other scriptable post-compromise behaviors and could be used as indicators of detection leading back to the source script. Scripts are likely to perform actions with various effects on a system that may generate events, depending on the types of monitoring used. Analytic 1 - Suspicious script execution
|
| DS0011 | Module | Module Load |
Monitor for events associated with scripting execution, such as the loading of modules associated with scripting languages (ex: JScript.dll or vbscript.dll). Analytic 1 - Look for unusual module loads associated with scripting languages.
|
| DS0009 | Process | Process Creation |
Monitor log files for process execution through command-line and scripting activities. This information can be useful in gaining additional insight to adversaries' actions through how they use native processes or custom tools. Also monitor for loading of modules associated with specific languages. Analytic 1 - Look for unusual command and scripting process creation.
|
| Process Metadata |
Monitor contextual data about a running process, which may include information such as environment variables, image name, user/owner, or other information that may reveal abuse of system features. For example, consider monitoring for Windows Event ID (EID) 400, which shows the version of PowerShell executing in the |
||
| DS0012 | Script | Script Execution |
Monitor for any attempts to enable scripts running on a system that would be considered suspicious. If scripts are not commonly used on a system, but enabled, scripts running out of cycle from patching or other administrator functions are suspicious. Scripts should be captured from the file system when possible to determine their actions and intent. Analytic 1 - Look for attempts to enable scripts on the system.
|