Trusted Design

T1519 - Emond

概要

Adversaries may use Event Monitor Daemon (emond) to establish persistence by scheduling malicious commands to run on predictable event triggers. Emond is a Launch Daemon that accepts events from various services, runs them through a simple rules engine, and takes action. The emond binary at /sbin/emond will load any rules from the /etc/emond.d/rules/ directory and take action once an explicitly defined event takes place. The rule files are in the plist format and define the name, event type, and action to take. Some examples of event types include system startup and user authentication. Examples of actions are to run a system command or send an email. The emond service will not launch if there is no file present in the QueueDirectories path /private/var/db/emondClients, specified in the Launch Daemon configuration file at/System/Library/LaunchDaemons/com.apple.emond.plist.(Citation: xorrior emond Jan 2018)(Citation: magnusviri emond Apr 2016)(Citation: sentinelone macos persist Jun 2019)

Adversaries may abuse this service by writing a rule to execute commands when a defined event occurs, such as system start up or user authentication.(Citation: xorrior emond Jan 2018)(Citation: magnusviri emond Apr 2016)(Citation: sentinelone macos persist Jun 2019) Adversaries may also be able to escalate privileges from administrator to root as the emond service is executed with root privileges by the Launch Daemon service.

管理者によるコメント

T1519macOS環境におけるイベントモニターデーモンを悪用したテクニックである「Emond」です。

macOSに標準で備わっている(隠れた)イベントログ監視・処理エンジンである「emond(Event Monitor Daemon)」のルールファイルを改ざん・新規作成し、特定のイベント(システムの起動やユーザー認証など)が発生した瞬間に、悪意あるコマンドを最高権限(root)で自動実行させる手法です。

1. 概要(攻撃者は何を実現できるのか?)

この手法で攻撃者は、「macOSの標準的な永続化チェックツール(Launchdの監視など)の目を盗みつつ、システムが起動した瞬間に自動的に最高権限(root)のバックドアを発動させること」を実現します。

2. 攻撃の流れ

Emondは /etc/emond.d/rules/ にあるXML(plist形式)のルールファイルを読み込んで動作します。攻撃者はここに罠を仕掛けます。

  1. 初期侵入と管理者権限の確保: 攻撃者はmacOS端末に侵入し、ルールファイルが置かれるシステム領域に書き込みを行うため、事前に管理者権限(sudo権限など)を確保します。

  2. Emond起動用のダミーファイル作成:
    モダンなmacOSでは、特定のディレクトリ(/private/var/db/emondClients)が空の場合、電力を節約するためにEmondサービス自体が起動しない仕様になっています。攻撃者はまず、このフォルダにダミーのファイルを1つ作成し、次回起動時にEmondが必ず立ち上がるように「呼び水」を仕込みます。

  3. 悪意あるルール(plist)の作成:
    /etc/emond.d/rules/ ディレクトリ配下に、新しいルールファイル(例: malicious.plist)を作成します。

    • ルールの内容(設定例):
    • トリガー(EventTypes): 「システムの起動(System Startup)」や「ユーザー認証(Authentication)」を指定。
    • アクション(Actions): 「指定したシェルコマンド(C2サーバーへ接続するバックドアなど)を実行する」を設定。
  4. 自動実行と特権昇格の発動(トリガー):
    端末が再起動されるか、ユーザーがログイン(認証)した瞬間に、OS裏側で sbin/emond が起動します。Emondは仕込まれたルールを読み込み、条件に合致したため、内部に書かれていた攻撃者のコマンドを root権限 で自動実行します。

3. 防御・対策

Emond関連の特定のディレクトリおよびプロセスの動きを注視することが重要です。

4. 重要ポイント

5. 関連する主なCWE

6. 関連する代表的なCVE

Emondの悪用は、macOSの「正規のイベント駆動機能」の仕様を逆手に取ったものであるため、EmondそのものにCVE番号が割り当てられた脆弱性があるわけではありません。

しかし、攻撃者がルールを書き換えるための「管理者権限」を手に入れるため、あるいはAppleが施しているシステム保護機能(SIP: System Integrity Protection)をすり抜けるために、以下のようなmacOSの脆弱性と組み合わせて悪用されることがあります。

分析

この攻撃手法を利用する脅威アクター

関連する CVE

攻撃手法 – 脅威アクター Graph


← Technique一覧に戻る ← Tactics一覧に戻る