[go: up one dir, main page]

0% found this document useful (0 votes)
806 views2 pages

Windows Ngrok

This document describes a GitHub Actions workflow that sets up an RDP tunnel using Ngrok. The workflow takes authentication and server location inputs, downloads and configures Ngrok, enables the RDP service on Windows, and starts an Ngrok tunnel to allow remote desktop connections. The tunnel URL and credentials are output for users to connect to the remote desktop session.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
806 views2 pages

Windows Ngrok

This document describes a GitHub Actions workflow that sets up an RDP tunnel using Ngrok. The workflow takes authentication and server location inputs, downloads and configures Ngrok, enables the RDP service on Windows, and starts an Ngrok tunnel to allow remote desktop connections. The tunnel URL and credentials are output for users to connect to the remote desktop session.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

name: Windows (Ngrok RDP)

on:
workflow_dispatch:
inputs:
authtoken:
description: 'Ngrok Auth Token'
required: true
tunnelservers:
description: 'Ngrok Tunnel Servers (us, eu, ap, au, sa, jp or in)'
default: 'us'
required: true
password:
description: 'Password (minimum 8-10 with numbers and characters) leave
blank if you want to use automatic password)'

jobs:
build:
if: github.event.inputs.tunnelservers == 'us' ||
github.event.inputs.tunnelservers == 'eu' || github.event.inputs.tunnelservers ==
'ap' || github.event.inputs.tunnelservers == 'au' ||
github.event.inputs.tunnelservers == 'sa' || github.event.inputs.tunnelservers ==
'jp' || github.event.inputs.tunnelservers == 'in'
runs-on: windows-latest
timeout-minutes: 9999

steps:
- uses: actions/checkout@v2
- name: Mask Token
shell: bash
run: |
_Token=$(jq -r '.inputs.authtoken' $GITHUB_EVENT_PATH)
echo ::add-mask::$_Token
echo NGROK_TOKEN="$_Token" >> $GITHUB_ENV
- name: Mask Custom Password
if: "!github.event.inputs.password == ''"
shell: bash
run: |
_Password=$(jq -r '.inputs.password' $GITHUB_EVENT_PATH)
echo ::add-mask::$_Password
echo Password="$_Password" >> $GITHUB_ENV
- name: Download Ngrok & NSSM
run: |
Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-
windows-amd64.zip -OutFile ngrok.zip
Invoke-WebRequest
https://raw.githubusercontent.com/mrijoo/RDP/main/Files/nssm.exe -OutFile nssm.exe
Invoke-WebRequest https://raw.githubusercontent.com/mrijoo/RDP/main/NGROK-
Setup.bat -OutFile NGROK-Setup.bat
Invoke-WebRequest
https://raw.githubusercontent.com/mrijoo/RDP/main/Files/t.bat -OutFile t.bat
Expand-Archive ngrok.zip
- name: Copy NSSM & Ngrok to Windows Directory.
run: |
copy nssm.exe C:\Windows\System32
copy ngrok\ngrok.exe C:\Windows\System32
- name: Connect your NGROK account
run: .\ngrok\ngrok.exe authtoken ${{ env.NGROK_TOKEN }}
- name: Download Important Files & Make YML file for NGROK.
run: |
Invoke-WebRequest https://raw.githubusercontent.com/mrijoo/RDP/main/NGROK-
RG.bat -OutFile NGROK-RG.bat
start NGROK-RG.bat "${{ github.event.inputs.tunnelservers }}"
- name: Enable RDP Access.
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
- name: Create Tunnel
run: sc start ngrok
- name: Account for Connect to your RDP.
run: cmd /c NGROK-Setup.bat `${{ env.Password }}
- name: Keep Alive.
shell: bash
run: sh t.bat

You might also like