All Projects → primaryobjects → Vpndemon

primaryobjects / Vpndemon

Monitor a VPN connection on Linux and kill a process upon disconnect

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Vpndemon

Firewalla
http://firewalla.com
Stars: ✭ 305 (+238.89%)
Mutual labels:  vpn, monitoring
The Bits And Bytes Of Computer Networking
Networking , N/W layer, Transport and Application Layer, Networking Service, Internet, Troubleshooting , N/W future
Stars: ✭ 87 (-3.33%)
Mutual labels:  vpn
Pcm
Processor Counter Monitor
Stars: ✭ 1,240 (+1277.78%)
Mutual labels:  monitoring
Maze
Maze Applied Reinforcement Learning Framework
Stars: ✭ 85 (-5.56%)
Mutual labels:  monitoring
Beamium
Prometheus to Warp10 metrics forwarder
Stars: ✭ 82 (-8.89%)
Mutual labels:  monitoring
Shynet
Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.
Stars: ✭ 1,273 (+1314.44%)
Mutual labels:  monitoring
Wirehole
WireHole is a combination of WireGuard, Pi-hole, and Unbound in a docker-compose project with the intent of enabling users to quickly and easily create a personally managed full or split-tunnel WireGuard VPN with ad blocking capabilities thanks to Pi-hole, and DNS caching, additional privacy options, and upstream providers via Unbound.
Stars: ✭ 1,232 (+1268.89%)
Mutual labels:  vpn
Xsrv
[mirror] Install and manage self-hosted services/applications, on your own server(s) - ansible collection and utilities
Stars: ✭ 89 (-1.11%)
Mutual labels:  monitoring
Homer App
HOMER 7.x Front-End and API Server
Stars: ✭ 88 (-2.22%)
Mutual labels:  monitoring
Desktop Legacy
VPN.ht Desktop Application for Windows and Mac OS X built on top of Electron
Stars: ✭ 83 (-7.78%)
Mutual labels:  vpn
Sampler
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
Stars: ✭ 9,203 (+10125.56%)
Mutual labels:  monitoring
Wazuh Documentation
Wazuh - Project documentation
Stars: ✭ 82 (-8.89%)
Mutual labels:  monitoring
Influxgraph
Graphite InfluxDB backend. InfluxDB storage finder / plugin for Graphite API.
Stars: ✭ 87 (-3.33%)
Mutual labels:  monitoring
Gonvml
NVIDIA Management Library (NVML) bindings for Go
Stars: ✭ 82 (-8.89%)
Mutual labels:  monitoring
Ios App
Official IVPN iOS app
Stars: ✭ 89 (-1.11%)
Mutual labels:  vpn
Pg activity
pg_activity is a top like application for PostgreSQL server activity monitoring.
Stars: ✭ 1,232 (+1268.89%)
Mutual labels:  monitoring
Chronograf
Open source monitoring and visualization UI for the TICK stack
Stars: ✭ 1,245 (+1283.33%)
Mutual labels:  monitoring
Cloudprober
An active monitoring software to detect failures before your customers do.
Stars: ✭ 1,269 (+1310%)
Mutual labels:  monitoring
Black.box
Plug-and-Play VPN router and unblocker
Stars: ✭ 89 (-1.11%)
Mutual labels:  vpn
Cronmon
定时任务执行状态监控
Stars: ✭ 90 (+0%)
Mutual labels:  monitoring

VPNDemon

for Linux

VPNDemon monitors your VPN connection and kills a target program upon disconnect. It's the safest and easiest way to help prevent DNS leaks and enhance your security while connected over a VPN.

Screenshot 1

It's as simple as this:

  • Run vpndemon.sh.
  • Enter the name of the target process to kill when the VPN disconnects.

That's it!

Install

  1. Download vpndemon.sh and place it in a folder, such as ~/Documents/vpndemon.
cd ~/Documents/vpndemon
bash vpndemon.sh
  1. Enter the name of a program to kill when the VPN disconnects. This can be a substring of the name, such as "chrome", "firefox", etc.

Enter a target process to kill upon VPN disconnect

  1. Click OK to start monitoring.

Monitoring VPN connection

  1. VPNDemon is now monitoring your VPN connection. If your not already connected to your VPN, go ahead and connect now.

Detecting a VPN connection

  1. Try disconnecting your VPN. VPNDemon will detect the disconnect, kill all instances of the target program, and update its status.

Detecting a VPN disconnect

Installing as an Application

  1. Download vpndemon.sh and install.sh. Run install.sh.
cd ~/Documents/vpndemon
sudo bash install.sh
  1. After installing, open the start menu and search for VPNDemon. Right-click the result and select "Add to Panel" or "Add to Desktop".

Technical Details

VPNDemon monitors the VPN connection by listening to events from the linux NetworkManager. When a VPN connect/disconnect event is received, the signal is checked to see which state it relates to. If it's a connect state, the status is simply displayed in the main window. If it's a disconnect state, VPNDemon immediately issues a kill command for all processes that match the target process name:

for i in `pgrep $killProgramName`
do
    kill $i
done

Since the NetworkManager is being listened to, directly via the dbus-monitor, disconnect events are detected almost instantly. Likewise, the target process is killed almost instantly.

VPNDemon should be compatible with any linux system that uses NetworkManager for VPN connections.

Troubleshooting

  1. A log file is saved to /tmp/vpndemon, which contains the list of VPN connect/disconnect events and a list of processes terminated. The log is cleared each time the app is run. However, you can review the log during or after running the app, to help determine any troubleshooting issues.

Preventing DNS Leaks with IPv6

If you want even tighter privacy, you can disable IPv6. This is easy to do. IPv6 incorporates hardware MAC addresses, and since many VPN services do not yet route IPv6 traffic, it creates a potential leak for network activity.

To disable IPv6, edit the file /etc/sysctl.conf and add the following lines:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

After making these changes, refresh the file by running:

sudo sysctl -p

To verify IPv6 is actually disabled, run ifconfig and verify that "inet6" is not present in the output:

ifconfig | grep inet6

License

MIT

Author

Kory Becker http://www.primaryobjects.com/kory-becker

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].