executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
hunting-for-suspicious-scheduled-tasks通过分析任务创建事件、可疑任务属性和异常执行模式,狩猎攻击者利用 Windows 计划任务实现持久化和执行的行为(T1053.005)。
Independent GitHub snapshot · Automated classification · Original documentation governs
schtasks /query /fo CSV /v 或 Get-ScheduledTask PowerShell cmdlet 收集目标系统的完整任务清单。index=wineventlog EventCode=4698
| spath output=TaskName path=EventData.TaskName
| spath output=TaskContent path=EventData.TaskContent
| where NOT match(TaskName, "(?i)(\\\\Microsoft\\\\|\\\\Windows\\\\)")
| table _time Computer SubjectUserName TaskName TaskContent
index=sysmon EventCode=1 Image="*\\schtasks.exe"
| where match(CommandLine, "(?i)/create")
| where match(CommandLine, "(?i)(powershell|cmd|wscript|cscript|mshta|rundll32|regsvr32|http|https|\\\\temp\\\\|\\\\appdata\\\\)")
| table _time Computer User CommandLine ParentImage
SecurityEvent
| where EventID == 4698
| extend TaskName = tostring(EventData.TaskName)
| extend TaskContent = tostring(EventData.TaskContent)
| where TaskContent has_any ("powershell", "cmd.exe", "wscript", "http://", "https://", "\\Temp\\", "\\AppData\\")
| project TimeGenerated, Computer, Account, TaskName, TaskContent
schtasks /create /s REMOTE_HOST 远程创建计划任务在其他系统上执行。狩猎 ID:TH-SCHTASK-[日期]-[序号]
主机:[主机名]
任务名称:[完整任务路径]
操作:[执行的命令/脚本]
触发器:[启动/登录/定时器/事件]
创建者:[用户账户]
创建来源:[本地/远程]
创建时间:[时间戳]
运行账户:[执行账户]
风险等级:[严重/高/中/低]