Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Tunnel Remote PC's Port with heavy firewall to local machine #84

Closed
nithi2023 opened this issue Jul 8, 2021 · 5 comments
Closed

Comments

@nithi2023
Copy link

I have a remote server running Win10 from which I need to access one port (RDP) from my local laptop. Unfortunately, Remote Win 10 is heavily firewalled (zscaler). Only HTTP / HTTPS / WS is allowed on 443/80.

Please help me setting up wstunnel in that Win10 machine so that I can access that remote port in my laptop. I can run the wstunnel.exe in that Win10 machine.

@nithi2023 nithi2023 changed the title I want to Tunnel remote machine port to localmachine How to Tunnel remote machine port to localmachine Jul 8, 2021
@erebe
Copy link
Owner

erebe commented Jul 10, 2021

Hello,
What have you tried ? It seems standard setup.
Just start tunnel with TLS on the server wss://0.0.0.0:443
on client side wstunnel -L 33891:localhost:33891 wss://windows10ip/host
on do a rdpclient on localhost:33891

@nithi2023
Copy link
Author

Hi @erebe ,

Thanks for the reply.
Its not a standard setup. I will explain in detail about what I am trying to achieve.

Windows 10 - Remote Computer which has no public IP. It can contact Internet only through HTTP & HTTPS Port (80 & 443) due to heavy firewall restriction. Even SSH connections (to port 443) are dropped if try reverse tunnel a local port to my server. I don't have admin access. I am user with before said restrictions.

Ubuntu Server - with Public IP say 12.23.34.56 and can run anything. It can be used as relay if necessary.

My Local Laptop - Connected to internet. It has full access to Ubuntu Server (Can access SSH and other Ports).

I am trying to connect to RDP from My Local Laptop to Windows 10.

I can run wstunnel on Windows 10.

Lot of online help says, I can do it with reverse tunneling a port. But, I can't achieve through reverse Tunneling as SSH connections are dropped by Firewall.

Is it possible to achieve this with help of wstunnel ? Your help is much appreciated !!

@erebe
Copy link
Owner

erebe commented Jul 10, 2021

You should be able to do it with wstunnel + ssh

  1. Ubuntu Server : Start a wstunnel server with tls (wss://) or if it works without do it in plain ws://
  2. Windows 10: start wstunnel client to contact the ubuntu server and make it target its ssh port (-L 2222:localhost:22)
  3. Windows 10: start a reverse ssh tunnel throught the tunnel of wstunnel (ssh -R 33891:localhost:33891 localhost -p 2222)
  4. now you have on yur ubuntu server a port that listen for rdp connection
  5. on your local laptop do a simple ssh -L 33891:localhost:33891 ubuntu_server
  6. start rdpclient targeting your local machine

You can even skip the ssh tunnel on 5, if you enable enable your reverse tunnel to listen on public interface
https://superuser.com/questions/588591/how-to-make-an-ssh-tunnel-publicly-accessible

Hope it helps, let me know

@nithi2023
Copy link
Author

Hi, I have tried and working perfectly! :)

Thanks for your support and this wonderful library!

@nithi2023 nithi2023 changed the title How to Tunnel remote machine port to localmachine How to Tunnel Remote PC's Port with heavy firewall to local machine Jul 11, 2021
@erebe
Copy link
Owner

erebe commented Jul 11, 2021

You welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants