Detection rules › Elastic
Suspicious Image Creation via ScreenCapture
Detects when the ScreenCapture binary executes and creates an image in a suspicious location like tmp or the shared directory. Malware has used the ScreenCapture binary to collect images of victim systems and exfiltrate them via C2.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Collection |
Telemetry coverage
Rule body
[rule]
description = """
Detects when the ScreenCapture binary executes and creates an image in a suspicious location like tmp or the shared
directory. Malware has used the ScreenCapture binary to collect images of victim systems and exfiltrate them via C2.
"""
id = "0701ab8c-9abc-41e1-8af7-2d937778e73f"
license = "Elastic License v2"
name = "Suspicious Image Creation via ScreenCapture"
os_list = ["macos"]
version = "1.0.9"
query = '''
sequence by process.entity_id with maxspan=10s
[process where event.type == "start" and event.action == "exec" and process.name == "screencapture" and
not process.command_line == "screencapture --help" and
not process.parent.executable like ("/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer",
"/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow") and
not process.Ext.effective_parent.executable like ("/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer",
"/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow",
"/Applications/Visual Studio Code.app/*",
"/Applications/Cursor.app/*",
"/Applications/Claude.app/*",
"/Applications/Ghostty.app/*",
"/Applications/IntelliJ IDEA.app/*",
"/Users/*/Applications/Codex.app/*",
"/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/*",
"/Applications/Codex.app/*",
"/private/var/folders/*/AppTranslocation/*/Visual Studio Code.app/*",
"/Users/*/.local/bin/uv",
"/Applications/Warp.app/*",
"/Applications/Obsidian.app/*",
"/Applications/Tabby.app/*",
"/Applications/Android Studio.app/Contents/MacOS/studio",
"/Applications/Zed.app/Contents/MacOS/zed")]
[file where event.action == "modification" and file.path like ("/Users/Shared/*", "/tmp/*", "/private/tmp/*")]
'''
min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1113"
name = "Screen Capture"
reference = "https://attack.mitre.org/techniques/T1113/"
[threat.tactic]
id = "TA0009"
name = "Collection"
reference = "https://attack.mitre.org/tactics/TA0009/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 10s, correlated by process.entity_id.
Stage 1: process
[process where event.type == "start" and event.action == "exec" and process.name == "screencapture" and
not process.command_line == "screencapture --help" and
not process.parent.executable like ("/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer",
"/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow") and
not process.Ext.effective_parent.executable like ("/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer",
"/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow",
"/Applications/Visual Studio Code.app/*",
"/Applications/Cursor.app/*",
"/Applications/Claude.app/*",
"/Applications/Ghostty.app/*",
"/Applications/IntelliJ IDEA.app/*",
"/Users/*/Applications/Codex.app/*",
"/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/*",
"/Applications/Codex.app/*",
"/private/var/folders/*/AppTranslocation/*/Visual Studio Code.app/*",
"/Users/*/.local/bin/uv",
"/Applications/Warp.app/*",
"/Applications/Obsidian.app/*",
"/Applications/Tabby.app/*",
"/Applications/Android Studio.app/Contents/MacOS/studio",
"/Applications/Zed.app/Contents/MacOS/zed")]
Stage 2: file
[file where event.action == "modification" and file.path like ("/Users/Shared/*", "/tmp/*", "/private/tmp/*")]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | wildcard | /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer, /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow, /Applications/Visual Studio Code.app/*, /Applications/Cursor.app/*, /Applications/Claude.app/*, /Applications/Ghostty.app/*, /Applications/IntelliJ IDEA.app/*, /Users/*/Applications/Codex.app/*, /Users/*/Library/Application Support/Claude/claude-code/*/claude.app/*, /Applications/Codex.app/*, /private/var/folders/*/AppTranslocation/*/Visual Studio Code.app/*, /Users/*/.local/bin/uv, /Applications/Warp.app/*, /Applications/Obsidian.app/*, /Applications/Tabby.app/*, /Applications/Android Studio.app/Contents/MacOS/studio, /Applications/Zed.app/Contents/MacOS/zed | excludes:process.Ext.effective_parent.executable |
process.command_line | eq | screencapture --help | excludes:process.command_line field:"process.command_line" value:"screencapture --help" |
process.parent.executable | eq | /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer, /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow | excludes:process.parent.executable field:"process.parent.executable" value:"/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer" field:"process.parent.executable" value:"/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
file.path | wildcard |
| field:"TargetFilename" kind:wildcard |
process.name | eq |
| field:"process_name" kind:eq value:"screencapture" |