Creating a chained SSH tunnel through multiple hops to securely access an internal web server from an external network.
Kali (172.26.0.x) β VPS1 (192.168.50.10) β VPS2 (192.168.100.10) β Apache Server
# Kali:
apt-get install openssh-server
# VPS1 and VPS2:
sudo apt-get install openssh-server openssh-client
# Server:
sudo apt install apache2
ssh -L 5678:127.0.0.1:4321 user@192.168.50.10
ssh -L 4321:127.0.0.1:1234 user@192.168.100.10
ssh -D 1234 user@192.168.10.10 # Dynamic SOCKS proxy
# In the Kali browser with FoxyProxy ON:
http://127.0.0.1
# Displays the Apache page of the internal server