T06 · System Persistence
Error
- Location
- SKILL.md:136
- Finding
- Highest-Privilege Logon Persistence Through a Scheduled Task<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:136-145` **Vulnerability Type**: Privileged scheduled-task persistence **Risk Level**: High ### Vulnerable Code ```bat # Auto-restart (Windows — scheduled task + guard script) # Create tts_guard.bat: # @echo off # :loop # python tts_server.py # timeout /t 10 # goto loop # Register: schtasks /create /tn "TTS-Guard" /tr "tts_guard.bat" /sc onlogon /rl highest ``` ### Technical Analysis The documentation instructs users to create a scheduled task that launches at every logon with `/rl highest`. The referenced guard script then repeatedly starts `tts_server.py` indefinitely. Automatic startup may be useful for a server, but elevated execution is not required for a TTS process listening on port 8881. The task also uses relative paths for both the batch file and Python script. Consequently, its effective behavior depends on the task's working directory, executable search path, and the write permissions protecting those files. This persistence is not installed automatically by the supplied setup script, but it becomes active if a user follows the documented instructions. It exceeds the minimum privileges required by the declared TTS functionality. ### Attack Path 1. A user creates `tts_guard.bat` and registers the documented scheduled task. 2. The task is configured to run at logon with the highest available privilege level. 3. An attacker who can replace the guard script, `tts_server.py`, or a resolved `python` executable modifies the content that the task invokes. 4. At the next logon, the scheduled task executes the modified content with elevated privileges. 5. The guard loop restarts the payload whenever it exits, providing recurring execution. ### Impact Assessment Successful exploitation can provide repeated elevated code execution across user sessions. The exact privilege obtained depends on the account registering the task and Windows task configuration, but it can exceed the pr ...[truncated 150 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the `/rl highest` recommendation; the TTS server should run as a standard, unprivileged user. - Default to foreground execution or an explicitly enabled user-level startup mechanism. - If a scheduled task is required, use absolute paths for the interpreter, guard script, server script, and working directory. - Apply restrictive ACLs so unprivileged users cannot modify any task target. - Avoid an unconditional infinite restart loop; use bounded retries, backoff, health checks, and failure logging. - Document removal and disablement commands alongside any optional persistence instructions. - Prefer a dedicated low-privilege service account with no administrative permissions. ]]>
