Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WINDOWS TOKEN RDP

WINDOWS TOKEN RDP #61

Workflow file for this run

name: WINDOWS TOKEN RDP
on:
workflow_dispatch:
inputs:
increment:
type: string
description: 'ngrok token'
required: false
default: ''
jobs:
build:
runs-on: windows-latest
timeout-minutes: 9999
steps:
- name: πŸ”½ Download Files
run: |
Invoke-WebRequest https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-windows-amd64.zip -OutFile ngrok.zip
Invoke-WebRequest https://raw.githubusercontent.com/Riders004/rdp/master/start.bat -OutFile start.bat
Invoke-WebRequest https://raw.githubusercontent.com/Riders004/rdp/master/wallpaper.bat -OutFile wallpaper.bat
Invoke-WebRequest https://raw.githubusercontent.com/Vip3rLi0n/Ngrok-RDPs/main/resources/loop.ps1 -OutFile loop.ps1
- name: πŸ“¦ Extract Ngrok
run: Expand-Archive ngrok.zip
- name: πŸ” Set Ngrok Authtoken
shell: pwsh
run: |
$inputToken = '${{ github.event.inputs.increment }}'
$envToken = $Env:NGROK_AUTH
$defaultToken = '316WRV55lXVjwT4mXHuMYskqxiu_4bMAdBptaGPiZMBiZz82s'
if ($inputToken) {
$token = $inputToken
} elseif ($envToken) {
$token = $envToken
} else {
$token = $defaultToken
}
#Write-Host "Using ngrok token: $($token.Substring(0,[Math]::Min(6,$token.Length)))***"
.\ngrok\ngrok.exe config add-authtoken $token
env:
NGROK_AUTH: ${{ secrets.TAKEN }}
- name: πŸ”§ Enable RDP & Configure Firewall
run: |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name "UserAuthentication" -Value 1
Copy-Item wallpaper.bat D:\a\wallpaper.bat
- name: πŸš€ Start Ngrok Tunnel (Hidden Window)
run: Start-Process -WindowStyle Hidden PowerShell -ArgumentList './ngrok/ngrok.exe tcp --region ap 3389'
- name: πŸ”Ž Verify Ngrok process is running
shell: pwsh
run: |
$proc = Get-Process -Name ngrok -ErrorAction SilentlyContinue
if ($proc) {
Write-Host "βœ… Ngrok process is running (PID: $($proc.Id))"
} else {
Write-Host "❌ Ngrok process NOT found!"
exit 1
}
- name: πŸ• Wait for Ngrok to Initialize
shell: pwsh
run: Start-Sleep -Seconds 10
- name: βš™οΈ Run Setup Script (start.bat) with NGROK URL + credentials
shell: pwsh
run: |
$retries = 10
$url = $null
while ($retries -gt 0 -and -not $url) {
try {
$tunnels = Invoke-RestMethod -Uri 'http://localhost:4040/api/tunnels' -ErrorAction Stop
if ($tunnels.tunnels.Count -gt 0) {
$url = $tunnels.tunnels[0].public_url
}
} catch {}
if (-not $url) { Start-Sleep -Seconds 3 }
$retries--
}
if (-not $url) {
Write-Host "❌ Could not fetch Ngrok URL. Check ngrok process and authtoken."
exit 1
}
Write-Host "βœ… Ngrok Public URL: $url"
$escapedUrl = $url.Replace('"', '\"')
$escapedUser = 'administrator'.Replace('"','\"')
$escapedPass = 'OLDUSER#06'.Replace('"','\"')
$cmd = "start.bat `"$escapedUrl`" `"$escapedUser`" `"$escapedPass`""
#Write-Host "Running: $cmd"
cmd.exe /c $cmd
- name: 🌐 Debug Ngrok API response raw
shell: pwsh
run: curl.exe -s http://localhost:4040/api/tunnels | Write-Host
- name: πŸ” Keep Runner Alive
shell: pwsh
run: pwsh -ExecutionPolicy Bypass -File .\loop.ps1