Ξ welcome to cryptostorm's member forums ~ you don't have to be a cryptostorm member to post here Ξ
∞ take a peek at our legendary cryptostorm_is twitter feed if you're into that kind of thing ∞
Ξ we're rolling out voodoo network security across cryptostorm - big things happening, indeed! Ξ
Ξ any OpenVPN configs found on the forum are likely outdated. For the latest, visit GitHub Ξ

a vpn kill switch script and Windows application

A core mission of cryptostorm is ensuring consistent, reliable network security with minimal fuss & drama. From DNS-based services like our DeepDNS in-browser native .onion/.i2p site access, through grounbreaking research on IP6 leakblocking, & to firewall-based structures to enable "fail-closed" security, this is where we discuss & develop cryptostorm-style leakblock tech.

Topic Author
hulltech_unseen
Posts: 21
Joined: Wed Nov 12, 2014 7:41 pm

a vpn kill switch script and Windows application

Postby hulltech_unseen » Fri Nov 14, 2014 2:53 pm

I found this while looking on the web for a vpn kill switch, can someone who is versed in scripting languages take a peek.
vpn script for a killswitch ;


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace InternetKillSwitch
{
public partial class Form1 : Form
{

IPHostEntry host;
string localIP = "?";
bool vpnON = false;
int timerCount = 0;
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
button2.Enabled = true;
button1.Enabled = false;
textBox1.Enabled = false;

timer1.Start();
}

private void button2_Click(object sender, EventArgs e)
{
button2.Enabled = false;
button1.Enabled = true;
textBox1.Enabled = true;
}

private void button3_Click(object sender, EventArgs e)
{

foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
string value = nic.Name;
Process.Start("cmd.exe", "/c netsh interface set interface \"" + value + "\" ENABLED"); //This should enable the interfaces again but for some reason doesnt work.
}
MessageBox.Show("All network adapters have been re-enabled. InternetKillSwitch is OFF.");
}

private void checkVPN()
{
vpnON = false;
if (textBox1.Text != "")
{
IPHostEntry host;
string localIP = "?";
host = Dns.GetHostEntry(Dns.GetHostName()); //This gets what your current IP Address is
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily.ToString() == "InterNetwork")
{
localIP = ip.ToString();
if (ip.ToString() == textBox1.Text) //Returns true if the VPN Address typed matches the IP from the system
{
vpnON = true;
timer1.Start(); //Restart the timer since the check was good
}
}
}

if (vpnON == false)
{
//Kill all internet adapters

foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
string value = nic.Name;
Process.Start("cmd.exe", "/c netsh interface set interface \"" + value + "\" DISABLED");

}
MessageBox.Show("WARNING: VPN Address was NOT found. All Network Adapters have been disabled!");
timer1.Stop();
button2.Enabled = false;
button1.Enabled = true;
textBox1.Enabled = true;
}
}
}

private void timer1_Tick(object sender, EventArgs e) //This is the function to continuously check for VPN Connectivity, default check is every 5 seconds
{
timerCount = timerCount + 1;
if (timerCount > 5)
{
timer1.Stop();
checkVPN();
timerCount = 0;
}
}
}
}


this is from http://www.codeproject.com/Tips/834749/VPN-Kill-Switch

The Code Project Open License (CPOL

User avatar

parityboy
Site Admin
Posts: 1096
Joined: Wed Feb 05, 2014 3:47 am

Re: a vpn kill switch script and Windows application

Postby parityboy » Tue Nov 18, 2014 3:43 pm

@OP

I'm not familiar enough with Windows to tell you if the code is effective or not, but what I can say is that it certainly isn't a scripting language. It's C#, written for the .NET platform. It needs to be compiled before it can run.

User avatar

marzametal
Posts: 504
Joined: Mon Aug 05, 2013 11:39 am

Re: a vpn kill switch script and Windows application

Postby marzametal » Wed Nov 19, 2014 11:19 am

Spotshot put me onto one that he has been using for a while now... depends on your definition of killswitch...
http://vpnetmon.webs.com/


Topic Author
hulltech_unseen
Posts: 21
Joined: Wed Nov 12, 2014 7:41 pm

Re: a vpn kill switch script and Windows application

Postby hulltech_unseen » Thu Nov 20, 2014 6:05 pm

Black vpn is trying to sell the idea if yo go with them and have the modified router that you can change your servers remotely from the router. They are pushing dd-wrt firmware , you can buy a router through them or flash routers. I asked cyberghost vpn for a copy of the firmware update and software ( my wife seen a deal for a year for 5 devices premium vpn 23.00 us.) They don't want to give a copy of the special software so I will get a list of all servers, the router setups, Mac,nix,android,ect. I have been looking for a kill switch and dns leak fix as well as a way to combine the ovpn into a. Menu you can change remotely safety.


Return to “DeepDNS.net - cryptostorm's no-compromise DNS resolver framework”

Who is online

Users browsing this forum: No registered users and 3 guests

cron

Login