Communitygithub.com

리눅스 커널 루트킷 분석

Volatility3를 사용하여 리눅스 메모리 덤프에서 커널 수준 루트킷을 탐지합니다.

리눅스 커널 루트킷 분석란 무엇인가요?

이 스킬은 리눅스 커널 루트킷 탐지를 위한 종합적인 가이드를 제공합니다. 커널 루트킷은 ring 0에서 동작하며 프로세스, 파일, 네트워크 연결, 커널 모듈을 사용자 공간 도구로부터 숨기기 위해 커널 데이터 구조를 수정합니다. 이 스킬은 Volatility3 리눅스 플러그인을 활용하여 시스템 콜 테이블 후킹, 숨겨진 커널 모듈, 변조된 함수 포인터를 탐지하는 방법을 다루며, rkhunter와 chkrootkit을 통한 라이브 시스템 스캔을 보조로 사용합니다. 지원 플랫폼은 LiME, AVML, /proc/kcore로 수집된 리눅스 메모리 덤프를 분석하는 모든 시스템입니다. 단계별 접근 방식으로 메모리 덤프 수집, Volatility3 분석, 교차 뷰 분석, 라이브 시스템 스캔을 수행하여 JSON 보고서로 결과를 출력합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-linux-kernel-rootkits

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

리눅스 커널 루트킷 분석은(는) 무엇을 하나요?

개요

리눅스 커널 루트킷은 ring 0에서 동작하며, 커널 데이터 구조를 수정하여 프로세스, 파일, 네트워크 연결, 커널 모듈을 사용자 공간 도구로부터 숨깁니다. 탐지 방법에는 메모리 포렌식(Volatility3로 물리 메모리 덤프 분석) 또는 교차 뷰 분석(/proc, /sys, 커널 데이터 구조 간 불일치 비교)이 있습니다. 이 스킬은 Volatility3 리눅스 플러그인을 사용하여 시스템 콜 테이블 후크, 숨겨진 커널 모듈, 변조된 함수 포인터를 탐지하는 방법을 다루며, rkhunter 및 chkrootkit을 사용한 라이브 시스템 스캔을 보조로 합니다.

사용 시점

  • 리눅스 커널 루트킷 분석이 필요한 보안 사고를 조사할 때
  • 이 도메인에 대한 탐지 규칙 또는 위협 헌팅 쿼리를 구축할 때
  • SOC 분석가가 이 분석 유형에 대한 구조화된 절차가 필요할 때
  • 관련 공격 기술에 대한 보안 모니터링 적용 범위를 검증할 때

전제 조건

  • Volatility3 설치 (pip install volatility3)
  • 리눅스 메모리 덤프 (LiME, AVML, 또는 /proc/kcore로 획득)
  • 대상 커널 버전과 일치하는 Volatility3 리눅스 심볼 테이블 (ISF)
  • 라이브 시스템 스캔을 위한 rkhunter 및 chkrootkit
  • 비교를 위한 알려진 정상 커널 이미지 참조

단계

1단계: 메모리 덤프 획득

LiME 커널 모듈 또는 클라우드 인스턴스용 AVML을 사용하여 리눅스 물리 메모리를 캡처합니다.

2단계: Volatility3로 분석

linux.check_syscall, linux.lsmod, linux.hidden_modules, linux.check_idt 플러그인을 실행하여 루트킷 아티팩트를 탐지합니다.

3단계: 교차 뷰 분석

/proc/modules, lsmod, /sys/module의 모듈 목록을 비교하여 한 뷰에서는 숨겨져 있지만 다른 뷰에서는 나타나는 모듈을 식별합니다.

4단계: 라이브 시스템 스캔

rkhunter와 chkrootkit을 실행하여 알려진 루트킷 서명, 의심스러운 파일, 변조된 시스템 바이너리를 탐지합니다.

예상 출력

탐지된 시스템 콜 후크, 숨겨진 커널 모듈, 변조된 IDT 항목, 의심스러운 /proc 불일치, rkhunter 결과를 포함한 JSON 보고서.

예시 출력

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

Linux Kernel Rootkit Analysis Report
=====================================
Memory Image: /evidence/linux-mem.lime
Kernel Version: 5.15.0-91-generic (Ubuntu 22.04 LTS)
Analysis Time: 2024-01-18 09:15:32 UTC

[+] 시스템 콜 테이블 후크 스캔 중...
    시스템 콜 테이블 베이스: 0xffffffff82200300
    확인된 총 시스템 콜 수: 449

    후킹된 시스템 콜 탐지:
    ┌─────────┬──────────────────┬──────────────────────┬──────────────────────┐
    │ NR      │ Syscall          │ 예상 주소            │ 현재 주소            │
    ├─────────┼──────────────────┼──────────────────────┼──────────────────────┤
    │ 0       │ sys_read         │ 0xffffffff8139a0e0   │ 0xffffffffc0a12000   │
    │ 2       │ sys_open         │ 0xffffffff8139b340   │ 0xffffffffc0a12180   │
    │ 78      │ sys_getdents64   │ 0xffffffff813f5210   │ 0xffffffffc0a12300   │
    │ 62      │ sys_kill         │ 0xffffffff8110c4a0   │ 0xffffffffc0a12480   │
    └─────────┴──────────────────┴──────────────────────┴──────────────────────┘
    경고: 4개의 시스템 콜 후크 탐지 - 루트킷 행동 확인됨

[+] 숨겨진 커널 모듈 확인 중...
    로드된 모듈 (lsmod):         147
    kobject 목록의 모듈:        149
    숨겨진 모듈:
      - "netfilter_helper" at 0xffffffffc0a10000 (크기: 12288)
      - "kworker_sched"    at 0xffffffffc0a14000 (크기: 8192)

[+] /proc 불일치 스캔 중...
    task_struct 목록의 프로세스: 234
    /proc에서 보이는 프로세스:   231
    숨겨진 프로세스:
      - PID 31337  cmd: "[kworker/0:3]"   (커널 스레드로 위장)
      - PID 31442  cmd: "rsyslogd"         (가짜, 실제 rsyslogd는 PID 892)
      - PID 31500  cmd: ""                 (이름 없는 프로세스)

[+] IDT 항목 확인 중...
    스캔된 IDT 항목: 256
    변조된 항목: 0 (깨끗함)

[+] rkhunter 스캔 실행 중...
    알려진 루트킷 확인 중:        68개 변종 확인
    Diamorphine 루트킷:                경고 - 서명 일치
    시스템 바이너리 확인:
      /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)

요약:
  루트킷 유형:         로드 가능한 커널 모듈 (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,

관련 스킬