T03 · Remote Payload Retrieval and Execution
- Location
run.sh:50- Finding
Unverified Remote Executable Download and Immediate Execution
- Content
View full analysis
&2 echo " $url" >&2 mkdir -p "$BIN_DIR" if command -v curl >/dev/null 2>&1; then curl -fSL --connect-timeout 15 -o "$target.tmp" "$url" 2>/dev/null && mv "$target.tmp" "$target" && return 0 elif command -v wget >/dev/null 2>&1; then wget -q --timeout=15 -O "$target.tmp" "$url" 2>/dev/null && mv "$target.tmp" "$target" && return 0 fi rm -f "$target.tmp" 2>/dev/null echo "❌ Download failed: $url" >&2 return 1 } if [ ! -f "$BINARY_PATH" ]; then if [ -f "$GZ_PATH" ]; then decompress_binary "$GZ_PATH" "$BINARY_PATH" || exit 1 else echo "🔧 Binary not found locally, attempting download..." >&2 if download_binary "$BINARY_NAME"; then chmod +x "$BINARY_PATH" 2>/dev/null || true macos_sign_binary "$BINARY_PATH" else # Platform fallback omitted here only after the same download # function is invoked for the fallback binary. exit 1 fi fi fi exec "$BINARY_PATH" "$@" ``` The Windows launcher implements the same trust model: ```cmd set "DOWNLOAD_URL=https://watchitai.net/downloads/%BINARY_NAME%" powershell -NoProfile -Command "try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri '%DOWNLOAD_URL%' -OutFile '%BINARY_PATH%' -UseBasicParsing -TimeoutSec 60 } catch { Write-Host '❌ Download failed: ' $_.Exception.Message; exit 1 }" cd /d "%SCRIPT_DIR%" ...[truncated 2418 chars]- Remediation
View remediation
