How to delete com.kaspersky.kav.sysext.systemextension on macOS Monterey?

I am trying to completely remove Kaspersky Anti-Virus. I am down to one file that I can't delete - com.kaspersky.kav.sysext.systemextension. How can I get rid of it?


It shows up as a system extension under Privacy -> Full Disk Access. I try to remove it and it keeps coming back. It also shows up in the Activity Monitor Process List and reappears no matter how many times I quit the process.


I have also spent about an hour trying to delete the underlying file including:

  • Finder Delete
  • Finder Command-Delete

I always get the error - The operation can’t be completed because you don’t have permission to access some of the items.


I then tried to delete from Terminal using:

sudo rm -rf Contents

and it get ...

rm: Contents/CodeResources: Operation not permitted


rm: Contents/_CodeSignature/CodeResources: Operation not permitted


rm: Contents/_CodeSignature: Operation not permitted


rm: Contents/MacOS/com.kaspersky.kav.sysext: Operation not permitted


rm: Contents/MacOS: Operation not permitted


rm: Contents/embedded.provisionprofile: Operation not permitted


rm: Contents/Info.plist: Operation not permitted


rm: Contents: Operation not permitted

Mac mini, macOS 12.3

Posted on Mar 26, 2022 1:07 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 26, 2022 8:33 PM

diesel_dad wrote:

I have contacted Apple Support. Their brilliant answer was to reformat the drive and install MacOS from scratch as being the only way to remove the file.

Given what Etresoft has indicated, it seems that only a certified installer/uninstaller can access some of these files, apparently including the one you want to remove. Perhaps Kaspersky has such an uninstaller, but if Kaspersky itself is not trustworthy, would I use their uninstaller? I have actually done a full disk erase and reinstall in the past, it is not that hard and it will result in a clean operating system, not a bad thing. Make sure you have at least two backups, preferably two different types (e.g. Time Machine, clone, cloud-based, etc.) that you have tested, and when you migrate your files back make sure you migrate only user accounts and files, nothing else, so you don't bring that file back. By the way, there could be more than just that one file that you know about, in which case you are better off with the clean reinstall anyway, possibly.

Similar questions

16 replies
Question marked as Top-ranking reply

Mar 26, 2022 8:33 PM in response to diesel_dad

diesel_dad wrote:

I have contacted Apple Support. Their brilliant answer was to reformat the drive and install MacOS from scratch as being the only way to remove the file.

Given what Etresoft has indicated, it seems that only a certified installer/uninstaller can access some of these files, apparently including the one you want to remove. Perhaps Kaspersky has such an uninstaller, but if Kaspersky itself is not trustworthy, would I use their uninstaller? I have actually done a full disk erase and reinstall in the past, it is not that hard and it will result in a clean operating system, not a bad thing. Make sure you have at least two backups, preferably two different types (e.g. Time Machine, clone, cloud-based, etc.) that you have tested, and when you migrate your files back make sure you migrate only user accounts and files, nothing else, so you don't bring that file back. By the way, there could be more than just that one file that you know about, in which case you are better off with the clean reinstall anyway, possibly.

Mar 26, 2022 7:37 PM in response to diesel_dad

diesel_dad wrote:

I have contacted Apple Support. Their brilliant answer was to reformat the drive and install MacOS from scratch as being the only way to remove the file. I asked them to send me something where it said that removing the file was not possible and they said that they could not.

That’s the easy answer, at least as far as they are concerned.

I grew up as a Unix System programmer, so I am comfortable with using Terminal commands but there is something protecting this file that I can't seem to figure out.

It is System Integrity Protection. Unfortunately, the rules of this forum do not allow me to explain how to disable it.


The problem here is that you tried to remove the file yourself. It doesn’t matter how much experience you have. You don’t have the correct entitlements from Apple. The correct answer would have been to use the built-in Kaspersky uninstallation procedure or instructions. But that’s not possible if you’ve already deleted the software. I’m not going to recommend reinstalling either because that might be illegal now. According to the US government, Kaspersky is “an unacceptable risk to the national security of the United States or the security and safety of United States persons”.


If you can find instructions elsewhere, just make sure to re-enable System Integrity Protection when you’re done.

Apr 7, 2022 7:02 AM in response to diesel_dad

Hi - I finally decided to erase the Mac Mini and start from scratch. I did not restore anything from Time Machine and will re-install one program at a time. Almost all of my files were in iCloud or external drives, so nothing lost there. Re-installing the programs I actually use from supplier downloads. But at least Kaspersky is gone.


I did open an incident with Kaspersky support and their best suggestion so far was the "sudo rm -rf ..." approach that didn't work. I have sent them that and will post any other clever ideas they provide.


So, never install their Kaspersky malware ...

Mar 27, 2022 2:06 AM in response to diesel_dad

EDITED


As All others have mentioned regarding the Terminal command line would be required in this instance.


If willing to try this Safe Application as last ditch effort and may or may not work.


Suggest restarting in Safe Mode to perform this action.


Doing a Safe Mode boot should insure the extension does not load and make it easier for the FAF Application to find the file location.


Attempt to Drag and Drop the extension to Trash and Empty Trash.


Use the search words associate with the Offending Application


Find Any File (FAF)


Mar 27, 2022 11:22 AM in response to diesel_dad

You'll need to search online on how to remove a system extension. There are ways to do it.


As previously mentioned, without disabling security features and using somewhat arcane command line tools intended for developers, your option would be to backup your data and erase the internal drive entirely and install a clean macOS Monterey then restore your data.


[Edited by Moderator]




Mar 26, 2022 6:18 PM in response to etresoft

I have contacted Apple Support. Their brilliant answer was to reformat the drive and install MacOS from scratch as being the only way to remove the file. I asked them to send me something where it said that removing the file was not possible and they said that they could not.


I grew up as a Unix System programmer, so I am comfortable with using Terminal commands but there is something protecting this file that I can't seem to figure out.


Mar 27, 2022 6:47 AM in response to diesel_dad

diesel_dad wrote:

I have tried the Kaspersky un-installer several times and I have a ticket open with Kaspersky support. I'll wait for their response but at least now I know why I don't have the right privileges to delete.

That’s unfortunate. The manual uninstallation process is well-known. I just can’t mention it here.


Even an erase and reinstall might not help. If you restore from backup, you could restore the system extension.

Mar 28, 2022 10:08 AM in response to James Brickley

Thanks for all of the great ideas. At this point:

  1. I tried the Kaspersky Internet Security Uninstaller Utilities several times and it did not remove the file
  2. I installed and tried to uninstall Kaspersky Internet Security and it did not remove the file and it left behind about 10 files that I was able to find and Move to Trash -- so not much of an Uninstall process
  3. I opened a ticked with Kaspersky and sent them a bunch of diagnostic information - so I am going to wait for their response before proceeding with the ideas suggested here


If I do have to turn off system protections, I will do backups, re-enable right away etc.


Thanks for all the help. Bottom line - do not install Kaspersky anywhere, ever



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to delete com.kaspersky.kav.sysext.systemextension on macOS Monterey?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.