Files
ProjectOctopus/port_forwarding/script/2-代理全部cmii端口.ps1
2024-06-14 10:37:40 +08:00

30 lines
2.1 KiB
PowerShell
Executable File

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
$basePath = $PWD
$remoteHost = "10.100.2.121"
Write-Host "Current Running Path is $basePath"
Write-Host "Connecting to remote host is $remoteHost"
# This is a PowerShell script to run port_win64.exe with admin privileges and keep running in the background
Write-Host "Start the port forwarding !"
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:8888: conn:$remoteHost:8888" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:8889 conn:$remoteHost:8889" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:9000 conn:$remoteHost:9000" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:30554 conn:$remoteHost:30554" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:30557 conn:$remoteHost:30557" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:38989 conn:$remoteHost:38989" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "tcp listen:0.0.0.0:31935 conn:$remoteHost:31935" -Verb RunAs
Start-Process -FilePath "$basePath\port_win64.exe" -ArgumentList "udp listen:0.0.0.0:30090 conn:$remoteHost:30090" -Verb RunAs
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:8888: conn:10.100.2.121:8888
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:8889 conn:10.100.2.121:8889
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:9000 conn:10.100.2.121:9000
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:30554 conn:10.100.2.121:30554
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:30557 conn:10.100.2.121:30557
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:38989 conn:10.100.2.121:38989
C:\Users\SuperDD\Desktop\port_win64.exe tcp listen:10.250.0.20:30935 conn:10.100.2.121:30935
C:\Users\SuperDD\Desktop\port_win64.exe udp listen:10.250.0.20:30090 conn:10.100.2.121:30090