Trusted Design

T1215 - Kernel Modules and Extensions

概要

Loadable Kernel Modules (or LKMs) are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. For example, one type of module is the device driver, which allows the kernel to access hardware connected to the system. (Citation: Linux Kernel Programming) When used maliciously, Loadable Kernel Modules (LKMs) can be a type of kernel-mode Rootkit that run with the highest operating system privilege (Ring 0). (Citation: Linux Kernel Module Programming Guide) Adversaries can use loadable kernel modules to covertly persist on a system and evade defenses. Examples have been found in the wild and there are some open source projects. (Citation: Volatility Phalanx2) (Citation: CrowdStrike Linux Rootkit) (Citation: GitHub Reptile) (Citation: GitHub Diamorphine)

Common features of LKM based rootkits include: hiding itself, selective hiding of files, processes and network activity, as well as log tampering, providing authenticated backdoors and enabling root access to non-privileged users. (Citation: iDefense Rootkit Overview)

Kernel extensions, also called kext, are used for macOS to load functionality onto a system similar to LKMs for Linux. They are loaded and unloaded through kextload and kextunload commands. Several examples have been found where this can be used. (Citation: RSAC 2015 San Francisco Patrick Wardle) (Citation: Synack Secure Kernel Extension Broken) Examples have been found in the wild. (Citation: Securelist Ventir)

管理者によるコメント

T1215は「Kernel Modules and Extensions(カーネルモジュールおよび拡張機能)」として定義されていた、OSの最深部(カーネル空間)を狙う極めて高度かつ致命的な攻撃手法です。

Linuxの LKM(Loadable Kernel Module) や、Windowsのカーネルモードドライバ(.sys)、macOSの KEXT(Kernel Extension) といった仕組みを悪用し、OSの心臓部であるカーネルレベルでマルウェアを自動実行・常駐化させる手法です。

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

この手法で攻撃者は、「OSそのものを完全に支配し、セキュリティソフトの検知を100%回避する『最強のバックドア(Rootkit)』」を実現します。

2. 攻撃の流れ

カーネル空間にコードを送り込むには、OSごとに用意されたドライバーやモジュールの読み込み機能を悪用します。この実行には必ず最高管理者権限(rootやSYSTEM)が必要です。

  1. 初期侵入と権限昇格:
    脆弱性を突いてシステムに侵入し、まずはローカルの最高権限(Linuxのrootなど)を奪取します。

  2. 悪意あるカーネルモジュールの作成:
    ターゲットのOSバージョン(カーネルのバージョン)に適合する、不正なコードを含んだカスタムモジュール(Linuxなら .ko ファイル、Windowsなら .sys ファイル)を用意します。

  3. モジュールのロード(登録):

    • Linuxの場合: insmodmodprobe コマンドを悪用して、悪意あるLKMを直接カーネルに組み込みます。また、再起動後も自動ロードされるよう /etc/modules などの設定ファイルに追記します。

    • Windowsの場合: sc create コマンドなどで悪意あるドライバーを「システムサービス」として登録し、起動タイプを Boot または System に設定します。

  4. カーネルの掌握:
    OSがモジュールをロードした瞬間、マルウェアはカーネル空間のメモリに展開され、OSのシステムコール(Syscall)テーブルなどを書き換えてシステム全体の制御権を奪取します。

3. 防御・対策

カーネルレベルの攻撃は一度成功すると検知が絶望的になるため、「そもそも未承認のモジュールをロードさせない」という予防策が生命線となります。

4. 重要ポイント

5. 関連する主なCWE

6. 関連する代表的なCVE

攻撃者が「カーネルモジュールを強制的に読み込ませる(BYOVD)」ために悪用する、正規ドライバー側の代表的な脆弱性です。

分析

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

この攻撃手法を利用する脅威アクターは登録されていません。

関連する CVE

この攻撃手法に関連する CVE は登録されていません。

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


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