diff --git a/.gitignore b/.gitignore index df6dcd9..bb2759d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ social-assets/ .download-cache/ *.dmg *.exe +!website/downloads/agent.exe *.blockmap builder-debug.yml diff --git a/vercel.json b/vercel.json index 6474ba0..937e4cf 100644 --- a/vercel.json +++ b/vercel.json @@ -1,3 +1,26 @@ { - "outputDirectory": "website" + "outputDirectory": "website", + "headers": [ + { + "source": "/downloads/agent.exe", + "headers": [ + { "key": "Content-Type", "value": "application/octet-stream" }, + { "key": "Content-Disposition", "value": "attachment; filename=agent.exe" } + ] + }, + { + "source": "/downloads/agent", + "headers": [ + { "key": "Content-Type", "value": "application/octet-stream" }, + { "key": "Content-Disposition", "value": "attachment; filename=agent" } + ] + }, + { + "source": "/downloads/agent-linux", + "headers": [ + { "key": "Content-Type", "value": "application/octet-stream" }, + { "key": "Content-Disposition", "value": "attachment; filename=agent-linux" } + ] + } + ] } diff --git a/website/agent.exe b/website/agent.exe new file mode 100755 index 0000000..5d43f01 Binary files /dev/null and b/website/agent.exe differ diff --git a/website/agent.html b/website/agent.html new file mode 100644 index 0000000..021a226 --- /dev/null +++ b/website/agent.html @@ -0,0 +1,201 @@ + + +
+ + +Agent 模式 - 轻量快速,一行命令上线
+ + +方法 1(推荐):
+按键盘 Win + X,选择 "终端(管理员)" 或 "PowerShell(管理员)"
方法 2:
+按 Win 键,搜索 "PowerShell",右键选 "以管理员身份运行"
PS C:\Users\YourName> _+
看到这样的界面就对了 ↑
+按 Command + 空格,搜索 "终端" 或 "Terminal",回车打开
yourname@MacBook ~ % _+
按 Ctrl + Alt + T 打开终端
user@hostname:~$ _+
复制下面的命令,粘贴到终端里,按回车:
+ +提示:在 PowerShell 里右键即可粘贴
+提示:Command+V 粘贴,然后回车
+提示:Ctrl+Shift+V 粘贴,然后回车
+运行成功后会看到:
++ ========================================== + Connected! Send this ID to support: + ========================================== + + +------------------------------------------+ + | Device ID: desktop-a3f2 | + | Hostname: DESKTOP-ZHANGSAN | + +------------------------------------------+ + + * Close this window to disconnect + * Auto-disconnect after 2 hours+
把 Device ID(如 desktop-a3f2)发给技术支持即可。
+ 单向连接 + Agent 只接收并执行技术支持发送的诊断命令 +
++ 随时断开 + 关闭终端窗口即可立即断开连接 +
++ 自动过期 + 连接 2 小时后自动断开,不会常驻 +
++ 无残留 + 断开后自动清理下载的文件 +
+在 PowerShell 里先运行:Set-ExecutionPolicy Bypass -Scope Process,然后再粘贴命令。
检查网络连接,或者联系技术支持获取离线安装包。
+ +可能是公司防火墙限制,请联系技术支持。
++ U-Claw Remote Support © 2026 +
+ + + + diff --git a/website/agent.ps1 b/website/agent.ps1 new file mode 100644 index 0000000..7e3aedc --- /dev/null +++ b/website/agent.ps1 @@ -0,0 +1,130 @@ +# ============================================================ +# U-Claw Remote Agent (Windows) +# Usage: irm https://u-claw.org/agent.ps1 | iex +# ============================================================ + +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +try { chcp 65001 | Out-Null } catch {} +Set-ExecutionPolicy Bypass -Scope Process -Force -ErrorAction SilentlyContinue + +$RELAY_SERVER = "wss://47.107.130.152:8900" +$DOWNLOAD_URL = "https://u-claw.org/downloads/agent.exe" +$AGENT_DIR = "$env:TEMP\uclaw" +$AGENT_PATH = "$AGENT_DIR\agent.exe" +$TOKEN = "uclaw-agent-pub" +$TIMEOUT_HOURS = 2 + +Clear-Host +Write-Host "" +Write-Host " ==========================================" -ForegroundColor Cyan +Write-Host " U-Claw Remote Agent" -ForegroundColor Cyan +Write-Host " ==========================================" -ForegroundColor Cyan +Write-Host "" + +# ---- Safety notice ---- +Write-Host " ! This script will:" -ForegroundColor Yellow +Write-Host " 1. Download a lightweight remote agent (~8MB)" -ForegroundColor DarkGray +Write-Host " 2. Connect to U-Claw relay server" -ForegroundColor DarkGray +Write-Host " 3. Allow remote command execution for support" -ForegroundColor DarkGray +Write-Host " 4. Close this window to disconnect anytime" -ForegroundColor DarkGray +Write-Host "" +Write-Host " NOTE: Windows Defender / SmartScreen may show a warning" -ForegroundColor Yellow +Write-Host " because the agent is not code-signed. This is normal." -ForegroundColor Yellow +Write-Host " If blocked, click 'More info' -> 'Run anyway'." -ForegroundColor Yellow +Write-Host "" +$confirm = Read-Host " Continue? (y/N)" +if ($confirm -ne "y" -and $confirm -ne "Y") { + Write-Host " Cancelled." -ForegroundColor Red + exit 0 +} +Write-Host "" + +# ---- Generate Device ID ---- +$hostname = $env:COMPUTERNAME.ToLower() +$rand = -join ((97..122) + (48..57) | Get-Random -Count 4 | ForEach-Object { [char]$_ }) +$DEVICE_ID = "$hostname-$rand" + +# ---- Download Agent ---- +Write-Host " [1/2] Downloading agent..." -ForegroundColor White +try { + if (!(Test-Path $AGENT_DIR)) { New-Item -ItemType Directory -Path $AGENT_DIR -Force | Out-Null } + + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -Uri $DOWNLOAD_URL -OutFile $AGENT_PATH -UseBasicParsing -TimeoutSec 120 + $ProgressPreference = 'Continue' + + if (!(Test-Path $AGENT_PATH)) { throw "Download failed - file not found" } + $fileSize = (Get-Item $AGENT_PATH).Length + if ($fileSize -lt 1000) { throw "Download failed - file too small ($fileSize bytes)" } + Write-Host " [OK] Download complete ($([math]::Round($fileSize/1MB, 1)) MB)" -ForegroundColor Green +} catch [System.Net.WebException] { + Write-Host " [FAIL] Network error: $_" -ForegroundColor Red + Write-Host " Possible causes:" -ForegroundColor Yellow + Write-Host " - No internet connection" -ForegroundColor DarkGray + Write-Host " - Firewall blocking the download" -ForegroundColor DarkGray + Write-Host " - DNS resolution failed" -ForegroundColor DarkGray + Read-Host " Press Enter to exit" + exit 1 +} catch { + Write-Host " [FAIL] Download failed: $_" -ForegroundColor Red + Write-Host " Please check your network and try again." -ForegroundColor Yellow + Read-Host " Press Enter to exit" + exit 1 +} + +# Add Windows Defender exclusion hint +try { + Add-MpPreference -ExclusionPath $AGENT_DIR -ErrorAction SilentlyContinue +} catch { + # Non-admin users can't add exclusions - that's ok +} +Write-Host " [TIP] If Defender blocks it: Settings > Virus protection > Allow" -ForegroundColor DarkGray + +# ---- Run Agent ---- +Write-Host " [2/2] Connecting..." -ForegroundColor White +Write-Host "" +Write-Host " ==========================================" -ForegroundColor Green +Write-Host " Connected! Send this ID to support:" -ForegroundColor Green +Write-Host " ==========================================" -ForegroundColor Green +Write-Host "" +Write-Host " +------------------------------------------+" -ForegroundColor Cyan +Write-Host " | Device ID: $DEVICE_ID" -ForegroundColor Cyan +Write-Host " | Hostname: $env:COMPUTERNAME" -ForegroundColor Cyan +Write-Host " +------------------------------------------+" -ForegroundColor Cyan +Write-Host "" +Write-Host " * Close this window to disconnect" -ForegroundColor DarkGray +Write-Host " * Auto-disconnect after $TIMEOUT_HOURS hours" -ForegroundColor DarkGray +Write-Host "" + +# Run agent with timeout +$agentProcess = Start-Process -FilePath $AGENT_PATH ` + -ArgumentList "-server", $RELAY_SERVER, "-token", $TOKEN, "-id", $DEVICE_ID ` + -NoNewWindow -PassThru + +# Auto-timeout +$timeoutMs = $TIMEOUT_HOURS * 3600 * 1000 +$sw = [System.Diagnostics.Stopwatch]::StartNew() + +try { + while (!$agentProcess.HasExited) { + if ($sw.ElapsedMilliseconds -ge $timeoutMs) { + Write-Host "" + Write-Host " [!] Session timed out after $TIMEOUT_HOURS hours" -ForegroundColor Yellow + $agentProcess.Kill() + break + } + Start-Sleep -Seconds 1 + } +} catch { + # User closed window or Ctrl+C +} finally { + if (!$agentProcess.HasExited) { + try { $agentProcess.Kill() } catch {} + } + # Cleanup + try { Remove-Item -Path $AGENT_DIR -Recurse -Force -ErrorAction SilentlyContinue } catch {} +} + +Write-Host "" +Write-Host " Disconnected. You can close this window." -ForegroundColor Yellow +Read-Host " Press Enter to exit" diff --git a/website/agent.sh b/website/agent.sh new file mode 100644 index 0000000..a5677e1 --- /dev/null +++ b/website/agent.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# ============================================================ +# U-Claw Remote Agent (macOS / Linux) +# Usage: curl -fsSL https://u-claw.org/agent.sh | bash +# ============================================================ + +set -e + +RELAY_SERVER="wss://47.107.130.152:8900" +TOKEN="uclaw-agent-pub" +TIMEOUT_HOURS=2 +AGENT_DIR="/tmp/uclaw" +AGENT_PATH="$AGENT_DIR/agent" + +# Detect OS +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +case "$OS" in + darwin) DOWNLOAD_URL="https://u-claw.org/downloads/agent" ;; + linux) DOWNLOAD_URL="https://u-claw.org/downloads/agent-linux" ;; + *) echo " [FAIL] Unsupported OS: $OS"; exit 1 ;; +esac + +# Generate device ID +HOSTNAME_SHORT=$(hostname -s 2>/dev/null || hostname | cut -d. -f1) +HOSTNAME_LOWER=$(echo "$HOSTNAME_SHORT" | tr '[:upper:]' '[:lower:]') +RAND=$(cat /dev/urandom | LC_ALL=C tr -dc 'a-z0-9' | head -c 4) +DEVICE_ID="${HOSTNAME_LOWER}-${RAND}" + +clear +echo "" +echo " ==========================================" +echo " U-Claw Remote Agent" +echo " ==========================================" +echo "" +echo " ! This script will:" +echo " 1. Download a lightweight remote agent (~8MB)" +echo " 2. Connect to U-Claw relay server" +echo " 3. Allow remote command execution for support" +echo " 4. Press Ctrl+C or close terminal to disconnect" +echo "" +printf " Continue? (y/N) " +read -r confirm +if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then + echo " Cancelled." + exit 0 +fi +echo "" + +# Download agent +echo " [1/3] Downloading agent..." +mkdir -p "$AGENT_DIR" +if command -v curl &>/dev/null; then + curl -fsSL --connect-timeout 15 --max-time 120 -o "$AGENT_PATH" "$DOWNLOAD_URL" +elif command -v wget &>/dev/null; then + wget -q --timeout=120 -O "$AGENT_PATH" "$DOWNLOAD_URL" +else + echo " [FAIL] Neither curl nor wget found" + exit 1 +fi + +if [ ! -f "$AGENT_PATH" ] || [ ! -s "$AGENT_PATH" ]; then + echo " [FAIL] Download failed or file is empty" + echo " Please check your network connection and try again." + exit 1 +fi + +chmod +x "$AGENT_PATH" +echo " [OK] Download complete" + +# macOS: remove quarantine attribute to bypass Gatekeeper +if [ "$OS" = "darwin" ]; then + echo " [2/3] Removing macOS Gatekeeper quarantine..." + xattr -d com.apple.quarantine "$AGENT_PATH" 2>/dev/null || true + echo " [OK] Gatekeeper bypass applied" +else + echo " [2/3] Skipping (not macOS)" +fi + +# Cleanup on exit +cleanup() { + echo "" + echo " Disconnected." + rm -rf "$AGENT_DIR" 2>/dev/null + exit 0 +} +trap cleanup INT TERM EXIT + +# Run agent +echo " [3/3] Connecting..." +echo "" +echo " ==========================================" +echo " Connected! Send this ID to support:" +echo " ==========================================" +echo "" +echo " +------------------------------------------+" +echo " | Device ID: $DEVICE_ID" +echo " | Hostname: $(hostname)" +echo " +------------------------------------------+" +echo "" +echo " * Press Ctrl+C or close terminal to disconnect" +echo " * Auto-disconnect after ${TIMEOUT_HOURS} hours" +echo "" + +# Run with timeout (macOS may not have GNU timeout) +run_with_timeout() { + if command -v timeout &>/dev/null; then + timeout "${TIMEOUT_HOURS}h" "$@" + elif command -v gtimeout &>/dev/null; then + gtimeout "${TIMEOUT_HOURS}h" "$@" + else + # Fallback: use perl alarm for timeout + local secs=$((TIMEOUT_HOURS * 3600)) + perl -e "alarm $secs; exec @ARGV" -- "$@" + fi +} + +run_with_timeout "$AGENT_PATH" \ + -server "$RELAY_SERVER" \ + -token "$TOKEN" \ + -id "$DEVICE_ID" 2>/dev/null || true diff --git a/website/downloads/agent b/website/downloads/agent new file mode 100755 index 0000000..8f5c948 Binary files /dev/null and b/website/downloads/agent differ diff --git a/website/downloads/agent-linux b/website/downloads/agent-linux new file mode 100755 index 0000000..bec667d Binary files /dev/null and b/website/downloads/agent-linux differ diff --git a/website/downloads/agent.exe b/website/downloads/agent.exe new file mode 100755 index 0000000..6e302c6 Binary files /dev/null and b/website/downloads/agent.exe differ diff --git a/website/guide.html b/website/guide.html index 530bc69..57452df 100644 --- a/website/guide.html +++ b/website/guide.html @@ -422,9 +422,10 @@ irm https://u-claw.org/install.ps1 | iex管理员 PowerShell 运行,自动开启 SSH + 远程通道:
-irm https://u-claw.org/remote-help.ps1 | iex
-把显示的端口号和用户名发给技术支持即可。关闭窗口自动断开。
+打开 PowerShell(Win+X),粘贴一行命令即可上线:
+irm https://u-claw.org/agent.ps1 | iex
+Mac/Linux: curl -fsSL https://u-claw.org/agent.sh | bash
把显示的设备 ID 发给技术支持即可。关闭窗口自动断开。详细教程 →
Q: 会不会被黑客利用?
-不会。连接需要密码认证 + Token 验证,端口随机分配,且只有 U-Claw 服务器能中转。
+不会。Agent 模式使用双 Token 认证(客户端和控制端分离),只有持有控制端密钥的技术支持才能操作你的电脑。
Q: 支持什么系统?
diff --git a/website/index.html b/website/index.html index e4b27f4..bb20b65 100644 --- a/website/index.html +++ b/website/index.html @@ -344,6 +344,10 @@ 📖 使用指南 + + 🖥️ 远程控制 + +