TL;DR
Malwaregen[trj] is a generic detection by Avast indicating potentially unwanted software or a mild threat. This guide shows you how to remove it using Avast, and then steps to clean up any remaining traces and prevent future infections.
1. Run a Full Scan with Avast
- Open Avast Security: Double-click the Avast icon in your Dock or Applications folder.
- Go to Scans: Click on ‘Scans’ in the main menu.
- Choose Full Scan: Select ‘Full scan’. This will take a long time (possibly several hours), so be patient.
- Start the Scan: Click ‘Start Scan’. Avast will check all files and folders on your Mac.
- Quarantine or Delete Threats: When the scan finishes, review any detected threats. Avast will likely recommend quarantining or deleting Malwaregen[trj]. Follow its recommendations.
2. Check Avast’s Chest (Virus Vault)
Sometimes, Avast puts quarantined files in a ‘Chest’. It’s good to review this.
- Open Avast Security: Double-click the Avast icon.
- Go to Protection: Click on ‘Protection’ in the main menu.
- Virus Chest: Select ‘Virus Chest’.
- Review and Delete (if safe): Look for any files related to Malwaregen[trj]. If you’re sure they aren’t important, delete them. Be careful not to delete legitimate files.
3. Remove Suspicious Launch Agents/Daemons
Malware can sometimes install itself to run automatically when your Mac starts up. We’ll check for these.
- Open Terminal: Open the ‘Terminal’ application (found in /Applications/Utilities/).
- List Launch Agents: Type the following command and press Enter:
launchctl list | grep -i malwaregenThis will show any launch agents with “malwaregen” in their name.
- Remove Launch Agent (if found): If you find a suspicious entry, use this command to unload it:
sudo launchctl unload /path/to/launchagent.plistReplace
/path/to/launchagent.plistwith the actual path from the previous step. You’ll need your administrator password. - List Launch Daemons: Type this command and press Enter:
launchctl list | grep -i malwaregenThis will show any launch daemons with “malwaregen” in their name.
- Remove Launch Daemon (if found): If you find a suspicious entry, use this command to unload it:
sudo launchctl unload /path/to/launchdaemon.plistReplace
/path/to/launchdaemon.plistwith the actual path from the previous step. You’ll need your administrator password. - Delete Launch Agent/Daemon Files: After unloading, delete the .plist file using Finder. It will likely be in /Library/LaunchAgents or /Library/LaunchDaemons (you may need to show hidden files – see Step 4).
4. Show Hidden Files
Files starting with a dot (.) are hidden by default on macOS. We need to see these to remove potentially malicious files.
- Open Finder: Open the ‘Finder’ application.
- Press Command + Shift + . (period): This toggles the visibility of hidden files and folders. Press it again to hide them.
5. Check for Suspicious Files in Library Folders
Malware often hides in these locations.
- Open Finder: Open the ‘Finder’ application.
- Go to Go Menu: Click on ‘Go’ in the menu bar, then select ‘Go to Folder…’.
- Enter Library Path: Type
~/Libraryand click ‘Go’. This opens your user library folder. - Check these folders for anything suspicious: Look inside Application Support, Caches, Preferences, LaunchAgents, LaunchPreferences, Logs. Delete any files or folders you don’t recognise and suspect are related to Malwaregen[trj].
- Repeat for System Library: Repeat steps 2-4 but enter
/Libraryinstead of~/Library. Be *very* careful when deleting from the system library, as removing essential files can cause problems.
6. Empty Trash
After deleting any suspicious files, empty your Trash.
7. Keep Your Software Updated
- macOS Updates: Regularly update macOS through System Preferences > Software Update.
- Avast Updates: Ensure Avast is up to date (it usually does this automatically).
- Other Applications: Keep all your other software updated as well.

