T06 · System Persistence
- Location
scripts/bootstrap.sh:111- Finding
Automatic Installation of a Persistent Background Web Server
- Content
View full analysis
"${PLIST}" << EOF Label dev.wiki.server ProgramArguments ${PYTHON_PATH} -m http.server ${SERVE_PORT} --bind 127.0.0.1 --directory ${WIKI_DIR}/site RunAtLoad KeepAlive StandardOutPath /tmp/wiki-server.log StandardErrorPath /tmp/wiki-server.log EOF launchctl load "${PLIST}" echo "✅ Static server running on port ${SERVE_PORT}" fi elif command -v systemctl &>/dev/null; then SERVICE="${HOME}/.config/systemd/user/wiki-server.service" if [[ ! -f "${SERVICE}" ]]; then mkdir -p "$(dirname "${SERVICE}")" cat > "${SERVICE}" << EOF [Unit] Description=Wiki Static Server After=network.target [Service] ExecStart=$(which python3) -m http.server ${SERVE_PORT} --bind 127.0.0.1 --directory ${WIKI_DIR}/site Restart=always [Install] WantedBy=default.target EOF systemctl --user daemon-reload systemctl --user enable --now wiki-server echo "✅ Static server running on port ${SERVE_PORT}" fi fi ``` ### Technical Analysis The boots ...[truncated 1908 chars]- Remediation
View remediation
