No description
kinsing_cleanup.sh | ||
README.md |
I've created a comprehensive Bash script to help clean up a CyberPanel server infected with Kinsing malware. Let me break down the key features of this script:
Script Features
- Root Privilege Check: Ensures the script is run with root permissions
- Logging: Logs all actions to
/var/log/kinsing_cleanup.log
- Backup: Creates a backup of critical system files before cleanup
- Systematic Cleanup: Follows the steps you outlined in your guide
- Process Termination: Kills suspicious processes
- Service Removal: Stops and disables suspicious services
- Security Scanning: Installs and runs
chkrootkit
andrkhunter
- File Tracking: Creates a list of recently modified files
Usage Instructions
- Save the script to a file (e.g.,
kinsing_cleanup.sh
) - Make it executable:
chmod +x kinsing_cleanup.sh
- Run with sudo:
sudo ./kinsing_cleanup.sh
Precautions
- Always review the script before running
- Understand each step
- Have a backup of your critical data
- Test in a staging environment first if possible
Additional Recommendations
- After running the script, thoroughly review:
/var/log/kinsing_cleanup.log
/root/kinsing_recent_files.txt
- Results of the
rkhunter
scan
- Consider changing all passwords
- Review network logs and access patterns
- If possible, restore from a known clean backup
Disclaimer
This script is provided as-is. While it aims to help clean up the Kinsing malware, every infection is unique. Professional security consultation is recommended for complex scenarios.