Skip to content

Using the QuantumGate TestApp as a SOCKS5 Proxy

Karel Donk edited this page Jul 22, 2020 · 3 revisions

Introduction

This tutorial will show you how to use the TestApp and the included Socks5 Extender as a proxy. Specifically, we'll be creating a secure encrypted tunnel using QuantumGate via the TestApp and allow any SOCKS5 capable client application to use that tunnel via the Socks5 Extender. This setup is illustrated in the below image.

Before you continue with this tutorial it's important that you follow the first tutorial titled "Getting started with the QuantumGate TestApp" to set up two computers connected to each other with the TestApp. Once you've done that you can continue below.

Setting up the Socks5 Extender

For the purposes of this tutorial we'll assume computer A is our own personal computer on which we want to browse websites via a secure tunnel and computer B is another computer located somewhere on the Internet (for example hosted at a cloud service provider such as Azure, AWS or Digital Ocean). When we browse the Internet on computer A the traffic will get routed through the QuantumGate connection to computer B and will exit computer B and head on to its destination, as shown in the above image.

Assuming you have set up the TestApp on both computers and they are already connected to each other (see the above mentioned first tutorial for that), the only additional things that you have to do are as follows:

Computer A

On computer A you need to load the Socks5 Extender in the TestApp. This can be done by going into the 'Extenders' menu and choosing the 'Socks5 Extender' option and then the 'Load' option from the submenu.

Once the extender loads successfully (monitor the terminal window output for any issues), you can then go back into the 'Extenders' menu, choose the 'Socks5 Extender' option and then the 'Accept Incoming Connections' option.

This will configure the Socks5 Extender to accept incoming connections from SOCKS5 clients (such as your web browser or FTP program) on computer A. By default the Socks5 Extender will listen for incoming connections on port 9090, but you can change this by going into the 'Extenders' menu and choosing the 'Socks5 Extender' option and then the 'Configuration' option.

Computer B

On computer B you need to load the Socks5 Extender in the TestApp. This can be done by going into the 'Extenders' menu and choosing the 'Socks5 Extender' option and then the 'Load' option from the submenu. IMPORTANT: On computer B you should NOT configure the Socks5 Extender to listen for incoming connections!

Setting up your browser

After the above steps the TestApp and the Socks5 Extender are configured to be used as a proxy. You can now configure your web browser (and any other SOCKS5 client application) on computer A to use this proxy. In FireFox this is as simple as going into the options and finding the network settings. The below screenshot shows the FireFox network settings dialog in FireFox version 78.

Make sure that 'Manual proxy configuration' is checked. As the 'SOCKS Host' you can specify localhost and the port you are using for the Socks5 Extender, which is 9090 by default. Also make sure 'Proxy DNS when using SOCKS5' is checked; this will hide your DNS requests from your ISP as they get encrypted and tunneled through QuantumGate.

Save the settings and start browsing. If everything is OK the websites you visit will load and you will see output from the Socks5 Extender in the terminal window of the TestApp on both computers A and B.

A more Interesting Setup

The way the Socks5 Extender is programmed to work is that when a SOCKS5 client connects to it, it will look for a peer connection on the local instance, in this case the TestApp on computer A, through which it can tunnel the connection from the SOCKS5 client. In case there are multiple peers available that also have the Socks5 Extender running, it will randomly choose one of them. So it's possible for us to add more computers in addition to computer B and connect computer A to them. For example, we could add another computer C that is running in a different datacenter in a different region from computer B and connect computer A to C. In that case the Socks5 Extender running on computer A would have two connections available through which to tunnel connections as seen in the below image.

This kind of setup has a couple of cool advantages:

  • The two (or more) available peers would add redundancy to the Socks5 Extender. If any one of the peers goes offline the Socks5 Extender can still tunnel connections through the other available peers. You probably wouldn't even notice anything in your web browser.
  • Any connections coming from SOCKS5 clients on computer A would get load balanced and spread over the two (or more) available peers. This can result in faster browsing speeds.
  • The destination would see connections coming from two (or more) computers (perhaps located in different regions of the world) while those connections are made on behalf of a single client on a single computer. For example, connecting to YouTube using FireFox on computer A, the multiple connections made by the browser to download content would get split and randomly tunneled through computers B and C, and YouTube would see connections coming from multiple different computers (in different parts of the world) when in reality they are being made from a single computer. This can cause confusion when it comes to tracking, in addition to giving more privacy.

When combining the above features and possibilities with the relay functionality in QuantumGate, you can build even crazier setups. For more examples see the article "Using The QuantumGate Socks5 Extender For Private Encrypted Communications".

Conclusion

Hopefully this tutorial has given you a glimpse of what's possible when using QuantumGate. Remember that the full source code for the TestApp and the Socks5 Extender are available and you can use that as a basis to build your own applications on top of QuantumGate.

The Socks5 Extender is built and used for testing purposes and is a very simple extender that was initially programmed in less than 5 days (easy since QuantumGate does most of the heavy lifting). As such, the Socks5 Extender should NOT be used in production environments and security critical situations.

Clone this wiki locally