Skip to content

hook-s3c/vpngate-automator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPN Gate auto-grabber

Greetz

shouts to sh3llg0d, an0n_l1t3, daemochi, akatz!!!!

Overview

You need a VPN if you want to keep prying eyes away from your network traffic - big brother, network admins, bad actors.

Use this script to grab a free VPN from vpngate.net

Quickstart

git clone https://github.com/hook-s3c/vpngate-automator.git
cd vpngate-automator
sudo chmod +x ./fetchvpns.py
pip install -r ./requirements.txt

./fetchvpns.py

Requirements

Should work on all Debian systems, tested on Ubuntu 16.04. You will neeed to install OpenVPN on your system.

apt-get install openvpn
apt-get install python-notify

Breakdown

  1. initial load will pull down the CSV, parse and output it to the console
  2. you will be asked which country shortcode to filter by
  3. after choosing a country shortcode, you will then be presented with the filtered results
  4. the program will then ask you to choose a VPN config by the identifier in the first column
  5. choose an identifier and the program will create the OpenVPN config file in ./.vpnconfigs/
  6. it will then run the openvpn client with escalated privileges and you will now be tunnelled to another country
  7. profit!

Consider a firewall (optional)

After investing some time in Wireshark, I noticed that some traffic liked to leak outside of the VPN - this part will help close this down.

This script will automatically generate a UFW profile from a template found in ./templates/.

  • export ufw rules
  • helpful output to explain which iptables/firewall rules to import
apt-get install ufw
apt-get install gufw

Steps

  1. Run script with optional firewall paramter --firewall
  2. Open GUFW
  3. change permissions on file; sudo chmod 0600 ./templates/output/ufwrules.profile
  4. file > import profile
  5. choose ufwrules from dropdown
  6. press enter to launch the VPN

Roadmap

must have;

  • add firewall configuration (see above) should have;
  • allow mirrors for CSV URL could have;
  • abstract configuration
  • dockerize to alpine container
  • format the data in the columns to something more meaningful
  • filter base64 output for UDP/TCP and port
  • refactor user input to allow adjustments of filters
  • command line arguments (country/filters, auto-start) to just get going
  • unit tests

Notes

This is one of my first python scripts as I learn, so some parts may look hella ugly.

There is no support, fork/PR as you wish. MIT license, so attribution is mandatory.

Support for notifications in the gnome interface.

There are no unit tests, sorry.

References

Here are some links to some bits I had to pull together, when I had no clue of the subtleties of python;

About

Python script to pull down valid OpenVPN configs from vpngate.net, and launch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages