Communitygithub.com

サプライチェーン・マルウェアアーティファクト分析

トロイの木馬化されたソフトウェアを含むサプライチェーン攻撃のアーティファクトを調査します。

サプライチェーン・マルウェアアーティファクト分析 とは?

このスキルは、サプライチェーン攻撃に用いられるマルウェアアーティファクトの分析手順を提供します。SolarWinds SUNBURSTや3CX SmoothOperatorなどの攻撃事例で見られるように、正規のソフトウェア配信チャネルを悪用したマルウェアの注入や改変を検出するための手法を網羅しています。具体的には、バイナリ比較分析、コード署名の異常検知、注入されたコードの特定、感染経路の追跡を行います。対応するプラットフォームはPythonベースのツール群で、pefile、ssdeep、hashlibなどのライブラリを使用します。このスキルを用いることで、SOCアナリストやセキュリティエンジニアは、トロイの木馬化されたバイナリと正規バージョンの違いを体系的に比較し、検出ルールの作成や脅威ハンティングに必要なIoCを抽出できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-supply-chain-malware-artifacts

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

サプライチェーン・マルウェアアーティファクトの分析

概要

サプライチェーン攻撃は、正規のソフトウェア配信チャネルを侵害し、信頼された更新メカニズムを通じてマルウェアを配信します。代表的な例として、SolarWinds SUNBURST(2020年、18,000以上の顧客に影響)、3CX SmoothOperator(2023年、Trading Technologiesに端を発する連鎖的なサプライチェーン攻撃)、および数多くのnpm/PyPIパッケージポイズニングキャンペーンが挙げられます。分析では、トロイの木馬化されたバイナリと正規バージョンの比較、ビルドアーティファクトへの注入コードの特定、コード署名の異常の調査、および初期侵害からペイロード配信に至る感染チェーンの追跡を行います。2025年時点で、サプライチェーン攻撃はすべての侵害の30%を占めており、これは前年比で100%の増加です。

使用すべき場面

  • サプライチェーンマルウェアのアーティファクト分析が必要なセキュリティインシデントを調査する場合
  • このドメイン向けの検出ルールや脅威ハンティングクエリを作成する場合
  • SOCアナリストがこの分析タイプの構造化された手順を必要とする場合
  • 関連する攻撃手法に対するセキュリティ監視のカバレッジを検証する場合

前提条件

  • Python 3.9以上(pefile、ssdeep、hashlib がインストールされていること)
  • バイナリ差分ツール(BinDiff、Diaphora)
  • コード署名検証ツール(sigcheck、codesign)
  • ソフトウェア構成分析(SCA)ツール
  • 比較用の正規ソフトウェアバージョンへのアクセス
  • パッケージリポジトリの監視(npm、PyPI、NuGet)

ワークフロー

ステップ1: バイナリ比較分析

#!/usr/bin/env python3
"""トロイの木馬化されたバイナリを正規バージョンと比較します。"""
import hashlib
import pefile
import sys
import json


def compare_pe_files(legitimate_path, suspect_path):
    """正規バージョンと疑わしいバージョンのPEファイル構造を比較します。"""
    legit_pe = pefile.PE(legitimate_path)
    suspect_pe = pefile.PE(suspect_path)

    report = {"differences": [], "suspicious_sections": [], "import_changes": []}

    # セクションの比較
    legit_sections = {s.Name.rstrip(b'\x00').decode(): {
        "size": s.SizeOfRawData,
        "entropy": s.get_entropy(),
        "characteristics": s.Characteristics,
    } for s in legit_pe.sections}

    suspect_sections = {s.Name.rstrip(b'\x00').decode(): {
        "size": s.SizeOfRawData,
        "entropy": s.get_entropy(),
        "characteristics": s.Characteristics,
    } for s in suspect_pe.sections}

    # 新しく追加または変更されたセクションを検出
    for name, props in suspect_sections.items():
        if name not in legit_sections:
            report["suspicious_sections"].append({
                "name": name, "reason": "正規バージョンにない新しいセクション",
                "size": props["size"], "entropy": round(props["entropy"], 2),
            })
        elif abs(props["size"] - legit_sections[name]["size"]) > 1024:
            report["suspicious_sections"].append({
                "name": name, "reason": "セクションサイズが大幅に変更",
                "legit_size": legit_sections[name]["size"],
                "suspect_size": props["size"],
            })

    # インポートの比較
    legit_imports = set()
    if hasattr(legit_pe, 'DIRECTORY_ENTRY_IMPORT'):
        for entry in legit_pe.DIRECTORY_ENTRY_IMPORT:
            for imp in entry.imports:
                if imp.name:
                    legit_imports.add(f"{entry.dll.decode()}!{imp.name.decode()}")

    suspect_imports = set()
    if hasattr(suspect_pe, 'DIRECTORY_ENTRY_IMPORT'):
        for entry in suspect_pe.DIRECTORY_ENTRY_IMPORT:
            for imp in entry.imports:
                if imp.name:
                    suspect_imports.add(f"{entry.dll.decode()}!{imp.name.decode()}")

    new_imports = suspect_imports - legit_imports
    if new_imports:
        report["import_changes"] = list(new_imports)

    # コード署名の確認
    report["legit_signed"] = bool(legit_pe.OPTIONAL_HEADER.DATA_DIRECTORY[4].Size)
    report["suspect_signed"] = bool(suspect_pe.OPTIONAL_HEADER.DATA_DIRECTORY[4].Size)

    return report


def hash_file(filepath):
    """ファイルの複数のハッシュ値を計算します。"""
    hashes = {}
    with open(filepath, 'rb') as f:
        data = f.read()
    for algo in ['md5', 'sha1', 'sha256']:
        h = hashlib.new(algo)
        h.update(data)
        hashes[algo] = h.hexdigest()
    return hashes


if __name__ == "__main__":
    if len(sys.argv) < 3:
        print(f"Usage: {sys.argv[0]} <legitimate_binary> <suspect_binary>")
        sys.exit(1)
    report = compare_pe_files(sys.argv[1], sys.argv[2])
    print(json.dumps(report, indent=2))

検証基準

  • バイナリ差分によりトロイの木馬化されたコンポーネントが特定されている
  • 注入されたコードが分離され、個別に分析されている
  • コード署名の異常が文書化されている
  • ビルドアーティファクトから感染のタイムラインが再構築されている
  • 影響を受けたシステム全体でのダウンストリーム影響範囲が評価されている
  • 検出およびブロックのためにIoCが抽出されている

参考文献

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,

関連スキル