T06 · System Persistence
- Location
install-cron.sh:18- Finding
Persistent weekday execution through user crontab modification
- Content
View full analysis
> /tmp/wmg.log 2>&1 0 12 * * 1-5 ${LOAD_ENV}"$RUN" chill >> /tmp/wmg.log 2>&1 0 14 * * 1-5 ${LOAD_ENV}"$RUN" focus >> /tmp/wmg.log 2>&1 0 18 * * 1-5 ${LOAD_ENV}"$RUN" off >> /tmp/wmg.log 2>&1 $END CRON current="$(crontab -l 2>/dev/null || true)" cleaned="$(printf '%s\n' "$current" | sed "/$MARKER/,/$END/d")" printf '%s\n%s\n' "$cleaned" "$BLOCK" | sed '/^$/N;/^\n$/D' | crontab - ``` ### Technical Analysis The installer modifies the current operating-system user's crontab and registers four recurring weekday jobs. These jobs survive completion of the installer, terminal sessions, and system restarts, and therefore constitute system persistence. Scheduling is explicitly disclosed in `SKILL.md`, is installed only when the user invokes `install-cron.sh`, and directly supports the declared weekday-automation feature. The mechanism therefore has a legitimate functional purpose. It also operates in the user crontab rather than requesting administrator privileges, which limits its privilege scope. Nevertheless, the persistent jobs repeatedly execute files from the Skill directory and source environment configuration. If the Skill directory, `run.sh`, `.env`, or a resolved dependency is later modified, the modified content will be executed automatically. The installer provides no ownership, permission, or integrity checks and does not include a corresponding uninstall operation. ### Attack Path 1. The user invokes `install-cron.sh`. 2. The script adds four persistent entries to the user's crontab. 3. An attacker who can subsequently modify `run.sh`, `.env`, or an invoked dependency places malicious commands in that component. 4. At the next configured weekday time, cron invokes the ...[truncated 739 chars]- Remediation
View remediation
