Communitygithub.com

SplunkにおけるWindowsイベントログ分析

SOCアナリストやインシデントレスポンダーが、Splunk上でWindowsイベントログ(セキュリティ、システム、Sysmon)を分析し、認証攻撃、特権昇格、永続化、横断的移動などの脅威を検出・調査するためのスキルです。

SplunkにおけるWindowsイベントログ分析 とは?

このスキルは、Splunk SIEM上でWindowsイベントログ(WinEventLog:Security, System, Microsoft-Windows-Sysmon/Operational)を分析するための包括的な手法を提供します。SOCアナリストやインシデントレスポンダーは、ブルートフォース認証、パスワードスプレー、特権昇格(新規管理者アカウント作成、トークン操作)、永続化(スケジュールタスク、レジストリRunキー変更、WMIイベントサブスクリプション)、横断的移動(SMB共有、PsExec、RDP)など、実際の攻撃シナリオに対応したSPLクエリを利用できます。Sysmonのイベントコード(プロセス作成、ネットワーク接続、ファイル作成、レジストリ変更)とWindowsセキュリティイベントID(4624、4625、4688、4698、4720など)を組み合わせた検出ロジックに加え、フォレンジックタイムラインの構築やルックアップテーブルによるイベントコードのコンテキスト付与もサポートします。また、Kerberoasting、DCSync、ゴールデンチケット、Pass-the-Hash、DLLサイドローディングなどの一般的な攻撃シナリオにも対応しており、アウトプットはホスト単位のレポート形式でATT&CKフレームワークとのマッピングを提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-windows-event-logs-in-splunk

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

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

ドキュメント

SplunkにおけるWindowsイベントログ分析 は何をしますか?

使用タイミング

以下の状況でこのスキルを使用します:

  • SOCアナリストが、Windows認証、プロセス実行、AD変更に関連するアラートを調査する場合
  • 検知エンジニアが、Windowsベースの脅威検知のためのSPLクエリを構築する場合
  • インシデントレスポンダーが、Windowsエンドポイントやドメインコントローラーのフォレンジックタイムラインを必要とする場合
  • 定期的な脅威ハンティングがWindows固有のATT&CK手法を対象としている場合

使用すべきでないケース: Linux/macOSエンドポイントの分析や、ネットワークのみの調査には使用しないでください。

前提条件

  • SplunkにWindowsイベントログデータが取り込まれていること(sourcetype WinEventLog:Security、WinEventLog:System、XmlWinEventLog:Microsoft-Windows-Sysmon/Operational)
  • エンドポイントにSysmonがデプロイされ、SwiftOnSecurityまたはOlaf Hartongの設定が適用されていること
  • エンドポイントおよび認証データモデルに対してCIMデータモデルの加速化が有効であること
  • WindowsセキュリティイベントIDおよびSysmonイベントタイプに関する知識があること

ワークフロー

ステップ1:認証攻撃の検出

ブルートフォース検出(イベントコード4625 — ログオン失敗):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4625
| stats count, dc(TargetUserName) AS unique_users, values(TargetUserName) AS targeted_users
  by src_ip, Logon_Type, Status
| where count > 20
| eval attack_type = case(
    Logon_Type=3, "Network Brute Force",
    Logon_Type=10, "RDP Brute Force",
    Logon_Type=2, "Interactive Brute Force",
    1=1, "Other"
  )
| eval status_meaning = case(
    Status="0xc000006d", "Bad Username or Password",
    Status="0xc000006a", "Incorrect Password (valid user)",
    Status="0xc0000234", "Account Locked Out",
    Status="0xc0000072", "Account Disabled",
    1=1, Status
  )
| sort - count
| table src_ip, attack_type, status_meaning, count, unique_users, targeted_users

パスワードスプレー検出:

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4625 Logon_Type=3
| bin _time span=10m
| stats dc(TargetUserName) AS unique_users, count AS total_attempts,
  values(TargetUserName) AS users_targeted by src_ip, _time
| where unique_users > 10 AND total_attempts < unique_users * 3
| eval spray_confidence = if(unique_users > 25, "HIGH", "MEDIUM")

失敗後の正常ログオン(侵害の兆候):

index=wineventlog sourcetype="WinEventLog:Security"
(EventCode=4625 OR EventCode=4624) src_ip!="127.0.0.1"
| sort _time
| stats earliest(_time) AS first_seen, latest(_time) AS last_seen,
  sum(eval(if(EventCode=4625,1,0))) AS failures,
  sum(eval(if(EventCode=4624,1,0))) AS successes
  by src_ip, TargetUserName, ComputerName
| where failures > 10 AND successes > 0
| eval time_to_success = round((last_seen - first_seen)/60, 1)
| sort - failures

ステップ2:特権昇格の検出

新しい管理者アカウントの作成(T1136.001):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4720
| join TargetUserName type=left [
    search index=wineventlog EventCode=4732 TargetUserName="Administrators"
    | rename MemberName AS TargetUserName
  ]
| table _time, SubjectUserName, TargetUserName, ComputerName
| eval alert = "新しいアカウントが作成され、Administratorsグループに追加されました"

特別な特権の割り当て(イベントコード4672):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4672
SubjectUserName!="SYSTEM" SubjectUserName!="LOCAL SERVICE" SubjectUserName!="NETWORK SERVICE"
| stats count, values(PrivilegeList) AS privileges by SubjectUserName, ComputerName
| where count > 0
| search privileges IN ("SeDebugPrivilege", "SeTcbPrivilege", "SeBackupPrivilege",
  "SeRestorePrivilege", "SeAssignPrimaryTokenPrivilege")

トークン操作の検出(T1134):

index=sysmon EventCode=10 TargetImage="*\\lsass.exe"
GrantedAccess IN ("0x1010", "0x1038", "0x1fffff", "0x40")
| stats count by SourceImage, SourceUser, Computer, GrantedAccess
| where NOT match(SourceImage, "(svchost|csrss|wininit|MsMpEng|CrowdStrike)")
| sort - count

ステップ3:永続化メカニズムの検出

スケジュールタスクの作成(T1053.005):

index=wineventlog (sourcetype="WinEventLog:Security" EventCode=4698)
  OR (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
      Image="*\\schtasks.exe")
| eval task_info = coalesce(TaskContent, CommandLine)
| search task_info="*powershell*" OR task_info="*cmd*" OR task_info="*http*" OR task_info="*\\Temp\\*"
| table _time, Computer, SubjectUserName, TaskName, task_info

レジストリRunキーの変更(T1547.001):

index=sysmon EventCode=13
TargetObject IN (
  "*\\CurrentVersion\\Run\\*",
  "*\\CurrentVersion\\RunOnce\\*",
  "*\\CurrentVersion\\RunServices\\*",
  "*\\Explorer\\Shell Folders\\*"
)
| stats count by Computer, Image, TargetObject, Details
| where NOT match(Image, "(explorer\.exe|msiexec\.exe|setup\.exe)")
| sort - count

WMIイベントサブスクリプション(T1546.003):

index=sysmon EventCode=20 OR EventCode=21
| stats count by Computer, Operation, Consumer, EventNamespace
| where count > 0

ステップ4:横断的移動の検出

リモートサービスの悪用(T1021.002 — SMB/Windows管理共有):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4624 Logon_Type=3
| stats dc(ComputerName) AS unique_destinations, values(ComputerName) AS targets
  by src_ip, TargetUserName
| where unique_destinations > 3
| sort - unique_destinations
| table src_ip, TargetUserName, unique_destinations, targets

PsExecの検出(T1021.002):

index=sysmon EventCode=1
(Image="*\\psexec.exe" OR Image="*\\psexesvc.exe"
 OR ParentImage="*\\psexesvc.exe"
 OR OriginalFileName="psexec.c")
| table _time, Computer, User, ParentImage, Image, CommandLine

RDPによる横断的移動(T1021.001):

index=wineventlog sourcetype="WinEventLog:Security" EventCode=4624 Logon_Type=10
| stats count, dc(ComputerName) AS rdp_targets, values(ComputerName) AS destinations
  by src_ip, TargetUserName
| where rdp_targets > 2
| sort - rdp_targets

ステップ5:フォレンジックタイムラインの構築

侵害されたホストの包括的なタイムラインを作成します:

(index=wineventlog OR index=sysmon) Computer="WORKSTATION-042"
earliest="2024-03-14T00:00:00" latest="2024-03-16T00:00:00"
| eval event_description = case(
    EventCode=4624, "Logon: ".TargetUserName." (Type ".Logon_Type.")",
    EventCode=4625, "Failed Logon: ".TargetUserName,
    EventCode=4688 OR (sourcetype="XmlWinEventLog:*Sysmon*" AND EventCode=1),
      "Process: ".Image." CMD: ".CommandLine,
    EventCode=4698, "Scheduled Task: ".TaskName,
    EventCode=3, "Network: ".DestinationIp.":".DestinationPort,
    EventCode=11, "File Created: ".TargetFilename,
    EventCode=13, "Registry: ".TargetObject,
    1=1, "Event ".EventCode
  )
