User Execution: Malicious Copy and Paste
- ID
- T1204.004
- Tactics
- TA0002 Execution
- Sub-technique of
- T1204 User Execution
- Platforms
- Linux, macOS, Windows
- Data sources
- Process Creation, Command Execution, File Creation, Network Connection Creation, Network Traffic Content
- Source
- attack.mitre.org
- MITRE last modified
- 12 May 2026
An adversary may rely upon a user copying and pasting code in order to gain execution. Users may be subjected to social engineering to get them to copy and paste code directly into a Command and Scripting Interpreter. One such strategy is "ClickFix," in which adversaries present users with seemingly helpful solutions—such as prompts to fix errors or complete CAPTCHAs—that instead instruct the user to copy and paste malicious code.
Malicious websites, such as those used in Drive-by Compromise, may present fake error messages or CAPTCHA prompts that instruct users to open a terminal or the Windows Run Dialog box and execute an arbitrary command. These commands may be obfuscated using encoding or other techniques to conceal malicious intent. Once executed, the adversary will typically be able to establish a foothold on the victim's machine.[2][3][4][5]
Adversaries may also leverage phishing emails for this purpose. When a user attempts to open an attachment, they may be presented with a fake error and offered a malicious command to paste as a solution, consistent with the "ClickFix" strategy.[6][7]
Tricking a user into executing a command themselves may help to bypass email filtering, browser sandboxing, or other mitigations designed to protect users against malicious downloaded files.
Detection
- DET0340 User Execution – Malicious Copy & Paste (browser/email → shell with obfuscated one-liner) – T1204.004
Data components: Process Creation, Command Execution, File Creation, Network Connection Creation, Network Traffic Content
Mitigations (3)
- M1021 Restrict Web-Based Content
If a link is being requested by a user, block unknown or unused files in transit by default that should not be downloaded or by policy from suspicious sites as a best practice to prevent some vectors, such as
.scr,.exe,.pif,.cpl, etc.- M1031 Network Intrusion Prevention
If a link is being requested by a user, network intrusion prevention systems and systems designed to scan and remove malicious downloads can be used to block activity.
- M1038 Execution Prevention
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.,
Add-Type).[1]
