T06 · System Persistence
- Location
SKILL.md:24- Finding
Boot-Persistent Execution of Remotely Retrieved Application Code
- Content
View full analysis
/dev/null << 'SERVICE' [Unit] Description=Familiar App After=network.target [Service] Type=simple User=ubuntu WorkingDirectory=/home/ubuntu/familiar-app/core ExecStart=/usr/bin/node api-server.js Restart=always RestartSec=5 [Install] WantedBy=multi-user.target SERVICE sudo systemctl enable --now familiar ``` ### Technical Analysis The deployment procedure uses `sudo` to write a system-wide systemd unit, starts it immediately, and enables it for subsequent boots. `Restart=always` also causes systemd to relaunch the application after normal exits or failures. Persistent operation is relevant to the declared autonomous social-presence platform, but boot-level persistence is not required for basic setup or interactive use. It materially increases risk because the application is retrieved from an unpinned remote repository and its implementation is not present in the audited project. The service runs as the general-purpose `ubuntu` account rather than a dedicated, restricted service account. The Node.js process does not run as root, which limits direct privilege, but root privileges are used during installation to establish durable execution. ### Attack Path 1. An operator follows the documented VPS deployment procedure. 2. Application code is cloned from the mutable upstream repository. 3. The operator uses `sudo` to register `api-server.js` as a system-wide service. 4. systemd starts the remotely obtained application immediately. 5. `Restart=always` relaunches the process after termination. 6. `WantedBy=multi-user.target` and `systemctl enable` cause it to execute after future reboots. 7. If the upstream application is malicious or later replaced before deployment, the payload gains durable execution as the `ubuntu` user. ...[truncated 551 chars]- Remediation
View remediation
