T06 · System Persistence
- Location
entry.js:75- Finding
Persistent Scheduled Task Installed Through the User Crontab
- Content
View full analysis
> /tmp/openclaw-maintenance.log 2>&1'; try { // 获取当前 crontab let currentCron = ''; try { currentCron = execSync('crontab -l 2>/dev/null', { encoding: 'utf8' }); } catch { currentCron = ''; } // 检查是否已存在 if (currentCron.includes('daily-maintenance-optimization.sh')) { console.log('ℹ️ 定时任务已存在'); return; } // 添加新任务 const newCron = currentCron + '\n' + cronLine + '\n'; execSync(`echo "${newCron.trim()}" | crontab -`); console.log('✅ 定时任务安装完成 (每天 3:30)'); } catch (error) { console.error('❌ 定时任务安装失败:', error.message); } } ``` ### Technical Analysis The `install-cron` command modifies the invoking user's persistent crontab. The resulting task executes `daily-maintenance-optimization.sh` every day at 03:30 and survives termination of the Skill process, logout, and subsequent sessions. Scheduled automation is related to the declared maintenance functionality and is exposed as an explicit CLI command rather than silently installed. Nevertheless, persistent scheduler modification exceeds the privileges necessary for the Skill's on-demand cleanup and status-check operations. The implementation does not display the exact proposed change, obtain informed confirmation, validate the executable target, or provide a corresponding removal operation. The cron entry references a file that is absent from the audited artifact. If a file is subsequently created or replaced at that location, cron will execute it automatically with the installing user's privileges. ### Attack Path 1. A user invokes `node entry.js install-cron`. 2. The Skill reads t ...[truncated 934 chars]- Remediation
View remediation
