Removing network service

mike_pinto
New Contributor III

Hey all, I'm hoping someone may be able to help with this. I had posted this in Slack, but I still have yet to figure it out.

Some of our students (in their infinite wisdom) have installed the "Betternet VPN" from the App Store to circumvent our filter. We now have this traffic firewalled off and are left with the network service on their computer. However, they cannot pass any traffic externally until this network service is removed from their account.

a26444621a3f4192b590d495d0b9b68f

Attempting to listallnetworkservices will not return the "Betternet VPN" service. Nothing I have tried will return this service. If I run an ifconfig while it is connected then utun1 is created.

Anyone have any ideas on how remove this? Our techs are wasting time having to do this manually. Any help would be greatly appreciated!

6 REPLIES 6

mm2270
Legendary Contributor III

I haven't used this myself, but is there an associated "app" since it comes from the App Store? If so, has the app been removed? I'm wondering if the app is removed if it will also remove the Betternet VPN service from the service section.

It's curious that the service doesn't show up with networksetup since it's clearly listed there. You might also see about contact support for the product to see if they can explain how it adds the service in and how to remove it. Not sure where you would get with them on that, but worth a try.

ammonsc
Contributor II

I did something similar before. Here is the script.

#!/bin/sh

# Detects all network hardware & creates services for all installed network hardware
/usr/sbin/networksetup -detectnewhardware

IFS=$'
'

# Loops through the list of network services containing VPN
for service in $(/usr/sbin/networksetup -listallnetworkservices | grep VPN | grep -v "VPNNOTTOREMOVE" ); do
    /usr/sbin/networksetup -removenetworkservice "${service}"
done

exit 0

We had a standard name for our VPN represented here as "VPNNOTTOREMOVE" that way I could remove any VPN that was not created/approved by us.

mike_pinto
New Contributor III

@mm2270 Sorry I should have mentioned that removing the software does not remove the service it creates.

@ammonsc The problem is that it does not show up using listallnetworkservices. The only things that show up are the other three services (Wi-Fi, Bluetooth PAN, Thunderbolt Bridge). I can never get Betternet VPN to show up. If I run ifconfig when the VPN is connected I see untun1.

Thanks for the responses!

daz_wallace
Contributor III

It could be installed via a locally installed Profile perhaps?

Certainly worth taking a look. If so, you can use the profiles CLI tool to remove it en mass.

Hope that helps

Darren

mike_pinto
New Contributor III

@daz_wallace Doesn't appear to be a profile that was installed.

I'm going to try as @mm2270 suggested and contact their support.

bumbletech
Contributor III

@mike.pinto , any updates? We just came across this today.