T06 · System Persistence
- Location
scripts/install.sh:70- Finding
Persistent system service and scheduled task run with excessive privileges
- Content
View full analysis
/dev/null | grep -v "$CRON_MARKER" > /tmp/crontab-guardian.tmp || true echo "*/$REPORT_INTERVAL * * * * $SCRIPT_DIR/smart-status-report.sh >> /tmp/status-report.log 2>&1 $CRON_MARKER" >> /tmp/crontab-guardian.tmp crontab /tmp/crontab-guardian.tmp rm -f /tmp/crontab-guardian.tmp if command -v systemctl &>/dev/null && command -v inotifywait &>/dev/null; then cat > /etc/systemd/system/agent-guardian-query.service << EOF [Unit] Description=Agent Guardian Status Query Daemon After=network.target [Service] Type=simple ExecStart=$SCRIPT_DIR/status-query-daemon.sh Restart=always RestartSec=5 User=root [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable agent-guardian-query.service 2>/dev/null systemctl restart agent-guardian-query.service fi ``` ### Technical Analysis The installer creates two cross-session persistence mechanisms: 1. A recurring crontab entry that invokes `smart-status-report.sh`. 2. A boot-enabled systemd service configured with `Restart=always`. Scheduling and background monitoring are consistent with the Skill's declared status-reporting functionality. However, running the query daemon explicitly as `root` and installing it as a system-wide service exceed the minimum privileges needed to read Skill-owned state and invoke the OpenClaw command-line client. The service executes its script directly from the Skill installation directory. If that directory or script can later be modified by a less-privileged account, the systemd service turns such write access into persistent root code execution. The installer also provides no corresponding uninstall or rollback procedure. ### Attack Path 1. The installer is executed with sufficient privileges to write und ...[truncated 840 chars]- Remediation
View remediation
