Do not trust any public VPN service, Create your own Secure SOCKS5 Proxy for just $5 – Be Free :)

If someone ask me to recommend one good proxy service, I would recommend none. Why should I trust any of them, as they can do what ever they want with my internet traffic, we don’t have any control over them, nor we should trust their privacy policy.

So, what will be the solution? Very simple, create your own in pubic cloud. There are many public cloud vendors out there offering cheap VM along with dedicated public IP (some of them are providing IPv4 and IPv6 both). You have the choose which suites you the best.

I personally prefer Amazon Lightsail because of the following.

  • Offering most SSD and Monthly data transfer.
  • Offer Virtual Firewall (similar to AWS Security Group).
  • Easy monitoring with notification.
  • Easy backup using snapshot.
  • Simple and easy console.

Once you choose your provider, you can do the following in your VM, where you have full control.

  • You can make Open VPN Server, which you can connect from your smartphone using open VPN client.
  • You can create traditional PPTP VPN and auto configure it directly on your router (most of the router do support this).
  • You can create SOCKS 5 proxy for your personal use, as and when required.

In this article, I will explain how to configure it and how to automate it using a PowerShell script.

Configuration of SOCKS5 proxy is the easiest one among all the above, you don’t even have to configure anything on the server side, as long as you are able to access the public IP of the server, you will be able to use SOCKS5 proxy.

If you want to do it manually, you can follow this link bellow and do it your own.
https://securitymusings.com/article/462/how-to-set-up-a-socks-proxy-using-putty-ssh

Personally, I am not interested to do it manually, I prefer automated way of doing it, and for that I wrote a script, which will be doing following tasks on my behalf, without any manual input.

  • Look for the prerequisite.
  • Download the required tool.
  • Initiate the connection.
  • Monitor the connection.
  • Re-establish the connection, if failed.
  • Execute once, it will do the rest.

Auto connect to SSH for creating SOCKS5 Tunnel

In the script, you only have to update following parameters,

  • $MyUser > Depending on which AMI/Blueprint you choose, you will be having the username in your Lightsell console.
  • $MyHost > This could be your direct IP address or the DNS name of your IP address.
  • $MyHostPort > This will be the SSH port of your server. (Please make sure you allowed port 22 on firewall)
  • $MyHostPortSSHKey > This will be the location of your SSH, which you have converted to PPK from PEM)
  • $SOCKSPort > This will the SOCKS5 proxy port, which you will be using in your browser. (Use Proxy Helper for Chrome or Edge for SOCKS5 Proxy: https://bit.ly/3aARJeA)

You can choose OS with or without app, depending on your requirement.

After instance deployment, you have to create one static public IP for you and then you have to attach it to your instances, later you will be using that public IP address to connect using Putty.

Once you deploy the instance, you will be able to see the user name, which you have to use in the script.

During the instance deployment you can create your own SSH key or you could use your default access key. If you use default access key, you will be able to download it later from your account setting.

Note: For using the access in putty, you have to convert it from PEM to PPK. Check the following ink for details information.
https://www.puttygen.com/convert-pem-to-ppk

Make sure you are allowing port 22 for SSH access.

Once you start the script, after successful connection, you have to configure Proxy Helper with following.

Selecting SOCKS Proxy on Proxy Helper

Now, try accessing with https://whatismyip.com to know your IP address, here you can see, my public Ip got changed to AWS Ashburn IP.

Few additional tips.

  • You can change the default SSH port in Linux.
  • You can configure SOCKS with VPN on different port.
  • You can host your website along with SOCKS and VPN
  • You can use free DNS provider for public IP.
  • If you are smart, you can even do more with this SOCKS proxy. Possibility is endless 🙂
  • Do not use this SOCKS proxy or any VPN for downloading torrent.

Disclaimer: All posts and opinions on this site are provided AS IS with no warranties. These are our own personal opinions and do not represent our employer’s view in any way.

This article currently have 2,954 views

Saugata
Follow me

CC BY-ND 4.0 This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.