Detection rules › Elastic

Suspicious Image Creation via ScreenCapture

Time window
10s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

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

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.

FieldKindExcluded valuesSearch
process.Ext.effective_parent.executablewildcard/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/zedexcludes:process.Ext.effective_parent.executable
process.command_lineeqscreencapture --helpexcludes:process.command_line field:"process.command_line" value:"screencapture --help"
process.parent.executableeq/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer, /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindowexcludes: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.