Spacebar Campaigns

HAD-008 DC TaskCache Registry and Task XML Artifact

Log ID:
HAD-008
Source:
hanguel-dc01
Representative Path:
HKLM\...\Schedule\TaskCache, C:\Windows\System32\Tasks\HanguelLoaderDiag
Collection:
Hanguel AD Agent artifact collector summary
Current Status:
ELK에서 이벤트 확인됨
Primary Use:
DC에서 loader wrapper를 실행한 scheduled task 구성 확인

공격 행위 요약

공격자는 WinRM/C$ 접근 이후 DC에서 SYSTEM 권한 scheduled task를 등록해 loader wrapper를 실행한다. TaskCache registry와 Task XML은 task 이름, GUID, action command를 확인하는 중요한 증거다.

관측된 action

TaskName: HanguelLoaderDiag
Action: cmd.exe /c "C:\Windows\Temp\hgl_run.cmd"

주요 event.action

taskcache_loader_task_found
task_xml_loader_action_found

주요 필드

필드의미예시
task.name작업 이름HanguelLoaderDiag
process.command_linetask actioncmd.exe /c C:\Windows\Temp\hgl_run.cmd
registry.pathTaskCache path...\TaskCache\Tree\HanguelLoaderDiag
messageTaskCache/Task XML 요약cmd.exe /c C:\Windows\Temp\hgl_run.cmd

원본 아티팩트 기준 탐색 포인트

관찰할 행위원본 필드/문자열분석 의미
TaskCache tree...\TaskCache\Tree\HanguelLoaderDiagtask 이름과 registry 흔적 확인
Task XML 파일C:\Windows\System32\Tasks\HanguelLoaderDiag실제 action command 원본 확인
실행 actioncmd.exe /c "C:\Windows\Temp\hgl_run.cmd"loader wrapper 실행 경로 확인
SYSTEM 실행 여부Task XML Principal, UserId, RunLevel권한 context 확인. 값이 없으면 별도 원본 확인 필요

Analyst Hunting KQL

TaskCache와 Task XML은 task 이름, action command, registry path를 기준으로 탐색한다.

host.name:"hanguel-dc01" and message:(*HanguelLoaderDiag* or *hgl_run.cmd* or *hgl_loader.exe*)
host.name:"hanguel-dc01" and registry.path:*\\Schedule\\TaskCache* and message:*HanguelLoaderDiag*
host.name:"hanguel-dc01" and message:(*"C:\\Windows\\System32\\Tasks\\HanguelLoaderDiag"* or *"cmd.exe /c"* or *"C:\\Windows\\Temp\\hgl_run.cmd"*)
host.name:"hanguel-dc01" and message:(*TaskCache* and (*HanguelLoaderDiag* or *hgl_run.cmd*))

Normalized Pivot

log.id:"HAD-008" and event.action:("taskcache_loader_task_found" or "task_xml_loader_action_found")