Skip to content

Instantly share code, notes, and snippets.

@jasmas
Created January 26, 2022 17:29
Show Gist options
  • Select an option

  • Save jasmas/22a4b1b12676c36074a4999c68e6a482 to your computer and use it in GitHub Desktop.

Select an option

Save jasmas/22a4b1b12676c36074a4999c68e6a482 to your computer and use it in GitHub Desktop.
Enable/Disable Cisco AnyConnect Socket Filter Extension on MacOS
#!/bin/sh
echo Disabling vpnagentd...
sudo launchctl disable system/com.cisco.anyconnect.vpnagentd
echo Tearing down vpnagentd...
sudo launchctl bootout system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
echo Deactivating Cisco AnyConnect Socket Filter Extension...
/Applications/Cisco/Cisco\ AnyConnect\ Socket\ Filter.app/Contents/MacOS/Cisco\ AnyConnect\ Socket\ Filter -deactivateExt
#!/bin/sh
echo Enabling vpnagentd...
sudo launchctl enable system/com.cisco.anyconnect.vpnagentd
echo Bootstrapping vpnagentd...
sudo launchctl bootstrap system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
@FDRcode44

Copy link
Copy Markdown

Thanks so much, @jasmas! I've found this content filter can altogether block an internet connection for some of us on Macs when working remotely. I've disabled this within network prefs, but sometimes the only thing that has worked has been to uninstall the filter from apps. I look forward to trying this script the next time it happens on a Mac.

Are you aware of a similar content filter on Windows?

@adifahmi

adifahmi commented Aug 8, 2023

Copy link
Copy Markdown

Thank you 🙏

@mixmixmix

Copy link
Copy Markdown

Thank you so much. Hopefully that allows to deactivate this junk permanently.

@ThomasJWZ

Copy link
Copy Markdown

THANK YOU. Omg this was so annoying, blessed are you who has freed me from this pop-up.

@snookie86

Copy link
Copy Markdown

It's not working with Secure Client 5.1.3.62. Please help!

Thank you!

@michaelnaumann

Copy link
Copy Markdown

It's not working with Secure Client 5.1.3.62. Please help!

For Secure Client 5.1.x try
'/Applications/Cisco/Cisco Secure Client - Socket Filter.app/Contents/MacOS/Cisco Secure Client - Socket Filter' -deactivateExt

@snookie86

Copy link
Copy Markdown

It works! Thank you!

@jasmas

jasmas commented Jul 5, 2024

Copy link
Copy Markdown
Author

Glad everyone is still enjoying this. I wrote it quite a while ago and unfortunately am no longer as embedded in the Cisco ecosystem.
If it deserves a proper repo and anyone is interested in submitting pull requests, let me know.

@jasmas

jasmas commented Jul 5, 2024

Copy link
Copy Markdown
Author

I actually quit using command line and had a BitBar script I was using on the Mac to enable and disable it visually from the menu bar.

@MrGys

MrGys commented Nov 24, 2024

Copy link
Copy Markdown

will I get in trouble for disabling and can I safely enable it back without repercussions?

@MrGys

MrGys commented Nov 24, 2024

Copy link
Copy Markdown
SCR-20241124-edke

@jasmas

jasmas commented Nov 25, 2024

Copy link
Copy Markdown
Author
SCR-20241124-edke

What view is this?

@MrGys

MrGys commented Nov 26, 2024

Copy link
Copy Markdown
SCR-20241124-edke

What view is this?

VPN & filters

@Federico90-sys

Copy link
Copy Markdown

Hi, I have create a script like this:

#!/bin/sh

echo Disabling vpnagentd...
sudo launchctl disable system/com.cisco.anyconnect.vpnagentd

echo Tearing down vpnagentd...
sudo launchctl bootout system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist

echo Deactivating Cisco AnyConnect Socket Filter Extension...
'/Applications/Cisco/Cisco Secure Client - Socket Filter.app/Contents/MacOS/Cisco Secure Client - Socket Filter' -deactivateExt

but when I restart the mac the extension is active again and the pop-up appears again.
How can I permanently disable this extension?

@storenth

storenth commented Mar 9, 2025

Copy link
Copy Markdown

very helpful tnx!

@Madmoose808

Madmoose808 commented Feb 4, 2026

Copy link
Copy Markdown

Hello, I don't know much about coding but I'm trying to completely remove cisco from my personal device as it interferes with eduroam (wifi at my university) and can't get rid of the socket filter.
Screen Shot 2026-02-04 at 3 07 18 PM
Screen Shot 2026-02-04 at 3 07 12 PM
Screen Shot 2026-02-04 at 3 07 06 PM
I don't seem to be able to remove any of these from my network area of settings and when I tried the above script in terminal this was the output "Disabling vpnagentd...
Tearing down vpnagentd...
/Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist: No such file or directory
Boot-out failed: 2: No such file or directory
Deactivating Cisco AnyConnect Socket Filter Extension...
zsh: no such file or directory: /Applications/Cisco/Cisco Secure Client - Socket Filter.app/Contents/MacOS/Cisco Secure Client - Socket Filter"
I'm not sure what to do about this and would appreciate some help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment