detecting-evasion-techniques-in-endpoint-logs について
Windows の防御回避を調査するセキュリティ担当者向けのエンドポイントログ分析スキルです。ログ改ざん、プロセスインジェクション、セキュリティツールの無効化、偽装、LOLBin の悪用を扱い、複数の兆候の相関を促します。
主な機能
- 01ログ消去とタイムスタンプ改ざんを検出
- 02不審なプロセスインジェクションを分析
- 03セキュリティツールの無効化を特定
- 04偽装と LOLBin の悪用を発見
- 05イベントを相関して検出精度を高める
活用シーン
- 01エンドポイントテレメトリで防御回避を調査
- 02無効化・回避されたセキュリティツールの調査
- 03エンドポイント検出ルールの作成と相関
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill detecting-evasion-techniques-in-endpoint-logsインストール後、Claude Code で/detecting-evasion-techniques-in-endpoint-logsを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
LICENSEassets/template.mdreferences/api-reference.mdstandards.mdworkflows.mdscripts/agent.pyprocess.py詳細
エンドポイントログにおける回避技術の検出
使用するタイミング
このスキルは次の場合に使用します:
- エンドポイントのテレメトリで敵対者による防御回避技術(MITRE ATT&CK TA0005)を探索する場合
- 一般的な回避手法(プロセスインジェクション、タイムスタンプ改ざん、ログ消去)向けの検出ルールを作成する場合
- 敵対者がセキュリティツールを無効化またはバイパスしたインシデントを調査する場合
- 環境寄生型バイナリ(LOLBin)の悪用の兆候についてエンドポイントログを分析する場合
このスキルは、ネットワークレベルの回避(ネットワークトラフィック分析を使用してください)やマルウェアのリバースエンジニアリングには使用しないでください。
前提条件
- 包括的なログ記録ルールで設定された Sysmon のインストール(SwiftOnSecurity または Olaf Hartong の設定)
- 高度な監査ポリシーが有効化された Windows セキュリティイベントログ
- EDR テレメトリ(CrowdStrike、SentinelOne、Microsoft Defender for Endpoint)
- ログ相関のための SIEM プラットフォーム(Splunk、Elastic、Sentinel)
- 技術リファレンスとしての MITRE ATT&CK Enterprise マトリクス
ワークフロー
ステップ 1: ログの改ざんを検出する(T1070)
Windows イベントログの消去(T1070.001):
# Sysmon Event ID 1 (Process Create) for wevtutil
EventID: 1
CommandLine contains: "wevtutil cl" OR "wevtutil clear-log"
# Security Event ID 1102 - Audit log was cleared
EventID: 1102
Source: Microsoft-Windows-Eventlog
# System Event ID 104 - Event log was cleared
EventID: 104
# PowerShell log clearing
EventID: 1 (Sysmon)
CommandLine contains: "Clear-EventLog" OR "Remove-EventLog"
# Splunk query:
index=windows (EventCode=1102 OR EventCode=104)
OR (EventCode=1 CommandLine="*wevtutil*cl*")
OR (EventCode=1 CommandLine="*Clear-EventLog*")
| table _time host user CommandLine EventCode
タイムスタンプの改ざん(T1070.006):
# Sysmon Event ID 2 - File creation time changed
EventID: 2
# Look for creation times set far in the past on recently-written files
# Correlate with Event ID 11 (FileCreate) - if FileCreate is recent but
# creation time in Event ID 2 is old, timestomping is likely
# MDE Advanced Hunting (KQL):
DeviceFileEvents
| where ActionType == "FileTimestampModified"
| where Timestamp > ago(7d)
| extend TimeDiff = datetime_diff('day', Timestamp, ReportedFileCreationTime)
| where TimeDiff > 30
| project Timestamp, DeviceName, FileName, FolderPath,
ReportedFileCreationTime, InitiatingProcessFileName
ステップ 2: プロセスインジェクションを検出する(T1055)
# Sysmon Event ID 8 - CreateRemoteThread
EventID: 8
# Alert when source process is unusual (not system processes)
# Filter out known legitimate: antivirus, debugging tools
SourceImage NOT IN ("C:\Windows\System32\csrss.exe",
"C:\Windows\System32\lsass.exe")
# Sysmon Event ID 10 - ProcessAccess with suspicious access masks
EventID: 10
GrantedAccess contains: "0x1F0FFF" OR "0x1FFFFF" OR "0x001F0FFF"
# PROCESS_ALL_ACCESS = 0x1F0FFF (common in injection)
# Filter legitimate: AV accessing all processes
# Sysmon Event ID 25 - Process Tampering
EventID: 25
Type: "Image is replaced" # Process hollowing indicator
# Splunk detection:
index=sysmon EventCode=8
| where NOT match(SourceImage, "(?i)(csrss|svchost|MsMpEng|defender)")
| stats count by SourceImage TargetImage host
| where count < 5
| sort - count
ステップ 3: セキュリティツールの無効化を検出する(T1562)
# Service stopped events for security services
EventID: 7045 (new service) OR 7036 (service state change)
ServiceName IN ("WinDefend", "Sense", "CrowdStrike Falcon Sensor",
"SentinelAgent", "csagent", "MBAMService")
# Sysmon Event ID 1 - Processes that disable Defender
CommandLine contains: "Set-MpPreference -DisableRealtimeMonitoring"
OR "sc stop WinDefend"
OR "sc config WinDefend start= disabled"
OR "net stop" AND ("windefend" OR "sense" OR "csagent")
# Registry modification to disable security features
# Sysmon Event ID 13 - Registry value set
TargetObject contains: "DisableAntiSpyware"
OR "DisableRealtimeMonitoring"
OR "DisableBehaviorMonitoring"
Details: "DWORD (0x00000001)"
# MDE KQL:
DeviceRegistryEvents
| where RegistryValueName in ("DisableAntiSpyware", "DisableRealtimeMonitoring")
| where RegistryValueData == "1"
| project Timestamp, DeviceName, RegistryKey, InitiatingProcessFileName
ステップ 4: マスカレード(偽装)を検出する(T1036)
# Sysmon Event ID 1 - Process with legitimate name from unusual path
EventID: 1
Image contains: "svchost.exe" AND Image NOT starts with: "C:\Windows\System32\"
Image contains: "csrss.exe" AND Image NOT starts with: "C:\Windows\System32\"
Image contains: "lsass.exe" AND Image NOT starts with: "C:\Windows\System32\"
# Process name mismatch (original filename vs. current name)
# Sysmon captures OriginalFileName from PE header
EventID: 1
OriginalFileName != (parsed filename from Image path)
# Double extension files
EventID: 11 (FileCreate)
TargetFilename matches: "*\.pdf\.exe" OR "*\.doc\.exe" OR "*\.jpg\.exe"
# Splunk:
index=sysmon EventCode=1
| eval process_name=mvindex(split(Image,"\\"),-1)
| where (process_name="svchost.exe" AND NOT match(Image,"(?i)C:\\\\Windows\\\\System32"))
OR (process_name="csrss.exe" AND NOT match(Image,"(?i)C:\\\\Windows\\\\System32"))
| table _time host Image ParentImage CommandLine User
ステップ 5: LOLBin の悪用を検出する(T1218、T1127)
# Common LOLBin abuse patterns:
# mshta.exe executing remote content
EventID: 1
Image ends with: "mshta.exe"
CommandLine contains: "http" OR "javascript:" OR "vbscript:"
# certutil.exe downloading files
EventID: 1
Image ends with: "certutil.exe"
CommandLine contains: "-urlcache" OR "-decode" OR "-encode"
# regsvr32.exe executing scriptlets
EventID: 1
Image ends with: "regsvr32.exe"
CommandLine contains: "/s /n /u /i:" OR "scrobj.dll"
# rundll32.exe with unusual DLLs
EventID: 1
Image ends with: "rundll32.exe"
CommandLine contains: "javascript:" OR ".js" OR "http:"
# MSBuild executing inline tasks
EventID: 1
Image contains: "MSBuild.exe"
CommandLine NOT contains: ".sln" AND NOT contains: ".csproj"
ステップ 6: 検出ルールの相関を構築する
# Combine multiple weak signals into high-confidence detection:
# Rule: Potential post-exploitation evasion chain
# Trigger when 3+ evasion techniques observed on same host within 1 hour
# Splunk correlation search:
index=sysmon host=*
| eval technique=case(
EventCode=2, "timestomping",
EventCode=8 AND NOT match(SourceImage,"csrss|svchost"), "process_injection",
EventCode=1 AND match(CommandLine,"(?i)wevtutil.*cl"), "log_clearing",
EventCode=13 AND match(TargetObject,"DisableRealtimeMonitoring"), "security_disable",
EventCode=1 AND match(CommandLine,"(?i)(mshta|certutil.*urlcache|regsvr32.*/s.*/n)"), "lolbin_abuse",
true(), NULL
)
| where isnotnull(technique)
| bin _time span=1h
| stats dc(technique) as technique_count values(technique) as techniques by host _time
| where technique_count >= 3
| sort - technique_count
主要な概念
| 用語 | 定義 |
|---|---|
| 防御回避(TA0005) | 敵対者が作戦中の検出を回避しようとする MITRE ATT&CK の戦術 |
| プロセスインジェクション(T1055) | 信頼されたコンテキストで実行するために、別のプロセスのメモリ空間にコードを注入する技術 |
| タイムスタンプ改ざん(T1070.006) | 悪意のあるファイルを古く見せ、正規のファイルに溶け込ませるためにファイルのタイムスタンプを変更すること |
| マスカレード(T1036) | 検出を回避するために、悪意のあるファイルやプロセスに正規のシステムファイルと一致する名前を付けること |
| LOLBin | Living Off the Land Binary。敵対者に悪用される正規の Windows ツール |
| インジケーターの除去(T1070) | 侵害の痕跡を消すために、ログの消去、ファイルの削除、アーティファクトの変更を行うこと |
ツールとシステム
- Sysmon: カーネルレベルの可視性を備えた高度な Windows システム監視ツール
- Microsoft Defender for Endpoint: 回避の検出のために高度なハンティング(KQL)を備えた EDR
- CrowdStrike Falcon: 回避技術のための IOA ベースの振る舞い検出
- Elastic Security: ATT&CK の回避技術向けの組み込み検出ルールを備えた SIEM
- Sigma Rules: 豊富な回避ルールライブラリを備えた、ベンダーに依存しない検出ルール形式
よくある落とし穴
- プロセスインジェクションルールによるアラート疲れ: 多くの正規ツール(ウイルス対策、アクセシビリティ機能)がプロセスインジェクションを行います。既知の正常な送信元プロセスの許可リストを維持してください。
- Sysmon のイベント ID 8/10 の欠落: 既定の Sysmon 設定では CreateRemoteThread や ProcessAccess を取得できない場合があります。包括的な Sysmon 設定を使用してください。
- 親プロセスのコンテキストの無視: cmd.exe からの不審なコマンドライン は、cmd.exe の親が通常と異なる場合(例: Excel が cmd.exe を起動する場合)にのみ懸念されます。
- イベントの種類をまたいだ相関の欠如: 単一のイベントは多くの場合無害です。確度の高い検出のために、複数の弱いシグナル(プロセス作成 + ネットワーク接続 + ファイル作成)を組み合わせてください。
コメント
Markdown 対応