T1204.004 Malicious Copy and Paste
Executionon attack.mitre.org
ATT&CK Enterprise 20.0 · 20.1 released, update in review
How MITRE detects it
DET0340 User Execution – Malicious Copy & Paste (browser/email → shell with obfuscated one-liner) – T1204.004
AN0962 Windows
A user is socially engineered (web page, email, document) to open Run/PowerShell/CMD and paste an obfuscated one-liner. The chain is: (1) user context active in a browser/email/office app → (2) process creation of a command interpreter with suspicious arguments (base64/Invoke-Expression/web download/pipeline to shell) → (3) optional file drop in %TEMP% or %APPDATA% → (4) outbound network connection to an external domain. Events are correlated within a short window and with consistent user/session.
| MITRE log source | In Microsoft Sentinel |
|---|---|
WinEventLog:SecurityEventCode=4688 |
The same events land in SecurityEvent (Windows Security Events connectors) or WindowsEvent (Windows Event Forwarding); many built-in rules read SecurityEvent only. |
WinEventLog:PowerShellEventCode=4103, 4104, 4105, 4106 |
|
WinEventLog:SysmonEventCode=11 |
Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent. |
WinEventLog:SysmonEventCode=3, 22 |
Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent. |
NSM:FlowHTTP(S) requests with User-Agents typical of PowerShell or curl from desktop; or URIs matching paste-inspired payload hosts | Not mapped to Sentinel yet. |
AN0963 Linux
User pastes a multi-line or one-liner into a terminal (bash/zsh) that downloads/decodes and executes content. Chain: terminal exec of curl/wget/bash/sh with pipe to interpreter or base64-decode → transient file under /tmp|~/.cache → immediate outbound egress.
| MITRE log source | In Microsoft Sentinel |
|---|---|
auditd:SYSCALLexecve: exe in (/usr/bin/bash,/usr/bin/sh,/usr/bin/zsh,/usr/bin/python*) AND cmdline matches '(curl|wget).*(\||\|\s*sh|bash)|base64\s*-d|python\s*-c' | Not mapped to Sentinel yet. |
auditd:SYSCALLopen: File creation under /tmp, /var/tmp, ~/.cache with executable bit or shell shebang | Not mapped to Sentinel yet. |
NSM:FlowNew egress to Internet by the same UID/host shortly after terminal exec | Not mapped to Sentinel yet. |
AN0964 macOS
User pastes an obfuscated command into Terminal.app/iTerm2 that decodes or downloads code and executes. Detects Terminal/iTerm2 spawning bash/zsh/python with suspicious pipeline/base64 patterns followed by file writes in ~/Library or /tmp and outbound network connections.
| MITRE log source | In Microsoft Sentinel |
|---|---|
macos:unifiedlogexec: ParentImage in (Terminal, iTerm2) AND Image in (/bin/zsh,/bin/bash,/usr/bin/python*) AND CommandLine matches '(curl|wget).*(\||\|\s*sh|bash)|base64 -D|python -c' | Not mapped to Sentinel yet. |
macos:osqueryInterpreter exec with suspicious arguments as above | Not mapped to Sentinel yet. |
macos:unifiedlogcreate: New files in /tmp or ~/Library/Application Support/* with executable or script extensions | Not mapped to Sentinel yet. |
NSM:FlowEgress to non-approved networks from host after terminal exec | Not mapped to Sentinel yet. |
Content Hub rules tagged with it (0)
No Content Hub rule is tagged with this technique.
In Sigma rules
6 SigmaHQ community rules name it in their tags.
- FileFix - Command Evidence in TypedPaths
- Suspicious ClickFix/FileFix Execution Pattern
- Suspicious Explorer Process with Whitespace Padding - ClickFix/FileFix
- Suspicious FileFix Execution Pattern
- Suspicious Space Characters in RunMRU Registry Path - ClickFix
- Suspicious Space Characters in TypedPaths Registry Path - FileFix
Mitigations
MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.