You have an Internet connection but there’s restrictions on what sites you can visit etc. To get around this you can use an SSH SOCKS tunnel.
First off make sure you have an Internet facing SSH server. You can grab a pretty cheap VPS for ~€10 a year – https://securedragon.net/#openvz
SSH should be set up on the server. If not you’ll have to set it up.
Change the port its listening on to reduce the amount of bots scanning port 22. Edit the following file with your fav text editor (vim);
Change the port to something other than port 22.
port 22 -> port 40001
Restart the SSH server (Debian/Ubuntu)
service ssh restart
SSH Client config
For passwordless login, on your client generate an SSH key
ssh-keygen -t rsa
Upload it to your remote SSH server
Create a SOCKS proxy
ssh -p 40001 -D 9999 -CqN email@example.com
-p: Specify the port the SSH server is listening on (if not running on port 22)
-D: Sets up a SOCKS tunnel over SSH on a specified port number
-C: Compresses the data before sending it
-q: Set quiet mode
-N: No command to be sent over SSH – we just want a tunnel
You can put all this in your .bashrc to quickly run it from a terminal.
alias sshtunnel="ssh -p 40001 -D 9999 -CqN firstname.lastname@example.org"
Now simply type sshtunnel to run!
Note: ssh -D opens a local port without having a specific endpoint like with -L. Running ssh -L 9999:google.com:80 and in the browser if you hit localhost:9999 you’ll go to google.com.
With ssh -D 9999 you’re telling the browser to use localhost:9999 as a SOCKS proxy. Everything your browser requests goes through the ssh tunnel. It’s as if you were browsing the web from your ssh server instead of from your computer.
Browser Set up
Using Firefox with FoxyProxy (to quickly switch between proxies) set up the browser to route through the proxy.
Proxy Type: SOCKS5 Title: SSH SOCKS IP: localhost Port: 9999
Go to http://www.whatsmyip.org/ to verify your IP is that of your SSH server.
HTTP Proxy setup (Burp / ZAP)
Now if you want to use an HTTP proxy with the browser instead of;
Browser -> SOCKS proxy (SSH tunnel) -> Internet
you’ll have to set up
Browser -> HTTP proxy (Burp) -> SOCKS proxy (SSH Tunnel) -> Internet
Firstly create a new FoxyProxy profile for HTTP
Proxy Type: HTTP
Now configure Burp suite to go through the SSH SOCKS tunnel
User options -> SOCKS Proxy
Use SOCKS proxy: ✓ SOCKS proxy host: localhost SOCKS proxy port: 9999
Again go to http://www.whatsmyip.org/ to verify your IP is that of your SSH server. Check the Proxy -> HTTP History tab to verify the traffic is running through Burp.