T06 · System Persistence
- Location
SKILL.md:340- Finding
Residual Scheduled Task and Executable Upgrade Script
- Content
View full analysis
> $log # 重启 gateway 任务 schtasks /run /tn "OpenClaw Gateway" >> $log 2>&1 "$(Get-Date -Format o) 完成" | Out-File $log -Append ``` ```powershell $st = (Get-Date).AddMinutes(2).ToString('HH:mm') schtasks /create /tn "OpenClaw Upgrade Once" ` /tr "powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\n3186\.openclaw\upgrade-once.ps1 -Version $target" ` /sc ONCE /st $st /f ``` ### Technical Analysis The Skill instructs the agent to write an executable PowerShell script and register a Windows scheduled task using `ExecutionPolicy Bypass`. The task is scheduled once, so its original purpose is consistent with completing an upgrade after the gateway process stops. However, the procedure does not delete either the task definition or the script after execution. A one-time task does not run periodically by itself, but it remains a cross-session execution artifact that can be manually invoked again. The retained task continues to reference a mutable script. Consequently, a user or process able to modify that script could cause different code to execute when the task is rerun. The `/f` option also overwrites an existing task with the same name without separately confirming ownership. ...[truncated 919 chars]- Remediation
View remediation
