Arlen Holder
2020-11-08 22:08:10 UTC
I was setting up a friend's machine with a killswitch when I realized
that the web site I used to use is no longer available (at least today).
So, for posterity, so that everyone else can have the killswitch,
these are posted from my archives, where I include the batch file below.
Here is the original tutorial but without the actual killswitch batch file:
o Tutorial to add a freeware killswitch which blocks software installations from phoning home during or after the initial install process
<https://groups.google.com/g/alt.comp.freeware/c/5VPbErk7PBQ>
The use model is to be off the network under two circumstances:
1. Whenever the machine boots, it _always_ boots off the network
2. Whenever I install software, I run the killswitch
To run the killswitch is trivial:
o Win+R > killswitch (or whatever you want to name it)
Where the "name" is whatever name you put in the AppPaths key.
o [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths]
Given the web site appears to be dead today, here's the batch file:
o <https://www.liquidvpn.com/vpn-kill-switches/>
The actual batch file is "supposed" to be here, but failed today:
o <https://my.liquidvpn.com/dl.php?type=d&id=49>
Hence, here is that file, verbatim, from my software archives:
o Name: LiquidVPN-Kill-Switch.bat
o Size: 2747 bytes (2 KiB)
o SHA256: 933B7BD76EECB04D57A1A55E972C868D0460EB21021C16ED0ABC0B02EBD532A7
===< Below is LiquidVPN-Kill-Switch.bat >===
@echo off
:: GetAdmin
:-------------------------------------
:: Verify permissions
if '%errorlevel%' NEQ '0' (
echo Getting administrative privileges...
goto DoUAC
) else ( goto getAdmin )
:DoUAC
echo Set UAC = CreateObject^("Shell.Application"^) >
"%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >>
"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:getAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
@echo off
:: CHANGE DEFAULT GW IP BELOW
set defgw=192.168.0.1
@For /f "tokens=3" %%1 in (
'route.exe print 0.0.0.0 ^|findstr "\<0.0.0.0.*0.0.0.0\>"') Do set
defgw=%%1
cls
:start
cls
echo.
color 0C
echo LiquidVPN's Simple VPN Kill Switch, ver. 0.1 - by LiquidVPN
echo.
echo.
echo Your routers gateway is probably "%defgw%"
echo -if nothing appears or its incorrect, add it manually (Press '3')
echo.
echo USAGE:
echo.
echo -Press "1" to Enable Kill Switch (IP "%defgw%")
echo -Press "2" to Disable Kill Switch (IP "%defgw%")
echo -Press "3" to manually set default gateway if its not detected above.
echo -Press "h" for Kill Switch Help
echo -Press "x" to exit Kill Switch.
echo.
set /p option=Your option:
if '%option%'=='1' goto :option1
if '%option%'=='2' goto :option2
if '%option%'=='3' goto :option3
if '%option%'=='x' goto :exit
if '%option%'=='h' goto :help
echo Insert 1, 2, x or h
timeout 3
goto start
:option1
route delete 0.0.0.0 %defgw%
echo Default gateway "%defgw%" removed
timeout 3
goto start
:option2
route add 0.0.0.0 mask 0.0.0.0 %defgw%
echo Defaulte gateway "%defgw%" restored
timeout 3
goto start
:option3
echo
set /p defgw=your gw IP (e.g. 192.168.0.1):
goto start
:help
cls
echo.
echo.
echo ======================
echo This simple kill switch removes your default gateway
echo and blocks traffic from reaching the internet when
echo your VPN gets disconnected.
echo.
echo Here is how you use it.
echo.
echo Step 1: Connect to LiquidVPN
echo Step 2: Enable LiquidVPN's Kill Switch (option "1")
echo.
echo Now Any internet traffic will pass through LiquidVPN only.
echo.
echo - If your VPN gets disconnected so will your internet.
echo - Disable the Kill Switch and reconnect.
echo.
echo.
echo When you disconnect from LiquidVPN follow these steps
echo to reconnect or to browse the internet normally.
echo.
echo Step 1: Close any software that may leak your real IP
echo Step 2: Disable the LiquidVPN kill switch (Option "2")
echo Step 3: Reconnect to LiquidVPN and enable the kill switch (Option "1")
echo.
timeout /T -1
goto start
:exit
exit
===< Above is LiquidVPN-Kill-Switch.bat >===
As always, please improve so all benefit from every action you take.
that the web site I used to use is no longer available (at least today).
So, for posterity, so that everyone else can have the killswitch,
these are posted from my archives, where I include the batch file below.
Here is the original tutorial but without the actual killswitch batch file:
o Tutorial to add a freeware killswitch which blocks software installations from phoning home during or after the initial install process
<https://groups.google.com/g/alt.comp.freeware/c/5VPbErk7PBQ>
The use model is to be off the network under two circumstances:
1. Whenever the machine boots, it _always_ boots off the network
2. Whenever I install software, I run the killswitch
To run the killswitch is trivial:
o Win+R > killswitch (or whatever you want to name it)
Where the "name" is whatever name you put in the AppPaths key.
o [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths]
Given the web site appears to be dead today, here's the batch file:
o <https://www.liquidvpn.com/vpn-kill-switches/>
The actual batch file is "supposed" to be here, but failed today:
o <https://my.liquidvpn.com/dl.php?type=d&id=49>
Hence, here is that file, verbatim, from my software archives:
o Name: LiquidVPN-Kill-Switch.bat
o Size: 2747 bytes (2 KiB)
o SHA256: 933B7BD76EECB04D57A1A55E972C868D0460EB21021C16ED0ABC0B02EBD532A7
===< Below is LiquidVPN-Kill-Switch.bat >===
@echo off
:: GetAdmin
:-------------------------------------
:: Verify permissions
nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
:: On Error No Adminif '%errorlevel%' NEQ '0' (
echo Getting administrative privileges...
goto DoUAC
) else ( goto getAdmin )
:DoUAC
echo Set UAC = CreateObject^("Shell.Application"^) >
"%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >>
"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:getAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
@echo off
:: CHANGE DEFAULT GW IP BELOW
set defgw=192.168.0.1
@For /f "tokens=3" %%1 in (
'route.exe print 0.0.0.0 ^|findstr "\<0.0.0.0.*0.0.0.0\>"') Do set
defgw=%%1
cls
:start
cls
echo.
color 0C
echo LiquidVPN's Simple VPN Kill Switch, ver. 0.1 - by LiquidVPN
echo.
echo.
echo Your routers gateway is probably "%defgw%"
echo -if nothing appears or its incorrect, add it manually (Press '3')
echo.
echo USAGE:
echo.
echo -Press "1" to Enable Kill Switch (IP "%defgw%")
echo -Press "2" to Disable Kill Switch (IP "%defgw%")
echo -Press "3" to manually set default gateway if its not detected above.
echo -Press "h" for Kill Switch Help
echo -Press "x" to exit Kill Switch.
echo.
set /p option=Your option:
if '%option%'=='1' goto :option1
if '%option%'=='2' goto :option2
if '%option%'=='3' goto :option3
if '%option%'=='x' goto :exit
if '%option%'=='h' goto :help
echo Insert 1, 2, x or h
timeout 3
goto start
:option1
route delete 0.0.0.0 %defgw%
echo Default gateway "%defgw%" removed
timeout 3
goto start
:option2
route add 0.0.0.0 mask 0.0.0.0 %defgw%
echo Defaulte gateway "%defgw%" restored
timeout 3
goto start
:option3
echo
set /p defgw=your gw IP (e.g. 192.168.0.1):
goto start
:help
cls
echo.
echo.
echo ======================
echo This simple kill switch removes your default gateway
echo and blocks traffic from reaching the internet when
echo your VPN gets disconnected.
echo.
echo Here is how you use it.
echo.
echo Step 1: Connect to LiquidVPN
echo Step 2: Enable LiquidVPN's Kill Switch (option "1")
echo.
echo Now Any internet traffic will pass through LiquidVPN only.
echo.
echo - If your VPN gets disconnected so will your internet.
echo - Disable the Kill Switch and reconnect.
echo.
echo.
echo When you disconnect from LiquidVPN follow these steps
echo to reconnect or to browse the internet normally.
echo.
echo Step 1: Close any software that may leak your real IP
echo Step 2: Disable the LiquidVPN kill switch (Option "2")
echo Step 3: Reconnect to LiquidVPN and enable the kill switch (Option "1")
echo.
timeout /T -1
goto start
:exit
exit
===< Above is LiquidVPN-Kill-Switch.bat >===
As always, please improve so all benefit from every action you take.
--
See also:
o What are your FAVORITE Windows registry keys (that you use most?)
<https://groups.google.com/forum/#!topic/alt.comp.microsoft.windows/fYPn38xN3ZM>
See also:
o What are your FAVORITE Windows registry keys (that you use most?)
<https://groups.google.com/forum/#!topic/alt.comp.microsoft.windows/fYPn38xN3ZM>