T06 · System Persistence
- Location
ghostprint.py:453- Finding
Persistent Execution Through User Crontab Modification
- Content
View full analysis
> {shlex.quote(str(LOG_FILE))}\n" import subprocess result = subprocess.run(["crontab", "-l"], capture_output=True, text=True) existing = result.stdout if result.returncode == 0 else "" if str(script) in existing: print("ghostprint is already in crontab.") return new_cron = existing + cron_line proc = subprocess.run(["crontab", "-"], input=new_cron, text=True) ``` ### Technical Analysis The `--install-cron` operation reads the current user's crontab, appends a command that invokes `ghostprint.py`, and writes the modified crontab back. This causes Ghostprint to execute repeatedly across terminal sessions and system reboots where the cron service is active. Scheduled execution is relevant to the declared noise-generation functionality, and installation requires an explicit command. However, it still establishes operating-system-level persistence outside the OpenClaw lifecycle. The project does not provide a corresponding uninstall operation, uniquely identify the installed entry, or obtain an additional confirmation before modifying persistent user configuration. The configured interval is also interpolated directly into the cron expression without validating that it is a positive, cron-compatible integer. This is not a shell-injection path because the value is not interpreted by a shell during installation, but malformed values can create an invalid or unexpectedly frequent schedule. ### Attack Path 1. The user follows the standalone installation instructions. 2. The user invokes `python3 ghostprint.py --i ...[truncated 1047 chars]- Remediation
View remediation