| sort _time
| table _time, EventCode, event_description, User, src_ip

ステップ6:エンリッチメント用ルックアップテーブルの作成

WindowsイベントIDのコンテキスト用のルックアップを作成します:

| inputlookup windows_eventcode_lookup.csv
| table EventCode, Description, ATT_CK_Technique, Severity

ルックアップが存在しない場合は作成します:

EventCode,Description,ATT_CK_Technique,Severity
4624,Successful Logon,T1078,Informational
4625,Failed Logon,T1110,Low
4648,Explicit Credential Logon,T1078,Medium
4672,Special Privileges Assigned,T1134,Medium
4688,New Process Created,T1059,Informational
4698,Scheduled Task Created,T1053.005,Medium
4720,User Account Created,T1136.001,High
4732,Member Added to Security Group,T1098,High
4768,Kerberos TGT Requested,T1558,Informational
4769,Kerberos Service Ticket,T1558.003,Low
4771,Kerberos Pre-Auth Failed,T1110,Low

主要な概念

用語定義
イベントコード4624正常なログオンイベント — Logon_Type 2(インタラクティブ)、3(ネットワーク)、10(RDP)、7(ロック解除)
イベントコード4625ログオン失敗イベント — ステータスコードにより失敗理由(パスワード誤り、アカウントロック、無効など)を示す
Sysmonイベントコード1完全なコマンドライン、親プロセス、ハッシュ情報を含むプロセス作成
Sysmonイベントコード3プロセスが開始したネットワーク接続 — 送信元/宛先IP、ポート、プロセスコンテキスト
ログオンタイプ3ネットワークログオン(SMB、WMI、PowerShell Remoting) — 横断的移動の主要な指標
ログオンタイプ10RDP/ターミナルサービスによるリモートインタラクティブログオン

ツールとシステム

  • Splunk Enterprise: SPLクエリエンジンを備えたSIEMプラットフォーム。Windowsイベントログの分析と相関に使用
  • Sysmon(システムモニター): Microsoft Sysinternalsツール。プロセス、ネットワーク、ファイルアクティビティの詳細なログを提供
  • Splunk CIM: 共通情報モデル。Windowsイベントを正規化されたフィールドにマッピングし、クロスソースクエリを実現
  • Windowsイベント転送(WEF): Windowsに組み込まれたメカニズム。イベントログをコレクターサーバーに集中化

一般的なシナリオ

  • Kerberoasting(T1558.003): 暗号化タイプ0x17(RC4)を使用したイベントコード4769を、非標準サービスアカウントについて検出
  • DCSync(T1003.006): DS-Replication-Get-Changesを含むイベントコード4662を、非DC送信元から検出
  • ゴールデンチケット(T1558.001): 異常なチケットプロパティ(長い有効期間、非標準の暗号化)を持つイベントコード4769を検出
  • Pass-the-Hash(T1550.002): 予期しない送信元からのNTLM認証を伴うイベントコード4624(ログオンタイプ3)を検出
  • DLLサイドローディング(T1574.002): 正規プロセスによって読み込まれた署名なしDLLを示すSysmonイベントコード7を検出

出力形式

Windowsイベントログ分析 — ホスト: WORKSTATION-042
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
期間:     2024-03-14 ~ 2024-03-15
イベント数: 12,847 件(セキュリティ: 9,231 | Sysmon: 3,616)

認証サマリー:
  正常ログオン(4624):    487(タイプ3: 312、タイプ10: 45、タイプ2: 130)
  失敗ログオン(4625):    847(192.168.1.105から — ブルートフォース)
  明示的資格情報(4648):   12

疑わしい発見:
  [高]   192.168.1.105から847回の失敗ログオンの後、14:35に正常ログオン
  [高]   14:38に新しいユーザー「backdoor_admin」が作成(4720)
  [高]   14:38にユーザーがAdministratorsグループに追加(4732)
  [中]   14:42にschtasks.exeが永続化タスクを作成
  [中]   14:45にPowerShellエンコードコマンドの実行

ATT&CKマッピング:
  T1110.001 — パスワード推測(847回の失敗ログオン)
  T1136.001 — ローカルアカウント作成(backdoor_admin)
  T1053.005 — スケジュールタスク(永続化)
  T1059.001 — PowerShell(エンコード実行)

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,

関連スキル