If your Mac has been attacked by a virus that can’t be removed or so much damage has been done that is practically unusable then the best course of action is to zap the main disk and install a fresh copy of MacOS from a bootable usb.
- Ensure you have a Time Machine backup. Also ensure you have iCloud configured to backup important app settings, e.g. Documents, Device Settings, Mail, Contacts, Keychain, etc. and everything is synchronised to the iCloud server.
- Make a list of the Applications directory as follows:
- In Finder open Applications folder and press Command+A to select all apps, then press Command+C
- In TextEdit, create a new document, select Format -> Make Plain Text from the menu bar, press Command+V to paste list of app names into the document and save as apps.txt.
- Alternatively, if not many, write down the names of 3rd party apps to reinstall later.
- Create a bootable MacOS usb installer, e.g. High Sierra – see Apple Support instructions
- Skip to step 9 if don’t want to delete all the system hard disk partitions.
- Create a Gparted Live usb http://gparted.org/liveusb.php
- Restart your Mac. On hearing the boot chime hold down the Option key until you see the Startup Manager menu. Select Gparted usb from the menu.
- From Gparted delete all partitions, e.g. EFI, Macintosh HD, HD Recovery. quit and shut down
- Remove Gparted usb
- Insert your MacOS bootable usb.
- Power up and let it boot straight from the usb and go to step 12 or if you have skipped Gparted partition removal wait for boot chime, hold Option key until you see the Startup Manager. From the main menu select Disk Utility and Erase the internal Mac HD then quit to main menu.
- Select Install MacOS and follow instructions. When it comes to Migration Assistant connect your Time Machine or Time Capsule (you will need a login password) backup drive. Then
- Untick Applications (to avoid reinstalling infected 3rd party programs)
- Tick Users
- Tick “Other Files and folders”
- Tick “Computer & Network Settings”
- Continue to restore your data and settings.
- Once macOS is installed and up and running clean up Safari by using the following instructions Safari Manual Reset
- Carefully install required 3rd party programs – refer to text file in step 2.
Your Mac should now be clean.