Detection rules › Elastic

Potential Binary Masquerading via Invalid Code Signature

Source
github.com/elastic/protections-artifacts

Identifies binaries that have been identically named to Apple or popular third-party programs and have invalid or untrusted code signatures. Adversaries may attempt to manipulate the name of a process to make it appear legitimate or benign.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Identifies binaries that have been identically named to Apple or popular third-party programs and have invalid or
untrusted code signatures. Adversaries may attempt to manipulate the name of a process to make it appear legitimate or
benign.
"""
id = "4154c8ce-c718-4641-80db-a6a52276f1a4"
license = "Elastic License v2"
name = "Potential Binary Masquerading via Invalid Code Signature"
os_list = ["macos"]
version = "1.0.40"

query = '''
process where event.action == "exec" and
 (
   process.name like ("com.apple.*", "com.jamf.*", "jamf*", "zoom.us") or 
   process.executable like "/Users/*/Library/com.apple.*"
  ) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not (process.code_signature.subject_name in ("Software Signing", "com.apple.WebKit.Networking", "com.apple.WebKit.WebContent") and
      process.name in
           ("com.apple.WebKit.WebContent.Development",
            "com.apple.WebKit.GPU.Development",
            "com.apple.WebKit.Networking.Development",
            "com.apple.WebKit.Storage.Development")) and
 not process.executable like~ ("/usr/local/jamf/bin/jamf", "com.apple.WebKit.Networking.Development", "/Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistLauncher",
                           "/Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistConnectorUI.app/Contents/MacOS/jamfRemoteAssistConnectorUI",
                           "/Users/*/Library/Caches/ms-playwright/*") and
 not process.parent.executable in ("/sbin/launchd", "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon") and
 not process.Ext.effective_parent.executable in ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd") and
 not (process.Ext.effective_parent.executable == "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" and process.name == "com.apple.WebKit.WebContent.Development") and
 not (process.code_signature.signing_id in ("com.apple.WebKit.WebContent", "us.zoom.xos") and process.code_signature.trusted == true) and
 not (process.name == "zoom.us" and process.code_signature.subject_name == "Developer ID Application: Zoom Video Communications, Inc. (BJ4HAAB9B3)" and process.code_signature.team_id == "BJ4HAAB9B3") and
 not process.hash.sha256 in ("7519ac10c724566b7a57607cc2fc88a876bdd91a585e690c2480093b582c73e6", "930b075c52f829efcd431cee324403e1e8b03bf2039b1343aae31570034d30e2")
'''

min_endpoint_version = "8.7.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.001"
name = "Invalid Code Signature"
reference = "https://attack.mitre.org/techniques/T1036/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Stage 1: process

process where event.action == "exec" and
 (
   process.name like ("com.apple.*", "com.jamf.*", "jamf*", "zoom.us") or 
   process.executable like "/Users/*/Library/com.apple.*"
  ) and
 (process.code_signature.trusted == false or process.code_signature.exists == false) and
 not (process.code_signature.subject_name in ("Software Signing", "com.apple.WebKit.Networking", "com.apple.WebKit.WebContent") and
      process.name in
           ("com.apple.WebKit.WebContent.Development",
            "com.apple.WebKit.GPU.Development",
            "com.apple.WebKit.Networking.Development",
            "com.apple.WebKit.Storage.Development")) and
 not process.executable like~ ("/usr/local/jamf/bin/jamf", "com.apple.WebKit.Networking.Development", "/Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistLauncher",
                           "/Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistConnectorUI.app/Contents/MacOS/jamfRemoteAssistConnectorUI",
                           "/Users/*/Library/Caches/ms-playwright/*") and
 not process.parent.executable in ("/sbin/launchd", "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon") and
 not process.Ext.effective_parent.executable in ("/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
                                                "/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd") and
 not (process.Ext.effective_parent.executable == "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" and process.name == "com.apple.WebKit.WebContent.Development") and
 not (process.code_signature.signing_id in ("com.apple.WebKit.WebContent", "us.zoom.xos") and process.code_signature.trusted == true) and
 not (process.name == "zoom.us" and process.code_signature.subject_name == "Developer ID Application: Zoom Video Communications, Inc. (BJ4HAAB9B3)" and process.code_signature.team_id == "BJ4HAAB9B3") and
 not process.hash.sha256 in ("7519ac10c724566b7a57607cc2fc88a876bdd91a585e690c2480093b582c73e6", "930b075c52f829efcd431cee324403e1e8b03bf2039b1343aae31570034d30e2")

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.Ext.effective_parent.executableeq/Applications/Visual Studio Code.app/Contents/MacOS/Electronexcludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Applications/Visual Studio Code.app/Contents/MacOS/Electron"
process.nameeqcom.apple.WebKit.WebContent.Developmentexcludes:process.name field:"process.name" value:"com.apple.WebKit.WebContent.Development"
process.code_signature.signing_idincom.apple.WebKit.WebContent, us.zoom.xosexcludes:process.code_signature.signing_id field:"process.code_signature.signing_id" value:"com.apple.WebKit.WebContent" field:"process.code_signature.signing_id" value:"us.zoom.xos"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.code_signature.subject_nameeqDeveloper ID Application: Zoom Video Communications, Inc. (BJ4HAAB9B3)excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Developer ID Application: Zoom Video Communications, Inc. (BJ4HAAB9B3)"
process.code_signature.team_ideqBJ4HAAB9B3excludes:process.code_signature.team_id field:"process.code_signature.team_id" value:"BJ4HAAB9B3"
process.nameeqzoom.usexcludes:process.name field:"process.name" value:"zoom.us"
process.code_signature.subject_nameinSoftware Signing, com.apple.WebKit.Networking, com.apple.WebKit.WebContentexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Software Signing" field:"process.code_signature.subject_name" value:"com.apple.WebKit.Networking" field:"process.code_signature.subject_name" value:"com.apple.WebKit.WebContent"
process.nameincom.apple.WebKit.GPU.Development, com.apple.WebKit.Networking.Development, com.apple.WebKit.Storage.Development, com.apple.WebKit.WebContent.Developmentexcludes:process.name
process.Ext.effective_parent.executablein/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechdexcludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon" field:"process.Ext.effective_parent.executable" value:"/System/Library/PrivateFrameworks/CoreSpeech.framework/corespeechd"
process.executablewildcard/usr/local/jamf/bin/jamf, com.apple.WebKit.Networking.Development, /Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistLauncher, /Library/Application Support/JAMF/Remote Assist/jamfRemoteAssistConnectorUI.app/Contents/MacOS/jamfRemoteAssistConnectorUI, /Users/*/Library/Caches/ms-playwright/*excludes:process.executable
process.hash.sha256in7519ac10c724566b7a57607cc2fc88a876bdd91a585e690c2480093b582c73e6, 930b075c52f829efcd431cee324403e1e8b03bf2039b1343aae31570034d30e2excludes:process.hash.sha256 field:"process.hash.sha256" value:"7519ac10c724566b7a57607cc2fc88a876bdd91a585e690c2480093b582c73e6" field:"process.hash.sha256" value:"930b075c52f829efcd431cee324403e1e8b03bf2039b1343aae31570034d30e2"
process.parent.executablein/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon, /sbin/launchdexcludes:process.parent.executable field:"process.parent.executable" value:"/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon" field:"process.parent.executable" value:"/sbin/launchd"

Indicators

These rows show field, operator, and value matches.