Autorunsによるマルウェア永続性分析 は何をしますか?
概要
Sysinternals Autorunsは、Windows上の数百の自動起動拡張ポイント(ASEP)からデータを抽出し、Run/RunOnceキー、サービス、スケジュールタスク、ドライバ、Winlogonエントリ、LSAプロバイダ、プリントモニタ、WMIサブスクリプション、AppInit DLLなど18以上のカテゴリをスキャンします。デジタル署名の検証により、Microsoft署名済みエントリをフィルタリングします。比較機能は、ベースラインの差分を介して新たに追加された永続性を特定します。VirusTotal統合により、ハッシュのレピュテーションをチェックします。-zフラグを使用したオフライン分析により、フォレンジックディスクイメージの検査が可能です。
使用するタイミング
- Autorunsを使用したマルウェア永続性の分析が必要なセキュリティインシデントの調査時
- このドメインに関する検出ルールや脅威ハンティングクエリを作成する場合
- SOCアナリストがこの分析タイプのための構造化された手順を必要とする場合
- 関連する攻撃手法に対するセキュリティ監視のカバレッジを検証する場合
前提条件
- Sysinternals Autoruns (GUI) および Autorunsc (CLI)
- 対象システムに対する管理者権限
- 自動分析のための Python 3.9+
- レピュテーションチェック用の VirusTotal API キー
- 比較用のクリーンなベースラインエクスポート
ワークフロー
ステップ 1: 自動永続性スキャン
#!/usr/bin/env python3
"""Autorunsベースの永続性分析を自動化。"""
import subprocess
import csv
import json
import sys
def scan_and_analyze(autorunsc_path="autorunsc64.exe", csv_path="scan.csv"):
cmd = [autorunsc_path, "-a", "*", "-c", "-h", "-s", "-nobanner", "*"]
result = subprocess.run(cmd, capture_output=True, text=True, timeout=600)
with open(csv_path, 'w') as f:
f.write(result.stdout)
return parse_and_flag(csv_path)
def parse_and_flag(csv_path):
suspicious = []
with open(csv_path, 'r', errors='replace') as f:
for row in csv.DictReader(f):
reasons = []
signer = row.get("Signer", "")
if not signer or signer == "(Not verified)":
reasons.append("署名なしバイナリ")
if not row.get("Description") and not row.get("Company"):
reasons.append("メタデータ欠落")
path = row.get("Image Path", "").lower()
for sp in ["\\temp\\", "\\appdata\\local\\temp", "\\users\\public\\"]:
if sp in path:
reasons.append(f"不審なパス")
launch = row.get("Launch String", "").lower()
for kw in ["powershell", "cmd /c", "wscript", "mshta", "regsvr32"]:
if kw in launch:
reasons.append(f"LOLBin: {kw}")
if reasons:
row["reasons"] = reasons
suspicious.append(row)
return suspicious
if __name__ == "__main__":
if len(sys.argv) > 1:
results = parse_and_flag(sys.argv[1])
print(f"[!] {len(results)} 件の不審なエントリ")
for r in results:
print(f" {r.get('Entry','')} - {r.get('Image Path','')}")
for reason in r.get('reasons', []):
print(f" - {reason}")
検証基準
- すべてのASEPカテゴリがスキャンされ、カタログ化されていること
- 署名なしエントリが調査対象としてフラグ付けされていること
- 不審なパスとLOLBin起動文字列が強調表示されていること
- ベースライン比較により、新しい永続性メカニズムが特定されていること