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
- initial load will pull down the CSV, parse and output it to the console
- you will be asked which country shortcode to filter by
- after choosing a country shortcode, you will then be presented with the filtered results
- the program will then ask you to choose a VPN config by the identifier in the first column
- choose an identifier and the program will create the OpenVPN config file in ./.vpnconfigs/
- it will then run the openvpn client with escalated privileges and you will now be tunnelled to another country
- 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
- Run script with optional firewall paramter
--firewall
- Open GUFW
- change permissions on file;
sudo chmod 0600 ./templates/output/ufwrules.profile
file > import profile
- choose ufwrules from dropdown
- 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;
评论