Communitygithub.com

Linux 지속성 메커니즘 분석

Linux 시스템에서 crontab/systemd 항목, LD_PRELOAD 인젝션, 셸 프로파일 수정(.bashrc, .profile), SSH authorized_keys 백도어 등 지속성 메커니즘을 스캔하고, auditd 로그와 상관 분석하여 설치 타임라인을 생성합니다. 침해 대응 또는 위협 헌팅 시 사용하여 공격자가 손상된 Linux 호스트에 대한 접근을 유지한 방법을 탐지하거나 확인할 수 있습니다.

Linux 지속성 메커니즘 분석란 무엇인가요?

이 스킬은 Linux 시스템에서 공격자가 사용하는 다양한 지속성 메커니즘을 체계적으로 분석합니다. crontab 작업, systemd 서비스/타이머 유닛, LD_PRELOAD 라이브러리 인젝션, 셸 프로파일(.bashrc, .profile) 변조, SSH authorized_keys 백도어, init 스크립트 조작 등 모든 알려진 지속성 벡터를 스캔합니다. 파일 타임스탬프와 무결성을 확인하고 auditd 로그와 상관 분석하여 지속성 설치 타임라인을 구축함으로써 언제, 어떻게 공격자가 시스템에 접근을 유지했는지 파악할 수 있습니다. 침해 대응(Incident Response) 및 위협 헌팅(Threat Hunting) 시나리오에 최적화되어 있으며, 최종적으로 리스크 점수가 매겨진 JSON 보고서와 MITRE ATT&CK 기술 매핑(T1053, T1543, T1574, T1546)을 제공합니다. 파이썬 3.8+ 표준 라이브러리만으로 동작하며, auditd가 파일 감시 규칙과 함께 구성되어 있어야 합니다.

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

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

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

문서

Linux 지속성 메커니즘 분석은(는) 무엇을 하나요?

개요

공격자는 crontab 작업, systemd 서비스/타이머 유닛, LD_PRELOAD 라이브러리 인젝션, 셸 프로파일 수정(.bashrc, .profile), SSH authorized_keys 백도어, init 스크립트 조작을 통해 Linux 시스템에 지속성을 확보합니다. 이 스킬은 모든 알려진 지속성 벡터를 스캔하고, 파일 타임스탬프와 무결성을 확인하며, auditd 로그와 상관 분석하여 지속성 설치 타임라인을 구축합니다.

사용 시기

  • 보안 인시던트 조사 시 Linux 지속성 메커니즘 분석이 필요할 때
  • 이 도메인에 대한 탐지 규칙 또는 위협 헌팅 쿼리를 구축할 때
  • SOC 분석가가 이 분석 유형에 대한 체계적인 절차가 필요할 때
  • 관련 공격 기술에 대한 보안 모니터링 범위를 검증할 때

사전 요구 사항

  • 대상 Linux 시스템에 대한 루트 또는 sudo 접근 권한 (또는 포렌식 이미지)
  • 지속성 경로에 파일 감시 규칙이 설정된 auditd
  • Python 3.8+ (표준 라이브러리: os, subprocess, json)
  • 선택 사항: 파일 무결성 모니터링 알림을 위한 OSSEC/Wazuh 에이전트

단계

  1. Crontab 항목 스캔 — 모든 사용자 crontab, /etc/cron.d/, /etc/cron.daily/, anacron 작업을 열거하여 의심스러운 명령어 확인
  2. Systemd 유닛 감사 — /etc/systemd/system/ 및 ~/.config/systemd/user/에서 패키지로 관리되지 않는 서비스 및 타이머 유닛 확인
  3. LD_PRELOAD 하이재킹 탐지 — /etc/ld.so.preload 및 LD_PRELOAD 환경 변수에서 인젝션된 공유 라이브러리 확인
  4. 셸 프로파일 검사 — .bashrc, .bash_profile, .profile, /etc/profile.d/에서 인젝션된 명령어 또는 리버스 셸 스캔
  5. SSH Authorized Keys 확인 — 모든 authorized_keys 파일에서 명령어 제한이 있는 무단 공개 키 감사
  6. Auditd 로그 상관 분석 — 지속성 경로의 파일 수정 이벤트에 대해 auditd 로그 검색하여 설치 타임라인 구축
  7. 지속성 보고서 생성 — 발견된 모든 지속성 메커니즘에 대한 리스크 점수 보고서 생성

예상 출력

  • 발견된 모든 지속성 메커니즘에 대한 리스크 점수가 포함된 JSON 보고서
  • auditd 상관 분석을 통한 지속성 설치 타임라인
  • MITRE ATT&CK 기술 매핑 (T1053, T1543, T1574, T1546)
  • 탐지된 각 지속성 메커니즘에 대한 복구 명령어

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,

관련 스킬