T06 · System Persistence
- Location
alert_integration.sh:223- Finding
Persistent System-Wide Cron Task Installation
- Content
View full analysis
"$script_path" << 'EOF' #!/bin/bash # Cron job para monitoreo automático de APIs críticas ALERT_DIR="/workspace/skills/alerting-system" LOG_FILE="/var/log/openclaw_alerts/cron.log" echo "[$(date)] Iniciando monitoreo automático..." >> "$LOG_FILE" # Monitorear APIs Tiklick (ejemplos - ajustar URLs reales) APIS=( "https://api.tiklick.com/health" "https://admin.tiklick.com" "https://app.tiklick.com" ) for api in "${APIS[@]}"; do echo "Monitoreando: $api" >> "$LOG_FILE" cd "$ALERT_DIR" && node src/index.js monitor "$api" 200 >> "$LOG_FILE" 2>&1 sleep 2 done # Verificar sistema de alertas cd "$ALERT_DIR" && node src/index.js stats >> "$LOG_FILE" 2>&1 echo "[$(date)] Monitoreo completado" >> "$LOG_FILE" EOF chmod +x "$script_path" # Configurar cron job (cada 15 minutos) echo "*/15 * * * * rhandus $script_path" | sudo tee "$cron_file" > /dev/null } ``` ### Technical Analysis The `cron` operation writes a new executable script into the Skill directory and uses `sudo` to create `/etc/cron.d/openclaw-alerting`. The resulting task executes every 15 minutes as the hard-coded `rhandus` account and continues running after the initiating process or agent session ends. The installer does not request specific confirmation for system-wide persistence, validate the ownership and permissions of the scheduled script, or provide an uninstall mechanism. Because cron later executes a path outside a protected system directory, any party able to modify that script can alt ...[truncated 950 chars]- Remediation
View remediation
