I have been using a SSH tunnel (Please see this post for the instructions, http://swapoff.blogspot.com/2018/03/how-to-create-ssh-tunnel-and-use-it-for.html) for web browsing via Firefox.
I used it to forward DNS queries well. So I thought I'm pretty much safe until I read about WebRTC feature in web browsers.
WebRTC allows P2P communication for real time communication in web browsers. WebRTC can be used to get your true IP address via STUN requests with browsers, even when you are using a VPN or SSH tunnel.
You can check whether WebRTC is enabled using several methods, but checking it via a web application is easier than any other methods. e.g.: https://browserleaks.com/webrtc
To disable WebRTC in firefox, set media.peerconnection.enabled to false via about:config
Showing posts with label DNS. Show all posts
Showing posts with label DNS. Show all posts
Tuesday, August 14, 2018
Saturday, March 10, 2018
How to create SSH tunnel and use it for web browsing
Command
ssh -D 12345 -C -q -N <username>@<ip or FQDN> -p 23456
Explanation
-D ssh will act as a SOCKS server for the given port
-C Compress data
-q quiet mode. warning and diagnostic messages will be suppressed
-N Do not execute a remote command. just forwarding ports.
<username>@<ip or FQDN> Connection string to SSH server
-p SSH server port. (if it's usual port 22, you can ignore this parameter)
In addition to above options you can use -f option to push ssh command to background
Executing above command will create a SSH tunnel which supports SOCKS protocol.
How to configure Firefox to use the SSH tunnel
Go to proxy settings and use localhost as "SOCKS Host" and the port you used for the tunnel as the Port (see the screenshot below)
How to configure Firefox to forward DNS queries to the SSH tunnel
Use "Proxy DNS when using SOCKS v5" in proxy settings or set "network.proxy.socks_remote_dns" to "true" via about:config to get DNS queries resolved via the tunnel. Otherwise the browser will use DNS server configured in your network interface or ISP's DNS servers.
How to disable WebRTC in Firefox
ssh -D 12345 -C -q -N <username>@<ip or FQDN> -p 23456
Explanation
-D ssh will act as a SOCKS server for the given port
-C Compress data
-q quiet mode. warning and diagnostic messages will be suppressed
-N Do not execute a remote command. just forwarding ports.
<username>@<ip or FQDN> Connection string to SSH server
-p SSH server port. (if it's usual port 22, you can ignore this parameter)
In addition to above options you can use -f option to push ssh command to background
Executing above command will create a SSH tunnel which supports SOCKS protocol.
How to configure Firefox to use the SSH tunnel
Go to proxy settings and use localhost as "SOCKS Host" and the port you used for the tunnel as the Port (see the screenshot below)
How to configure Firefox to forward DNS queries to the SSH tunnel
Use "Proxy DNS when using SOCKS v5" in proxy settings or set "network.proxy.socks_remote_dns" to "true" via about:config to get DNS queries resolved via the tunnel. Otherwise the browser will use DNS server configured in your network interface or ISP's DNS servers.
Important: Please read http://swapoff.blogspot.com/2018/08/avoid-webrtc-leak-if-you-use-browser.html for instructions to disable WebRTC.
Subscribe to:
Posts (Atom)
