IncidentResponsev2

4.25 Stop Malware / Rootkit

Task

Identify, contain, and remove active malware or rootkits from compromised hosts across Windows, Linux, and macOS systems to prevent persistence, lateral movement, and data exfiltration.


Conditions

Given:


Standards


End State


Notes

Rootkits are stealthy and may hide processes, drivers, and files. Detection and removal require careful handling:


Manual Steps

Step 1 → Detect Malware / Rootkit

Using EDR or AV

Using Sysinternals Suite (Windows)

# List running processes
procexp.exe

# Verify signatures and VirusTotal lookup
sigcheck.exe -vt -c c:\

Using Rootkit Detection Tools

Windows
Linux
chkrootkit
rkhunter --check
macOS
sudo kextstat | grep -v com.apple

Network/Command Line Behavior


Step 2 → Isolate System

# Example (Crowdstrike)
falconctl -g --isolation

Step 3 → Quarantine or Remove Malware / Rootkit

Automated Tools

Windows
Linux
rm /usr/bin/.malwarehidden
macOS
sudo rm ~/Library/LaunchAgents/com.malware.plist

Manual File Removal (if necessary)

Remove-Item -Force -Path "C:\malwarepath\malicious.exe"

Step 4 → Validate Removal and Perform Post-Cleanup

Windows
Get-ScheduledTask
Linux
crontab -l
ls /etc/cron.*
macOS
launchctl list

Running Script Examples

Example → Windows Sigcheck for hidden unsigned malware/rootkit
sigcheck.exe -e -v -c c:\
Example → Linux Find hidden files
find / -name ".*" -type f
Example → macOS List unsigned kernel extensions
kextstat | grep -v com.apple

Dependencies


Other Available Tools

Tool Platform Installation Usage
GMER Windows Portable Rootkit detection
Malwarebytes Windows/macOS Installed Malware and rootkit removal
Sysinternals Suite Windows Portable File, process, autorun analysis
rkhunter / chkrootkit Linux Installed Rootkit detection
KnockKnock macOS Installed Autorun analysis

Operator Recommendations and Best Practices

Operator Checklist

Best Practices


References


Revision History

Date Version Description Author
2025-05-02 1.0 Generated detailed operator workflow with detection, containment, and eradication process Leo