T1059.001 PowerShell

Adversaries may abuse PowerShell commands and scripts for execution. PowerShell is a powerful interactive command-line interface and scripting environment included in the Windows operating system.(Citation: TechNet PowerShell) Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code. Examples include the <code>Start-Process</code> cmdlet which can be used to run an executable and the <code>Invoke-Command</code> cmdlet which runs a command locally or on a remote computer (though administrator permissions are required to use PowerShell to connect to remote systems).

PowerShell may also be used to download and run executables from the Internet, which can be executed from disk or in memory without touching disk.

A number of PowerShell-based offensive testing tools are available, including Empire, PowerSploit, PoshC2, and PSAttack.(Citation: Github PSAttack)

PowerShell commands/scripts can also be executed without directly invoking the <code>powershell.exe</code> binary through interfaces to PowerShell's underlying <code>System.Management.Automation</code> assembly DLL exposed through the .NET framework and Windows Common Language Interface (CLI).(Citation: Sixdub PowerPick Jan 2016)(Citation: SilentBreak Offensive PS Dec 2015)(Citation: Microsoft PSfromCsharp APR 2014)

View in MITRE ATT&CK®

CRI Profile Mappings

Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
DE.AE-02.01 Event analysis and detection Mitigates T1059.001 PowerShell
Comments
This diagnostic statement provides for implementation of methods to block similar future attacks via security tools such as antivirus and IDS/IPS to provide protection against threats and exploitation attempts.
References
    PR.IR-01.08 End-user device access Mitigates T1059.001 PowerShell
    Comments
    This diagnostic statement implements technical controls (e.g., VPN, antivirus software) to address the risks of end-user personal computing devices accessing the organization’s network and resources.
    References
      PR.PS-01.01 Configuration baselines Mitigates T1059.001 PowerShell
      Comments
      This diagnostic statement provides for securely configuring production systems. This includes hardening default configurations and making security-focused setting adjustments to reduce the attack surface, enforce best practices, and protect sensitive data thereby mitigating adversary exploitation.
      References
        PR.AA-05.02 Privileged system access Mitigates T1059.001 PowerShell
        Comments
        This diagnostic statement protects against PowerShell through the use of privileged account management and the use of multi-factor authentication.
        References
          DE.CM-09.01 Software and data integrity checking Mitigates T1059.001 PowerShell
          Comments
          This diagnostic statement protects against PowerShell through the use of verifying integrity of software/firmware, loading software that is trusted, ensuring privileged process integrity and checking software signatures.
          References
            DE.CM-06.02 Third-party access monitoring Mitigates T1059.001 PowerShell
            Comments
            This diagnostic statement protects against PowerShell through the use of privileged account management. Employing auditing, privilege access management, and just in time access protects against adversaries trying to obtain illicit access to critical systems.
            References
              PR.PS-05.01 Malware prevention Mitigates T1059.001 PowerShell
              Comments
              Antivirus/Antimalware software can be utilized to detect and quarantine files that have been embedded with malicious commands or scripts.
              References
                PR.PS-01.03 Configuration deviation Mitigates T1059.001 PowerShell
                Comments
                This diagnostic statement provides protection from Command and Scripting Interpreter through the implementation of security configuration baselines for OS, software, file integrity monitoring and imaging. Security baselining along with disallowing scripts and integrity checking can help protect against adversaries that may abuse command and script interpreters.
                References
                  PR.PS-05.02 Mobile code prevention Mitigates T1059.001 PowerShell
                  Comments
                  Mobile code procedures address specific actions taken to prevent the development, acquisition, and introduction of unacceptable mobile code within organizational systems, including requiring mobile code to be digitally signed by a trusted source.
                  References
                    PR.IR-01.06 Production environment segregation Mitigates T1059.001 PowerShell
                    Comments
                    This diagnostic statement provides protections for production environments. Measures such as network segmentation and access control reduce the attack surface, restrict movement by adversaries, and protect critical assets and data from compromise.
                    References
                      PR.PS-01.08 End-user device protection Mitigates T1059.001 PowerShell
                      Comments
                      This diagnostic statement protects against PowerShell through the use of limiting access to resources to only authorized devices, management of personal computing devices, network intrusion prevention, and the use of antimalware.
                      References

                        NIST 800-53 Mappings

                        Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                        CM-06 Configuration Settings mitigates T1059.001 PowerShell
                        CM-05 Access Restrictions for Change mitigates T1059.001 PowerShell
                        AC-17 Remote Access mitigates T1059.001 PowerShell
                        IA-09 Service Identification and Authentication mitigates T1059.001 PowerShell
                        IA-08 Identification and Authentication (Non-Organizational Users) mitigates T1059.001 PowerShell
                        SI-16 Memory Protection mitigates T1059.001 PowerShell
                        SI-02 Flaw Remediation mitigates T1059.001 PowerShell
                        RA-05 Vulnerability Monitoring and Scanning mitigates T1059.001 PowerShell
                        CM-08 System Component Inventory mitigates T1059.001 PowerShell
                        SI-10 Information Input Validation mitigates T1059.001 PowerShell
                        SI-03 Malicious Code Protection mitigates T1059.001 PowerShell
                        SI-07 Software, Firmware, and Information Integrity mitigates T1059.001 PowerShell
                        CM-02 Baseline Configuration mitigates T1059.001 PowerShell
                        IA-02 Identification and Authentication (Organizational Users) mitigates T1059.001 PowerShell
                        SI-04 System Monitoring mitigates T1059.001 PowerShell
                        AC-02 Account Management mitigates T1059.001 PowerShell
                        AC-03 Access Enforcement mitigates T1059.001 PowerShell
                        AC-05 Separation of Duties mitigates T1059.001 PowerShell
                        AC-06 Least Privilege mitigates T1059.001 PowerShell

                        Known Exploited Vulnerabilities Mappings

                        Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                        CVE-2022-41082 Microsoft Exchange Server Remote Code Execution Vulnerability primary_impact T1059.001 PowerShell
                        Comments
                        This vulnerability is exploited by a remote adversary who has either authenticated to a Microsoft Exchange Server or has gained access to PowerShell prior to leveraging this vulnerability. The adversary then performs remote code execution via PowerShell to install a Chopper web shell to perform Active Directory reconnaissance and data exfiltration.
                        References
                        CVE-2022-41082 Microsoft Exchange Server Remote Code Execution Vulnerability exploitation_technique T1059.001 PowerShell
                        Comments
                        This vulnerability is exploited by a remote adversary who has either authenticated to a Microsoft Exchange Server or has gained access to PowerShell prior to leveraging this vulnerability. The adversary then performs remote code execution via PowerShell to install a Chopper web shell to perform Active Directory reconnaissance and data exfiltration.
                        References

                        VERIS Mappings

                        Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                        action.hacking.variety.Abuse of functionality Abuse of functionality. related-to T1059.001 PowerShell

                        Azure Mappings

                        Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                        microsoft_sentinel Microsoft Sentinel technique_scores T1059.001 PowerShell
                        Comments
                        The Microsoft Sentinel Analytics "Powershell Empire cmdlets seen in command line" query can identify use of Empire, which leverages PowerShell for the majority of its client-side agent tasks and can conduct PowerShell remoting. The coverage for these queries is minimal (specific to Empire) resulting in an overall Minimal score.
                        References
                        alerts_for_windows_machines Alerts for Windows Machines technique_scores T1059.001 PowerShell
                        Comments
                        This control may detect suspicious usage of PowerShell and the Windows command line. These detections include usage of suspicious arguments, dynamic script construction, and shellcode on the commandline. The following alerts may be generated: "Detected anomalous mix of upper and lower case characters in command-line", "Detected encoded executable in command line data", "Detected obfuscated command line", "Detected suspicious combination of HTA and PowerShell", "Detected suspicious commandline arguments", "Detected suspicious commandline used to start all executables in a directory", "Detected suspicious credentials in commandline", "Dynamic PS script construction", "Suspicious PowerShell Activity Detected", "Suspicious PowerShell cmdlets executed", "Suspicious command execution".
                        References
                        defender_for_app_service Microsoft Defender for Cloud: Defender for App Service technique_scores T1059.001 PowerShell
                        Comments
                        This control monitors for execution of known malicious PowerShell PowerSploit cmdlets. Temporal factor is uknown.
                        References

                        AWS Mappings

                        Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                        aws_web_application_firewall AWS Web Application Firewall technique_scores T1059.001 PowerShell
                        Comments
                        The AWS WAF protects web applications from injection attacks that leverage command and scripting interpreters. AWS WAF provides this protection via the following rule sets that block malicious traffic across a variety of operating systems and applications. AWSManagedRulesCommonRuleSet AWSManagedRulesSQLiRuleSet AWSManagedRulesUnixRuleSet AWSManagedRulesWindowsRuleSet AWSManagedRulesPHPRuleSet AWSManagedRulesWordPressRuleSet This is given a score of Significant because it provides protections for PowerShell, Unix, and JavaScript command and scripting interpreters by blocking the malicious content in near real-time.
                        References

                          M365 Mappings

                          Capability ID Capability Description Mapping Type ATT&CK ID ATT&CK Name Notes
                          DEF-ID-E5 Microsoft Defender for Identity Technique Scores T1059.001 PowerShell
                          Comments
                          This control's "Remote code execution attempt (external ID 2019)" alert can detect Remote code execution via Powershell. This may lead to false positives as administrative workstations, IT team members, and service accounts can all perform legitimate administrative tasks against domain controllers. Additionally, this alert seems to be specific to detecting execution on domain controllers and AD FS servers, limiting its coverage.
                          References
                            EOP-AMW-E3 Antimalware Technique Scores T1059.001 PowerShell
                            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
                            DEF-ZHAP-E3 Zero Hour Auto Purge Technique Scores T1059.001 PowerShell
                            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