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)
View in MITRE ATT&CK®Capability ID | Capability Description | Mapping Type | ATT&CK ID | ATT&CK Name | Notes |
---|---|---|---|---|---|
AC-17 | Remote Access | Protects | T1059 | Command and Scripting Interpreter | |
AC-02 | Account Management | Protects | T1059 | Command and Scripting Interpreter | |
AC-03 | Access Enforcement | Protects | T1059 | Command and Scripting Interpreter | |
AC-05 | Separation of Duties | Protects | T1059 | Command and Scripting Interpreter | |
AC-06 | Least Privilege | Protects | T1059 | Command and Scripting Interpreter | |
CA-07 | Continuous Monitoring | Protects | T1059 | Command and Scripting Interpreter | |
CA-08 | Penetration Testing | Protects | T1059 | Command and Scripting Interpreter | |
CM-11 | User-installed Software | Protects | T1059 | Command and Scripting Interpreter | |
CM-02 | Baseline Configuration | Protects | T1059 | Command and Scripting Interpreter | |
CM-05 | Access Restrictions for Change | Protects | T1059 | Command and Scripting Interpreter | |
CM-06 | Configuration Settings | Protects | T1059 | Command and Scripting Interpreter | |
CM-07 | Least Functionality | Protects | T1059 | Command and Scripting Interpreter | |
CM-08 | System Component Inventory | Protects | T1059 | Command and Scripting Interpreter | |
IA-02 | Identification and Authentication (organizational Users) | Protects | T1059 | Command and Scripting Interpreter | |
IA-08 | Identification and Authentication (non-organizational Users) | Protects | T1059 | Command and Scripting Interpreter | |
IA-09 | Service Identification and Authentication | Protects | T1059 | Command and Scripting Interpreter | |
RA-05 | Vulnerability Monitoring and Scanning | Protects | T1059 | Command and Scripting Interpreter | |
SC-18 | Mobile Code | Protects | T1059 | Command and Scripting Interpreter | |
SI-10 | Information Input Validation | Protects | T1059 | Command and Scripting Interpreter | |
SI-16 | Memory Protection | Protects | T1059 | Command and Scripting Interpreter | |
SI-02 | Flaw Remediation | Protects | T1059 | Command and Scripting Interpreter | |
SI-03 | Malicious Code Protection | Protects | T1059 | Command and Scripting Interpreter | |
SI-04 | System Monitoring | Protects | T1059 | Command and Scripting Interpreter | |
SI-07 | Software, Firmware, and Information Integrity | Protects | T1059 | Command and Scripting Interpreter | |
PUR-AS-E5 | Audit Solutions | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
Microsoft Purview auditing solutions provide an integrated solution to help organizations effectively respond to security events, forensic investigations, internal investigations, and compliance obligations. Thousands of user and admin operations performed in dozens of Microsoft 365 services and solutions are captured, recorded, and retained in your organization's unified audit log. Audit records for these events are searchable by security ops, IT admins, insider risk teams, and compliance and legal investigators in your organization. This capability provides visibility into the activities performed across your Microsoft 365 organization.
Microsoft's Audit Solutions detects Command and Scripting Interpreter attacks due to Audit Solutions providing the visibility to monitor log files for process execution and monitor contextual data about a running process.
License Requirements:
Microsoft 365 E3 and E5
References
|
EOP-Antimalware-E3 | Antimalware | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
In Microsoft 365 organizations with mailboxes in Exchange Online or standalone Exchange Online Protection (EOP) organizations without Exchange Online mailboxes, email messages are automatically protected against malware by EOP. Some of the major categories of malware are:
Viruses that infect other programs and data, and spread through your computer or network looking for programs to infect.
Spyware that gathers your personal information, such as sign-in information and personal data, and sends it back to its author.
Ransomware that encrypts your data and demands payment to decrypt it. Anti-malware software doesn't help you decrypt encrypted files, but it can detect the malware payload that's associated with the ransomware.
EOP offers multi-layered malware protection that's designed to catch all known malware in Windows, Linux, and Mac that travels into or out of your organization. The following options help provide anti-malware protection:
Layered defenses against malware: Multiple anti-malware scan engines help protect against both known and unknown threats. These engines include powerful heuristic detection to provide protection even during the early stages of a malware outbreak. This multi-engine approach has been shown to provide significantly more protection than using just one anti-malware engine.
Real-time threat response: During some outbreaks, the anti-malware team might have enough information about a virus or other form of malware to write sophisticated policy rules that detect the threat, even before a definition is available from any of the scan engines used by the service. These rules are published to the global network every 2 hours to provide your organization with an extra layer of protection against attacks.
Fast anti-malware definition deployment: The anti-malware team maintains close relationships with partners who develop anti-malware engines. As a result, the service can receive and integrate malware definitions and patches before they're publicly released. Our connection with these partners often allows us to develop our own remedies as well. The service checks for updated definitions for all anti-malware engines every hour.
License Requirements: M365 E3 or Microsoft Defender for Office plan 1.
References
|
ME-RBAC-E3 | Role Based Access Control | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
The RBAC control can be used to partially protect against the abuse of Cloud APIs but does not provide protection against this technique's other sub-techniques or other example procedures. Due to its Minimal coverage score, it receives a score of minimal.
License Requirements:
ME-ID Built-in Roles (Free)
References
|
M365-DEF-ZAP-E3 | Zero Hour Auto Purge | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
Zero-hour auto purge (ZAP) is a protection feature in Exchange Online Protection (EOP) that retroactively detects and neutralizes malicious phishing, spam, or malware messages that have already been delivered to Exchange Online mailboxes. With the E5 licensing or Office Plan 2, ZAP is also able to retroactively detect existing malicious chat messages in Microsoft Teams that are identified as malware or high confidence phishing.
License Requirements: ZAP for Defender O365 is included with M365's E3 and requires E5 when leveraging ZAP for Teams security.
References
|
DEF-IR-E5 | Incident Response | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
An incident in Microsoft Defender XDR is a collection of correlated alerts and associated data that make up the story of an attack. Microsoft 365 services and apps create alerts when they detect a suspicious or malicious event or activity. Individual alerts provide valuable clues about a completed or ongoing attack. Attacks typically employ various techniques against different types of entities, such as devices, users, and mailboxes. The result of this is multiple alerts for multiple entities in your tenant. Piecing the individual alerts together to gain insight into an attack can be challenging and time-consuming, Microsoft Defender XDR automatically aggregates the alerts and their associated information into an incident. A typical Incident Response workflow in Microsoft Defender XDR begins with a triage action, next is the investigate action, and finally is the response action.
Microsoft 365 Defender Incident Response responds to Command and Scripting Interpreter attacks due to Incident Response monitoring for reconnaissance and discovery alerts which monitors for subsequent behavior related to discovery.
License Requirements:
Microsoft Defender XDR
References
|
PUR-PAM-E5 | Privileged Access Management | Technique Scores | T1059 | Command and Scripting Interpreter |
Comments
Microsoft Purview Privileged Access Management allows granular access control over privileged admin tasks in Office 365. It can help protect your organization from breaches that use existing privileged admin accounts with standing access to sensitive data or access to critical configuration settings. Privileged access management requires users to request just-in-time access to complete elevated and privileged tasks through a highly scoped and time-bounded approval workflow. This configuration gives users just-enough-access to perform the task at hand, without risking exposure of sensitive data or critical configuration settings. Microsoft 365 configuration settings. When used with Microsoft Entra Privileged Identity Management, these two features provide access control with just-in-time access at different scopes. (e.g., Encryption, RBAC, Conditional Access, JIT, Just Enough Access (with Approval).
License requirements: M365 E5 customers.
References
|
Technique ID | Technique Name | Number of Mappings |
---|---|---|
T1059.007 | JavaScript | 16 |
T1059.002 | AppleScript | 16 |
T1059.009 | Cloud API | 14 |
T1059.008 | Network Device CLI | 15 |
T1059.001 | PowerShell | 21 |
T1059.004 | Unix Shell | 11 |
T1059.006 | Python | 17 |
T1059.003 | Windows Command Shell | 11 |
T1059.005 | Visual Basic | 17 |