T06 · System Persistence
- Location
SKILL.md:311- Finding
Persistent Public Tunnel Through a macOS LaunchAgent
- Content
View full analysis
Label com.ogp.tunnel ProgramArguments /usr/local/bin/cloudflared tunnel --url http://localhost:18790 RunAtLoad KeepAlive ``` Load the service: ```bash launchctl load ~/Library/LaunchAgents/com.ogp.tunnel.plist ``` ### Technical Analysis The LaunchAgent invokes `cloudflared` automatically at user login and directs it to expose the local service on port `18790`. The `RunAtLoad` setting starts the tunnel without another explicit command, while `KeepAlive` causes launchd to restart it after termination. This creates cross-session persistence and a durable external route to a service that would otherwise only be reachable through localhost. Persistent registration is not necessary for the Skill's temporary or ad hoc tunnel functionality and therefore exceeds the minimum privileges and lifetime required for that workflow. Although the LaunchAgent runs in the affected user's context rather than as root, it survives the original Skill session and continues to expose the service until explicitly unloaded and removed. ### Attack Path 1. The user follows the documented instructions and creates the LaunchAgent property list. 2. The user runs `launchctl load`, registering the agent with launchd. 3. Launchd executes `/usr/local/bin/cloudflared` and exposes `http://localhost:18790` through a public tunnel. 4. `KeepAlive` restarts ...[truncated 809 chars]- Remediation
View remediation
