HAW-003 Windows Task Scheduler Operational Log
공격 행위 요약
SB-07은 scheduled task가 두 번 중요하게 등장한다. 첫 번째는 win01의 Hanguel PMS Agent가 update patch를 주기적으로 실행하는 흐름이고, 두 번째는 DC에서 loader를 SYSTEM으로 실행하기 위해 task를 등록하는 흐름이다.
로그 발생 위치
| 구분 | 위치 | 설명 |
| Event Log | Microsoft-Windows-TaskScheduler/Operational | task registered, updated, action started/completed |
| Task XML | C:\Windows\System32\Tasks\HanguelLoaderDiag | 실행 action과 계정 context |
| Registry | HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache | TaskCache tree/tasks entry |
주요 event.action
dc_scheduled_task_registered
taskcache_loader_task_found
task_xml_loader_action_found
주요 필드
| 필드 | 의미 | 예시 |
winlog.channel | Task Scheduler 로그 채널 | Microsoft-Windows-TaskScheduler/Operational |
event.code | task 등록/시작/완료 이벤트 | 106, 129, 200, 201 |
message | 원본 task scheduler 메시지 | Task Scheduler successfully completed task |
process.command_line | task action 요약 | cmd.exe /c C:\Windows\Temp\hgl_run.cmd |
커버하는 Techniques Used
원본 로그 기준 탐색 포인트
| 관찰할 행위 | 원본 필드/문자열 | 분석 의미 |
| task 등록 | Event ID 106, HanguelLoaderDiag | DC에 loader 실행 task가 만들어졌는지 확인 |
| task action 실행 | Event ID 200, Action started | cmd.exe /c C:\Windows\Temp\hgl_run.cmd 실행 시점 확인 |
| task 완료 | Event ID 201, Action completed | task가 종료된 시점과 exit 상태 확인 |
| Task XML 확인 | C:\Windows\System32\Tasks\HanguelLoaderDiag | 이벤트 로그가 부족할 때 action command를 원본 파일로 재검증 |
Analyst Hunting KQL
작업 스케줄러 로그는 task name, action command, Event ID를 기준으로 먼저 헌팅한다.
winlog.channel:"Microsoft-Windows-TaskScheduler/Operational" and message:(*HanguelLoaderDiag* or *hgl_run.cmd* or *hgl_loader.exe*)
winlog.channel:"Microsoft-Windows-TaskScheduler/Operational" and event.code:(106 or 129 or 200 or 201) and message:*HanguelLoaderDiag*
message:(*"C:\\Windows\\System32\\Tasks\\HanguelLoaderDiag"* or *"C:\\Windows\\Temp\\hgl_run.cmd"*)
winlog.channel:"Microsoft-Windows-TaskScheduler/Operational" and event.code:(106 or 140 or 200 or 201) and message:(*cmd.exe* or *hgl_run.cmd*)
Normalized Pivot
event.action:("dc_scheduled_task_registered" or "taskcache_loader_task_found" or "task_xml_loader_action_found")