Adversaries may abuse Lua commands and scripts for execution. Lua is a cross-platform scripting and programming language primarily designed for embedded use in applications. Lua can be executed on the command-line (through the stand-alone lua interpreter), via scripts (.lua), or from Lua-embedded programs (through the struct lua_State).[1][2]
Lua scripts may be executed by adversaries for malicious purposes. Adversaries may incorporate, abuse, or replace existing Lua interpreters to allow for malicious Lua command execution at runtime.[3][4][5][6]
| ID | Name | Description |
|---|---|---|
| S0396 | EvilBunny | |
| S1188 | Line Runner |
Line Runner utilizes Lua scripts for command execution.[7][8] |
| S0428 | PoetRAT |
PoetRAT has executed a Lua script through a Lua interpreter for Windows.[9] |
| S1240 | RedLine Stealer |
RedLine Stealer malware has leveraged Lua bytecode to perform malicious behavior.[10] |
| S0125 | Remsec |
| ID | Mitigation | Description |
|---|---|---|
| M1047 | Audit |
Inventory systems for unauthorized Lua installations. |
| M1038 | Execution Prevention |
Denylist Lua interpreters where appropriate. |
| M1033 | Limit Software Installation |
Prevent users from installing Lua where not required. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0101 | Detection Strategy for Lua Scripting Abuse | AN0278 |
Detects execution of Lua interpreters or scripts (.lua), especially when correlated with suspicious parent processes or file drop events, indicating malicious use of embedded scripting. |
| AN0279 |
Detects invocation of lua or luajit interpreters by users or services outside of expected packages, chained with script drop or memory artifacts. |
||
| AN0280 |
Detects Lua script execution via native or 3rd party interpreters, chained with unsigned binaries or unexpected parent lineage. |
||
| AN0281 |
Detects embedded Lua interpreter execution or script injection on devices supporting Lua scripting (e.g., routers, firewalls), often seen in modified firmware or abused APIs. |