T06 · System Persistence
- Location
SKILL.md:43- Finding
Persistent User-Level Systemd Watcher
- Content
View full analysis
~/.config/systemd/user/openclaw-idle-watch.service << 'EOF' [Unit] Description=OpenClaw idle gateway shutdown watcher After=openclaw-gateway.service BindsTo=openclaw-gateway.service PartOf=openclaw-gateway.service [Service] Type=simple ExecStart=%h/.openclaw/workspace/scripts/idle-shutdown.sh Restart=on-failure RestartSec=10s Environment=HOME=%h # Adjust this PATH if your openclaw binary lives elsewhere Environment=PATH=%h/.local/bin:%h/bin:/usr/local/bin:/usr/bin:/bin Environment=OPENCLAW_BIN=openclaw [Install] WantedBy=default.target EOF # 3. Enable and start the service systemctl --user daemon-reload systemctl --user enable openclaw-idle-watch.service systemctl --user start openclaw-idle-watch.service ``` ### Technical Analysis The installation instructions create, enable, and immediately start a user-level systemd service. Enabling the service causes it to survive the initial Skill run and execute automatically in future user sessions. The service continuously invokes the bundled watcher and uses `Restart=on-failure`, allowing systemd to restore it following abnormal failures. The `BindsTo` and `PartOf` relationships connect its lifecycle to the Gateway service. This persistence is documented as a feature rather than concealed. Nevertheless, it meets the system-persistence classification because following the installation instructions modifies persistent startup configuration and authorizes autonomous execution beyond the current invocation. ### Attack Path 1. A user follows the installation instructions in `SKILL.md`. 2. The watcher script is copied into the user's OpenClaw workspace. 3. A service definition is written to `~/.config/systemd/user/openclaw-idle-watch.service`. 4. `systemctl --user enable` reg ...[truncated 874 chars]- Remediation
View remediation
