Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries. These interfaces and languages provide ways of interacting with computer systems and are a common feature across many different platforms. Most systems come with some built-in command-line interface and scripting capabilities, for example, macOS and Linux distributions include some flavor of Unix Shell while Windows installations include the Windows Command Shell and PowerShell.
There are also cross-platform interpreters such as Python, as well as those commonly associated with client applications such as JavaScript and Visual Basic.
Adversaries may abuse these technologies in various ways as a means of executing arbitrary commands. Commands and scripts can be embedded in Initial Access payloads delivered to victims as lure documents or as secondary payloads downloaded from an existing C2. Adversaries may also execute commands through interactive terminals/shells, as well as utilize various Remote Services in order to achieve remote Execution.(Citation: Powershell Remote Commands)(Citation: Cisco IOS Software Integrity Assurance - Command History)(Citation: Remote Shell Execution in Python)
T1059「Command and Scripting Interpreter」(コマンドとスクリプトのインタープリター) は、攻撃者がシステムを操作するために、OSに標準搭載されているコマンドラインやスクリプト環境を悪用する手法です。
この手法は非常に汎用的で、ほぼすべての攻撃フェーズ(偵察、実行、永続化、横展開など)で使用される「攻撃のエンジン」といえます。
この手法で攻撃者は、「既存の正規ツールを用いた、自由度の高い命令実行」を実現します。
T1059は、使用される環境によって多くのサブテクニックに分かれています。
cmd.exe。バッチファイル(.bat)などを実行します。bash や sh。シェルスクリプトを悪用します。VBScript や WSH。Officeマクロなどと組み合わされます。JScript や、ブラウザを介した実行。攻撃者はフィッシングメールや脆弱性悪用を通じて、これらのインタープリターにアクセスします。
powershell.exe や cmd.exe が起動するように仕込みます。powershell.exe -EncodedCommand [長い文字列]「正規ツール」を止めることは難しいため、その「使い方」を監視・制限する必要があります。
ExecutionPolicy を AllSigned などに設定し、署名のないスクリプトを実行不可にします。office.exe が cmd.exe を起動するといった「不自然な親子関係」を検知し、即座に遮断します。現代の攻撃のほとんどは T1059(特にPowerShell)を経由します。管理者が普段使わないような難読化された長いコマンドライン引数は、それだけで「侵害の証拠(IoC)」として扱うべきです。
この攻撃手法に関連する CVE は登録されていません。