Tunnel VNC over SSH through a Command & Control server?
Wondering if you have any experience with this.
Imagine (if you will) that you have a remote box with Kali installed that is properly configured to use autossh to connect to a VPS in "da cloud" every time it boots, using the following entry in
# Auto Connect to VPS
# POLL time will check to see if the ssh connection is up every 300 seconds (5 minute.) AUTOSSH_POLL=300 # GATETIME sets the verification time for a valid connection (30 seconds.) AUTOSSH_GATETIME=30 export AUTOSSH_POLL AUTOSSH_GATETIME autossh -M 20000 -N -f -i /root/.ssh/id_rsa -R 6868:localhost:22 [email protected]<VPS-IP-IN-DA-CLOUD> &
From a (OS X) "Workstation" you could log into VPS,
$ ssh [email protected]<VPS-IP-IN-DA-CLOUD>
Once logged in to the VPS, you could run,
$ ssh [email protected] -p 6868
Successfully logging into your remote Kali terminal, Hooray!
What if you ALSO wanted to tunnel a VNC connection over SSH through the VPN into the remote Kali box. How would you accomplish this?
Googleing finds many articles how to connect direct to a remote SSH host and tunnel VNC over SSH.
I have yet to locate an article that details OS X SHH > VPS SSH > KALI SSH VNC .
Would the Kali box need to be configured to tunnel VNC to the VPS on say port 5901 and then the VPN configured to forward the port 5901 to the OS X machine when connected, then the OS X machine connect to localhost:5901 , passing through the VPS and landing on the Remote Kali box?
Maybe I'm complicating this too much, and once the OS X machine is connected to the remote Kali terminal through VPS there is an easy command to run that would allow the VNC over SHH to function.
My brain hurts.
What do you think?
How would you do this?