Communitygithub.com

分析 Linux 核心級 Rootkit

使用 Volatility3 檢測 Linux 記憶體轉儲中的核心級 Rootkit。

分析 Linux 核心級 Rootkit 是什麼?

此技能專門用於分析 Linux 核心級 Rootkit,這類惡意軟體在 ring 0 層級運作,透過修改核心資料結構來隱藏程序、檔案、網路連線和核心模組,使其逃脫使用者空間工具的檢測。主要依賴記憶體取證技術(使用 Volatility3 分析實體記憶體轉儲)以及交叉視圖分析(比對 /proc、/sys 和核心資料結構間的不一致)。支援的平台包括 Volatility3 與 Linux 核心。 技能涵蓋使用 Volatility3 Linux 外掛程式檢測系統呼叫表鉤子、隱藏核心模組和修改過的函數指標,並輔以 rkhunter 和 chkrootkit 進行即時系統掃描。先決條件包括安裝 Volatility3、取得 Linux 記憶體轉儲(透過 LiME、AVML 或 /proc/kcore)、取得匹配的核心符號表(ISF),以及具備參考用的已知良好核心映像。 使用步驟從取得記憶體轉儲開始,接著執行 Volatility3 的 linux.check_syscall、linux.lsmod、linux.hidden_modules 和 linux.check_idt 外掛,再進行交叉視圖分析,最後以 rkhunter 和 chkrootkit 掃描即時系統。產出為 JSON 報告,內含檢測到的系統呼叫鉤子、隱藏核心模組、修改的 IDT 項目、可疑的 /proc 差異以及 rkhunter 發現。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-linux-kernel-rootkits

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

分析 Linux 核心級 Rootkit 是做什麼的?

概述

Linux 核心級 Rootkit 在 ring 0 層級運作,修改核心資料結構以對使用者空間工具隱藏程序、檔案、網路連線和核心模組。檢測需要記憶體取證(使用 Volatility3 分析實體記憶體轉儲)或交叉視圖分析(比對 /proc、/sys 和核心資料結構間的不一致)。此技能涵蓋使用 Volatility3 Linux 外掛程式檢測系統呼叫表鉤子、隱藏核心模組和修改過的函數指標,並輔以 rkhunter 和 chkrootkit 進行即時系統掃描。

使用時機

  • 調查需要分析 Linux 核心級 Rootkit 的安全事件時
  • 為此領域建置檢測規則或威脅獵殺查詢時
  • SOC 分析師需要針對此分析類型的結構化程序時
  • 驗證相關攻擊技術的安全監控覆蓋範圍時

先決條件

  • 已安裝 Volatility3(pip install volatility3)
  • Linux 記憶體轉儲(透過 LiME、AVML 或 /proc/kcore 取得)
  • 符合目標核心版本的 Volatility3 Linux 符號表(ISF)
  • 用於即時系統掃描的 rkhunter 和 chkrootkit
  • 用於比對的參考用已知良好核心映像

步驟

第 1 步:取得記憶體轉儲

使用 LiME 核心模組或針對雲端實例使用 AVML 來擷取 Linux 實體記憶體。

第 2 步:使用 Volatility3 分析

執行 linux.check_syscall、linux.lsmod、linux.hidden_modules 和 linux.check_idt 外掛程式,以檢測 rootkit 痕跡。

第 3 步:交叉視圖分析

比對來自 /proc/modules、lsmod 和 /sys/module 的模組列表,以識別在某一視圖中被隱藏但在另一視圖中存在的模組。

第 4 步:即時系統掃描

執行 rkhunter 和 chkrootkit 以檢測已知的 rootkit 特徵、可疑檔案和修改過的系統二進位檔。

預期輸出

包含檢測到的系統呼叫鉤子、隱藏核心模組、修改的 IDT 項目、可疑的 /proc 差異以及 rkhunter 發現的 JSON 報告。

範例輸出

$ sudo python3 rootkit_analyzer.py --memory /evidence/linux-mem.lime --profile Ubuntu2204

Linux 核心級 Rootkit 分析報告
=====================================
記憶體映像:/evidence/linux-mem.lime
核心版本:5.15.0-91-generic (Ubuntu 22.04 LTS)
分析時間:2024-01-18 09:15:32 UTC

[+] 掃描系統呼叫表中的鉤子...
    系統呼叫表基底:0xffffffff82200300
    檢查的系統呼叫總數:449

    檢測到被鉤住的系統呼叫:
    ┌─────────┬──────────────────┬──────────────────────┬──────────────────────┐
    │ NR      │ 系統呼叫         │ 預期位址             │ 目前位址             │
    ├─────────┼──────────────────┼──────────────────────┼──────────────────────┤
    │ 0       │ sys_read         │ 0xffffffff8139a0e0   │ 0xffffffffc0a12000   │
    │ 2       │ sys_open         │ 0xffffffff8139b340   │ 0xffffffffc0a12180   │
    │ 78      │ sys_getdents64   │ 0xffffffff813f5210   │ 0xffffffffc0a12300   │
    │ 62      │ sys_kill         │ 0xffffffff8110c4a0   │ 0xffffffffc0a12480   │
    └─────────┴──────────────────┴──────────────────────┴──────────────────────┘
    警告:檢測到 4 個系統呼叫鉤子 - 確認 rootkit 行為

[+] 檢查隱藏核心模組...
    已載入模組 (lsmod):         147
    核心物件列表中的模組:        149
    隱藏模組:
      - "netfilter_helper" 位於 0xffffffffc0a10000 (大小:12288)
      - "kworker_sched"    位於 0xffffffffc0a14000 (大小:8192)

[+] 掃描 /proc 的不一致...
    task_struct 列表中的程序:234
    /proc 中可見的程序:   231
    隱藏程序:
      - PID 31337  指令:「[kworker/0:3]」   (偽裝成核心執行緒)
      - PID 31442  指令:「rsyslogd」         (偽造,真正的 rsyslogd 是 PID 892)
      - PID 31500  指令:「」                 (無名程序)

[+] 檢查 IDT 項目...
    掃描的 IDT 項目:256
    修改的項目:0 (乾淨)

[+] 執行 rkhunter 掃描...
    檢查已知 rootkit:        已檢查 68 種變體
    Diamorphine rootkit:    警告 - 特徵相符
    系統二進位檔檢查:
      /usr/bin/ps:     已修改 (SHA-256 不符)
      /usr/bin/netstat:已修改 (SHA-256 不符)
      /usr/bin/ls:     已修改 (SHA-256 不符)
      /usr/sbin/ss:    正常

[+] 網路分析...
    隱藏的連線(不在 /proc/net/tcp 中):
      ESTABLISHED  0.0.0.0:0 -> 198.51.100.47:4443 (PID 31337)
      ESTABLISHED  0.0.0.0:0 -> 198.51.100.47:8080 (PID 31442)

摘要:
  Rootkit 類型:        可載入核心模組 (LKM)
  可能家族:            Diamorphine 變體
  系統呼叫鉤子:        4 個 (read, open, getdents64, kill)
  隱藏模組:        2 個
  隱藏程序:        3 個
  隱藏連線:        2 個 (C2:198.51.100.47)
  修改的二進位檔:    3 個 (/usr/bin/ps, netstat, ls)
  風險等級:           嚴重

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

相關技能