If you suspect your server has been compromised, follow the guide for your specific operating system to track down, terminate, and remove malicious processes.
ATTENTION – Critical Steps: Immediate removal is crucial. After cleanup, you must immediately change all passwords and fix the root cause of the compromise (e.g., patch outdated software or replace weak passwords).
The first phase is to find the malicious process, determine its actual location, and identify the user account under which it is running.
Use the netstat command to look for suspicious open connections. Watch for unusual ports (like 6667 / IRC) or processes that have a SYN_SENT status and are masquerading as legitimate services.
Using the Process ID (PID), check the actual location of the executable file in the /proc directory. The result should show that the process (PID 21394 in the example) is not the genuine sshd.
Open Task Manager (Ctrl+Shift+Esc) and switch to the "Details" tab. Look for processes that:
Use PowerShell to determine the full path of a suspicious executable file (EXE). Replace SuspectProcessName with the name you found in the Task Manager.
If the path points to Temp, AppData, or a directory like C:\ProgramData, the process is likely malicious.
Once identified, the process must be stopped, and the malicious files must be removed.
Forcefully terminate the malicious process using kill -9.
Recursively remove the entire directory (e.g., .bot/ in the example) to ensure no recovery scripts remain.
Stop the identified process using PowerShell with either the Process ID (PID) or the name.
Delete the executable file you identified in Step 1.2. Immediately thereafter, start a full Offline Scan with Windows Defender or your preferred antivirus software to find and isolate all related components in the system.
After the malware has been removed, you must close the security gaps through which the attacker gained entry:
Required Hardening Actions:
root / Administrator and any users under which the malicious process was running./etc/passwd. Windows: Disable the account in User Management.)