|T1059.003||Windows Command Shell|
|T1059.008||Network Device CLI|
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. Adversaries can use PowerShell to perform a number of actions, including discovery of information and execution of code. Examples include the
Start-Process cmdlet which can be used to run an executable and the
Invoke-Command 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.
PowerShell commands/scripts can also be executed without directly invoking the
powershell.exe binary through interfaces to PowerShell's underlying
System.Management.Automation assembly DLL exposed through the .NET framework and Windows Common Language Interface (CLI).
|C0025||2016 Ukraine Electric Power Attack||
During the 2016 Ukraine Electric Power Attack, Sandworm Team used PowerShell scripts to run a credential harvesting tool in memory to evade defenses.
AADInternals is written and executed via PowerShell.
AppleSeed has the ability to execute its payload via PowerShell.
APT28 downloads and executes PowerShell scripts and performs PowerShell commands.
APT29 has used encoded PowerShell scripts uploaded to CozyCar installations to download and install SeaDuke.
APT3 has used PowerShell on victim systems to download and run payloads after exploitation.
APT32 has used PowerShell-based tools, PowerShell one-liners, and shellcode loaders for execution.
APT33 has utilized PowerShell to download files from the C2 server and run various scripts. 
APT38 has used PowerShell to execute commands and other operational tasks.
APT39 has used PowerShell to execute malicious code.
APT41 leveraged PowerShell to deploy malware families in victims’ environments.
Aquatic Panda has downloaded additional scripts and executed Base64 encoded commands in PowerShell.
AutoIt backdoor downloads a PowerShell script that decodes to a typical shellcode loader.
Bandook has used PowerShell loaders as part of execution.
Bazar can execute a PowerShell script received from C2.
Black Basta has used PowerShell scripts for discovery and to execute files over the network.
BloodHound can use PowerShell to pull Active Directory information from the target environment.
Blue Mockingbird has used PowerShell reverse TCP shells to issue interactive commands over a network connection.
BONDUPDATER is written in PowerShell.
BRONZE BUTLER has used PowerShell for execution.
During C0018, the threat actors used encoded PowerShell scripts for execution.
During C0021, the threat actors used obfuscated PowerShell to extract an encoded payload from within an .LNK file.
CharmPower can use PowerShell for payload execution and C2 communication.
Chimera has used PowerShell scripts to execute malicious payloads and the DSInternals PowerShell module to make use of Active Directory features.
The Clambling dropper can use PowerShell to download the malware.
Cobalt Group has used powershell.exe to download and execute scripts.
Cobalt Strike can execute a payload on a remote host with PowerShell. This technique does not write any data to disk. Cobalt Strike can also use PowerSploit and other scripting frameworks to perform execution.
ComRAT has used PowerShell to load itself every time a user logs in to the system. ComRAT can execute PowerShell scripts loaded into memory or from the file system.
Confucius has used PowerShell to execute malicious files and payloads.
ConnectWise can be used to execute PowerShell commands on target machines.
CopyKittens has used PowerShell Empire.
CrackMapExec can execute PowerShell commands via WMI.
CreepyDrive can use Powershell for execution, including the cmdlets
CreepySnail can use PowerShell for execution, including the cmdlets
Cuba has been dropped onto systems and used for lateral movement via obfuscated PowerShell scripts.
DarkHydrus leveraged PowerShell to download and execute additional scripts for execution.
DarkVishnya used PowerShell to create shellcode loaders.
DarkWatchman can execute PowerShell commands and has used PowerShell to execute a keylogger.
Deep Panda has used PowerShell scripts to download and execute programs in memory, without writing to disk.
Donut can generate shellcode outputs that execute via PowerShell.
Dragonfly has used PowerShell scripts for execution.
Earth Lusca has used PowerShell to execute commands.
Egregor has used an encoded PowerShell command by a service created by Cobalt Strike for lateral movement.
Ember Bear has used PowerShell to download and execute malicious code.
Emotet has used Powershell to retrieve the malicious payload and download additional resources like Mimikatz. 
Empire leverages PowerShell for the majority of its client-side agent tasks. Empire also contains the ability to conduct PowerShell remoting with the
FIN10 uses PowerShell for execution as well as PowerShell Empire to establish persistence.
FIN6 has used PowerShell to gain access to merchant's networks, and a Metasploit PowerShell module to download and execute shellcode and to set up a local listener.
FIN7 used a PowerShell script to launch shellcode that retrieved an additional payload.
FIN8's malicious spearphishing payloads are executed as PowerShell. FIN8 has also used PowerShell for lateral movement and credential access.
FlawedAmmyy has used PowerShell to execute commands.
Fox Kitten has used PowerShell scripts to access credential data.
During Frankenstein, the threat actors used PowerShell to run a series of Base64-encoded commands that acted as a stager and enumerated hosts.
GALLIUM used PowerShell for execution to assist in lateral movement as well as for dumping credentials stored on compromised machines.
Gallmaker used PowerShell to download additional payloads and for execution.
Gamaredon Group has used obfuscated PowerShell scripts for staging.
GOLD SOUTHFIELD has staged and executed PowerShell scripts on compromised hosts.
Gorgon Group malware can use PowerShell commands to download and execute a payload and open a decoy document on the victim’s machine.
GRIFFON has used PowerShell to execute the Meterpreter downloader TinyMet.
HAFNIUM has used the Exchange Power Shell module
HAMMERTOSS is known to use PowerShell.
HEXANE has used PowerShell-based tools and scripts for discovery and collection on compromised hosts.
Inception has used PowerShell to execute malicious commands and payloads.
Indrik Spider has used PowerShell Empire for execution of malware.
JSS Loader has the ability to download and execute PowerShell scripts.
KeyBoy uses PowerShell commands to download and execute payloads.
KGH_SPY can execute PowerShell commands on the victim's machine.
Kimsuky has executed a variety of PowerShell scripts.
KOCTOPUS has used PowerShell commands to download additional files.
KONNI used PowerShell to download and execute a specific 64-bit version of the malware.
Lazarus Group has used PowerShell to execute commands and malicious code.
LazyScripter has used PowerShell scripts to execute malicious code.
Leviathan has used PowerShell for execution.
LitePower can use a PowerShell script to execute commands.
Lokibot has used PowerShell commands embedded inside batch scripts.
Mafalda can execute PowerShell commands on a compromised machine.
Magic Hound has used PowerShell for execution and privilege escalation.
menuPass uses PowerSploit to inject shellcode into PowerShell.
Meteor can use PowerShell commands to disable the network adapters on a victim machines.
MuddyWater has used PowerShell for execution.
Mustang Panda has used malicious PowerShell scripts to enable execution.
Netwalker has been written in PowerShell and executed directly in memory, avoiding detection.
The NETWIRE binary has been executed via PowerShell script.
njRAT has executed PowerShell commands via auto-run registry key persistence.
Nomadic Octopus has used PowerShell for execution.
OilRig has used PowerShell scripts for execution, including use of a macro to run a PowerShell command to decode file contents.
|C0022||Operation Dream Job||
During Operation Dream Job, Lazarus Group used PowerShell commands to explore the environment of compromised victims.
During Operation Wocao, threat actors used PowerShell on compromised systems.
OSX_OCEANLOTUS.D uses PowerShell scripts.
Patchwork used PowerSploit to download payloads, run a reverse shell, and execute malware on the victim's machine.
Pillowmint has used a PowerShell script to install a shim database.
The Poseidon Group's Information Gathering Tool (IGT) includes PowerShell components.
POSHSPY uses PowerShell to execute various commands, one to execute its payload.
PowerLess is written in and executed via PowerShell without using powershell.exe.
PowerPunch has the ability to execute through PowerShell.
PowerShower is a backdoor written in PowerShell.
POWERSOURCE is a PowerShell backdoor.
PowerSploit modules are written in and executed via PowerShell.
PowerStallion uses PowerShell loops to iteratively check for available commands in its OneDrive C2 server.
POWERSTATS uses PowerShell for obfuscation and execution.
PowGoop has the ability to use PowerShell scripts to execute commands.
Prestige can use PowerShell for payload execution on targeted systems.
PUNCHBUGGY has used PowerShell scripts.
Pupy has a module for loading and executing PowerShell scripts.
Pysa has used Powershell scripts to deploy its ransomware.
QakBot can use PowerShell to download and execute payloads.
There is a variant of RATANKBA that uses a PowerShell script instead of the traditional PE form.
RegDuke can extract and execute PowerShell scripts from C2 communications.
Revenge RAT uses the PowerShell command
REvil has used PowerShell to delete volume shadow copies and download files.
RogueRobin uses a command prompt to run a PowerShell script from Excel. To assist in establishing persistence, RogueRobin creates
Sandworm Team has used PowerShell scripts to run a credential harvesting tool in memory to evade defenses.
SeaDuke uses a module to execute Mimikatz with PowerShell to perform Pass the Ticket.
ServHelper has the ability to execute a PowerShell script to get information from the infected host.
SharpStage can execute arbitrary commands with PowerShell.
SHARPSTATS has the ability to employ a custom PowerShell script.
Sidewinder has used PowerShell to drop and execute malware loaders.
Silence has used PowerShell to download and execute payloads.
SILENTTRINITY can use PowerShell to execute commands.
SMOKEDHAM can execute Powershell commands sent from its C2 server.
During the SolarWinds Compromise, APT29 used PowerShell to create new tasks on remote machines, identify configuration settings, exfiltrate data, and execute other commands.
SQLRat has used PowerShell to create a Meterpreter session.
Squirrelwaffle has used PowerShell to execute its payload.
Stealth Falcon malware uses PowerShell commands to perform various functions, including gathering system information via WMI and executing commands from its C2 server.
StrongPity can use PowerShell to add files to the Windows Defender exclusions list.
TA505 has used PowerShell to download and execute malware and reconnaissance scripts.
TeamTNT has executed PowerShell commands in batch scripts.
TEMP.Veles has used a publicly-available PowerShell-based tool, WMImplant. The group has also used PowerShell to perform Timestomping.
Threat Group-3390 has used PowerShell for execution.
Thrip leveraged PowerShell to run commands to download payloads, traverse the compromised networks, and carry out reconnaissance.
Tonto Team has used PowerShell to download additional payloads.
TrickBot has been known to use PowerShell to download new payloads, open documents, and upload data to command and control servers. 
Turla has used PowerShell to execute commands/scripts, in some cases via a custom executable or code from Empire's PSInject. Turla has also used PowerShell scripts to load and execute malware in memory.
Ursnif droppers have used PowerShell in download cradles to download and execute the malware's full executable payload.
Valak has used PowerShell to download additional modules.
WarzoneRAT can use PowerShell to download files and execute commands.
WellMess can execute PowerShell scripts received from C2.
WhisperGate can use PowerShell to support multiple actions including execution and defense evasion.
Wizard Spider has used macros to execute PowerShell scripts to download malware on victim's machines. It has also used PowerShell to execute commands and move laterally through a victim network.
Woody RAT can execute PowerShell commands and scripts with the use of .NET DLL,
Xbash can use scripts to invoke PowerShell to download a malicious PE executable or PE DLL for execution.
Zeus Panda uses PowerShell to download and execute the payload.
Anti-virus can be used to automatically quarantine suspicious files.
Set PowerShell execution policy to execute only signed scripts.
|M1042||Disable or Remove Feature or Program||
It may be possible to remove PowerShell from systems when not needed, but a review should be performed to assess the impact to an environment, since it could be in use for many legitimate purposes and administrative functions.
Disable/restrict the WinRM Service to help prevent uses of PowerShell for remote execution.
Use application control where appropriate. 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.,
|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.
PowerShell JEA (Just Enough Administration) may also be used to sandbox administration and limit what commands admins/users can execute through remote PowerShell sessions.
|ID||Data Source||Data Component||Detects|
If proper execution policy is set, adversaries will likely be able to define their own execution policy if they obtain administrator or system access, either through the Registry or at the command line. This change in policy on a system may be a way to detect malicious use of PowerShell. If PowerShell is not used in an environment, then simply looking for PowerShell execution may detect malicious activity. It is also beneficial to turn on PowerShell logging to gain increased fidelity in what occurs during execution (which is applied to .NET invocations).  PowerShell 5.0 introduced enhanced logging capabilities, and some of those features have since been added to PowerShell 4.0. Earlier versions of PowerShell do not have many logging features. An organization can gather PowerShell execution details in a data analytic platform to supplement it with other data.
Monitor for loading and/or execution of artifacts associated with PowerShell specific assemblies, such as System.Management.Automation.dll (especially to unusual process names/locations).
Implementation 1 : Processes loading PowerShell assemblies
Monitor for newly executed processes that may abuse PowerShell commands and scripts for execution.
Implementation 1: Non-interactive Powershell Sessions
Implementation 2: Remote Powershell Sessions
Consider monitoring for Windows event ID (EID) 400, which shows the version of PowerShell executing in the
Monitor for any attempts to enable scripts running on a system 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.