T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/restore-claude-telegram.sh:9- Finding
Persistent Telegram-Connected Claude Agent Runs with Permission Enforcement Disabled
- Content
View full analysis
/dev/null || true sleep 1 tmux new-session -d -s "$SESSION" -c "$WORKDIR" sleep 2 tmux send-keys -t "$SESSION" "$CLAUDE_CMD" Enter log "sent claude command (workdir: $WORKDIR), waiting ${STARTUP_WAIT}s..." sleep "$STARTUP_WAIT" # Handle "trust this folder" prompt if it appears local pane_out pane_out=$(tmux capture-pane -pt "$SESSION:0.0" 2>/dev/null || echo "") if echo "$pane_out" | grep -q "trust this folder"; then log "trust prompt detected, confirming..." tmux send-keys -t "$SESSION" Enter sleep 10 fi log "started $SESSION" } ``` ```bash while true; do if is_claude_alive; then if (( fail_count > 0 )); then log "claude recovered (was at attempt $fail_count)" fi fail_count=0 else fail_count=$((fail_count + 1)) if (( fail_count > MAX_FAILURES )); then log "COOLDOWN: $MAX_FAILURES consecutive failures, sleeping 1 hour before retry" log "Manual restart: tmux new-session -d -s $SESSION -c $WORKDIR && tmux send-keys -t $SESSION '$CLAUDE_CMD' Enter" sleep 3600 fail_count=0 log "cooldown over, resuming monitor" continue fi start_claude continue fi sleep "$CHECK_INTERVAL" done ``` The documented LaunchAgent used to run this wrapper is persistent: ```xml ProgramArguments /bin/zsh {{WRAPPER_SCRIPT ...[truncated 2682 chars]- Remediation
View remediation
