Quasar Linux (QLNX):サプライチェーンに足場を築くフルRAT機能
Detection stack
- AIDR
- Alert
- ETL
- Query
概要
Quasar Linux (QLNX)は、ユーザースペースとeBPFルートキットをPAMバックドアと広範な資格情報収集機能と組み合わせた高度なLinuxリモートアクセス型トロイの木馬です。このマルウェアは、ファイルレス実行、プロセス名偽装、および感染したシステム上で隠れ続けるのを助けるためのいくつかの持続化技法をサポートしています。開発者のワークステーションを狙っているため、トークン、SSHキー、クラウド認証情報を盗むことができ、特にサプライチェーンの悪用には危険です。また、このマルウェアは暗号化された通信を使用し、アクセスの維持と回復力を高めるためにピアツーピアのメッシュアーキテクチャをサポートしています。
調査
Trend Microの研究者はQLNXバイナリを取得し、静的および動的解析を行い、ルートキットとPAMバックドアコンポーネントの埋め込まれたソースコードを明らかにしました。彼らの調査は、ターゲットホスト上でコンポーネントを直接コンパイルするマルウェアの能力、その使用する持続化技法の範囲、およびインプラントによってサポートされる完全なコマンドセットを文書化しました。ネットワーク解析もまた、通信で使用されるカスタムTLSベースのプロトコルと特異なマジック識別子を明らかにしました。この作業から、研究者はハンティングと検出をサポートするための妥協の指標を抽出しました。
緩和策
防御者は、ユニークなミューテックスロックファイル、疑わしい LD_PRELOAD エントリ、および不正な共有オブジェクトを生成する gcc コンパイルコマンドを監視することで、QLNXを探すべきです。組織はまた、 quasar-implant と名付けられた不明なバイナリの実行をブロックし、 /etc/ld.so.preloadへの書き込みアクセスを制限するべきです。開発者アカウントには多要素認証を実施し、セキュリティチームは資格情報ストアや機密トークンファイルの流出を試みる動きを厳重に監視するべきです。
対応
QLNXの指標が見つかった場合、影響を受けたシステムを直ちに隔離し、メモリとディスクのイメージを収集し、不正なプロセスを終了させます。 /etc/ld.so.preloadから不正なエントリを削除し、コンパイルされた不正な .so ファイルを削除し、インプラントが使用するロックファイルをクリアします。特にクラウドやパッケージレジストリトークンなど、潜在的に曝露されたすべての資格情報は即座に変更されるべきです。調査者はまた、侵入中にどの供給チェーンシステム、リポジトリ、またはビルド環境が汚染されたか評価するべきです。
graph TB %% 定義クラス classDef action fill:#99ccff classDef technique fill:#ffcc99 classDef malware fill:#ff9999 classDef tool fill:#cccccc classDef process fill:#ccffcc classDef persistence fill:#ffdd99 %% マルウェアノード malware_qlnx[“<b>マルウェア</b> – <b>名前</b>: QLNX<br/><b>説明</b>: ルートキット技術を使用するファイルレスLinuxインプラント”] class malware_qlnx malware %% 実行フェーズ action_execution[“<b>アクション</b> – <b>実行</b>: memfd_createとexecveatを使用してファイルレスインプラントを起動し、argv0とプロセス名を偽装”] class action_execution action technique_process_spoof[“<b>技術</b> – T1564.010:<br/>アーティファクトの隠蔽 – プロセス引数の偽装”] class technique_process_spoof technique technique_unix_shell[“<b>技術</b> – T1059.004:<br/>コマンドおよびスクリプトインタプリタ – Unixシェル”] class technique_unix_shell technique %% 権限昇格フェーズ action_priv_esc[“<b>アクション</b> – <b>権限昇格</b>: sudoまたはpkexecを使用してより高い権限を取得しようとする”] class action_priv_esc action technique_priv_esc[“<b>技術</b> – T1548.004:<br/>権限昇格制御機構の悪用 – プロンプト付き昇格実行”] class technique_priv_esc technique %% 永続化フェーズ action_persistence[“<b>アクション</b> – <b>永続化</b>: systemdサービス、cron @reboot、init.dスクリプト、XDG自動起動、LD_PRELOADフックを設置”] class action_persistence action technique_rc_scripts[“<b>技術</b> – T1037.004:<br/>ブートまたはログオン初期化スクリプト – RCスクリプト”] class technique_rc_scripts technique technique_autostart[“<b>技術</b> – T1547:<br/>ブートまたはログオン自動起動実行”] class technique_autostart technique technique_hijack[“<b>技術</b> – T1574:<br/>LD_PRELOADによる実行フローのハイジャック”] class technique_hijack technique class action_persistence persistence %% 防御回避フェーズ action_defense_evasion[“<b>アクション</b> – <b>防御回避</b>: LD_PRELOADルートキット、eBPFコントローラ、プロセスインジェクションを展開しログを消去”] class action_defense_evasion action technique_rootkit[“<b>技術</b> – T1014:<br/>ルートキット – ファイル・プロセス・ポートを隠蔽”] class technique_rootkit technique technique_thread_hijack[“<b>技術</b> – T1055.003:<br/>プロセスインジェクション – スレッド実行ハイジャック”] class technique_thread_hijack technique technique_process_hollow[“<b>技術</b> – T1055.012:<br/>プロセスインジェクション – プロセスホロウイング”] class technique_process_hollow technique %% 認証情報収集フェーズ action_credential_harvest[“<b>アクション</b> – <b>認証情報収集</b>: ファイル、SSHキー、/etc/shadow、ブラウザ、PAMから認証情報を収集”] class action_credential_harvest action technique_creds_files[“<b>技術</b> – T1552.001:<br/>不適切に保護された認証情報 – ファイル内の認証情報”] class technique_creds_files technique technique_private_keys[“<b>技術</b> – T1552.004:<br/>不適切に保護された認証情報 – 秘密鍵”] class technique_private_keys technique technique_shadow_dump[“<b>技術</b> – T1003.008:<br/>OS認証情報ダンプ – /etc/passwdおよび/etc/shadow”] class technique_shadow_dump technique technique_cookies[“<b>技術</b> – T1550.004:<br/>代替認証情報の使用 – WebセッションCookie”] class technique_cookies technique technique_pam[“<b>技術</b> – T1555:<br/>パスワードストアからの認証情報 – PAMモジュール”] class technique_pam technique %% 収集フェーズ action_collection[“<b>アクション</b> – <b>収集</b>: クリップボードデータとスクリーン画像を取得”] class action_collection action technique_clipboard[“<b>技術</b> – T1115:<br/>クリップボードデータ”] class technique_clipboard technique technique_screenshot[“<b>技術</b> – T1113:<br/>スクリーンキャプチャ”] class technique_screenshot technique %% C2フェーズ action_c2[“<b>アクション</b> – <b>コマンド&コントロール</b>: TLS/HTTPS暗号化チャネルでデータを外部送信”] class action_c2 action technique_exfil[“<b>技術</b> – T1041:<br/>C2チャネル経由のデータ流出”] class technique_exfil technique %% 横展開フェーズ action_lateral[“<b>アクション</b> – <b>横展開</b>: 収集したSSHキーを使用してリモートホストへアクセス”] class action_lateral action technique_remote_exploit[“<b>技術</b> – T1210:<br/>リモートサービスの悪用”] class technique_remote_exploit technique %% 接続 malware_qlnx –>|実行する| action_execution action_execution –>|使用| technique_process_spoof action_execution –>|使用| technique_unix_shell action_execution –>|へ移行| action_priv_esc action_priv_esc –>|使用| technique_priv_esc action_priv_esc –>|へ移行| action_persistence action_persistence –>|使用| technique_rc_scripts action_persistence –>|使用| technique_autostart action_persistence –>|使用| technique_hijack action_persistence –>|へ移行| action_defense_evasion action_defense_evasion –>|使用| technique_rootkit action_defense_evasion –>|使用| technique_thread_hijack action_defense_evasion –>|使用| technique_process_hollow action_defense_evasion –>|へ移行| action_credential_harvest action_credential_harvest –>|使用| technique_creds_files action_credential_harvest –>|使用| technique_private_keys action_credential_harvest –>|使用| technique_shadow_dump action_credential_harvest –>|使用| technique_cookies action_credential_harvest –>|使用| technique_pam action_credential_harvest –>|へ移行| action_collection action_collection –>|使用| technique_clipboard action_collection –>|使用| technique_screenshot action_collection –>|へ移行| action_c2 action_c2 –>|使用| technique_exfil action_c2 –>|有効化| action_lateral action_lateral –>|使用| technique_remote_exploit
攻撃フロー
検出
試みられた可能性のあるIPルックアップドメイン通信(dns経由)
表示
ユーザープロファイルに疑わしい自動起動.desktopがドロップされた(file_event経由)
表示
Linuxホストで隠しファイルが作成された(file_event経由)
表示
検出すべきIOC(HashSha256):Quasar Linux (QLNX) – サプライチェーンにおける静かな足場:ルートキット、PAMバックドア、資格情報収集などを備えたフル機能のLinux RATの内部
表示
検出すべきIOC(HashSha1):Quasar Linux (QLNX) – サプライチェーンにおける静かな足場:ルートキット、PAMバックドア、資格情報収集などを備えたフル機能のLinux RATの内部
表示
検出すべきIOC(HashMd5):Quasar Linux (QLNX) – サプライチェーンにおける静かな足場:ルートキット、PAMバックドア、資格情報収集などを備えたフル機能のLinux RATの内部
表示
QLNXによるファイルレス実行とコード注入の検出[Linuxプロセス作成]
表示
## Simulation Execution
Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.
Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic.
-
Attack Narrative & Commands:
- Stage 1 – Payload Generation: The attacker writes a minimal C payload that calls
memfd_createto create an anonymous in‑memory executable file, writes a simple shellcode (e.g.,execve("/bin/sh", …)), marks it executable, and then launches it viaexecveat. - Stage 2 – Compile On‑The‑Fly: Using
gcc(the visible indicator in the rule) the attacker compiles the source without touching disk (output directed to/dev/fd/3). - Stage 3 – Execution & Injection: The compiled binary runs, invokes
memfd_create, loads the shellcode, and finally callsexecveatto execute the memory‑resident ELF. Optionalptracemay be used to inject code into a sibling process, which would also satisfy the rule.
- Stage 1 – Payload Generation: The attacker writes a minimal C payload that calls
-
Regression Test Script:
#!/usr/bin/env bash # # QLNX‑like fileless execution simulation # Generates in‑memory ELF via memfd_create and runs it with execveat. # Requires: gcc, libcap2-bin (for execveat demo), and auditd rules from pre‑flight. set -euo pipefail # 1️⃣ Create C source that performs the memfd + execveat dance cat > /tmp/payload.c <<'EOF' #define _GNU_SOURCE #include <sys/mman.h> #include <sys/syscall.h> #include <unistd.h> #include <fcntl.h> #include <string.h> int main(void) { // Create an anonymous file descriptor (memfd) int fd = syscall(SYS_memfd_create, "memfd_payload", MFD_CLOEXEC); if (fd == -1) _exit(1); // Simple ELF binary that just execve /bin/sh const unsigned char elf[] = { 0x7f,0x45,0x4c,0x46,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ... (truncated for brevity – a minimal statically linked /bin/sh ELF) }; write(fd, elf, sizeof(elf)); // Make it executable fchmod(fd, 0755); // Use execveat to run the in‑memory binary syscall(SYS_execveat, fd, "", NULL, NULL, AT_EMPTY_PATH); _exit(0); } EOF # 2️⃣ Compile with gcc (this will be captured by the detection rule) gcc -static -o /tmp/payload /tmp/payload.c # 3️⃣ Execute the malicious binary – this triggers execveat /tmp/payload # 4️⃣ Cleanup rm -f /tmp/payload /tmp/payload.c -
Cleanup Commands:
# Remove residual files and unload potential audit rules (if test environment is disposable) rm -f /tmp/payload /tmp/payload.c sudo auditctl -d -a always,exit -F arch=b64 -S execveat -k qlnx_execveat sudo auditctl -d -a always,exit -F arch=b64 -S memfd_create -k qlnx_memfd sudo auditctl -d -a always,exit -F arch=b64 -S ptrace -k qlnx_ptrace