Security

How can we help?

Guides and technical documentation for your Server4You dedicated server or VPS.

Removing Bots & Malware

This guide shows how to find, stop and remove malicious processes such as bots or crypto miners on a compromised Linux or Windows server. It also lists the steps required after cleanup to close the entry point.

Linux Server

Step 1: Check for suspicious connections

Use ss (or the older netstat) to find unusual open connections — watch for non-standard ports (e.g. 6667 / IRC) or processes with a SYN_SENT status masquerading as legitimate services like sshd:

Terminal
ss -tunap | grep 6667 # alternative with net-tools: netstat -plant | grep 6667

Step 2: Identify the process path

Once you have the Process ID (PID) from the output, check the actual location of the executable in /proc:

Terminal
ls -l /proc/21394/exe

If the path points somewhere unexpected — like /usr/local/games/.bot/httpd instead of a real system binary — the process is malicious.

Step 3: Kill the process

Forcefully terminate the process using its PID:

Terminal
kill -9 21394

Step 4: Delete the malicious directory

Navigate to the parent directory and recursively delete the malicious folder — this ensures no recovery scripts remain:

Terminal
cd /usr/local/games rm -rf .bot/

Windows Server

Step 1: Find suspicious processes

Open Task Manager (Ctrl+Shift+Esc) → Details tab. Look for processes with unusually high CPU or memory usage, random-looking names, or processes running under an unexpected system user.

Step 2: Identify the process path

To get the full file path of a suspicious process, run the following in PowerShell — replace SuspectProcessName with the name from Task Manager:

PowerShell
Get-Process -Name "SuspectProcessName" | Select-Object Path

If the path points to Temp, AppData, or C:\ProgramData, the process is very likely malicious.

Step 3: Terminate the process

Stop the process via PowerShell using either the PID or the process name:

PowerShell
Stop-Process -Id 9876 -Force Stop-Process -Name "SuspectProcessName" -Force

Step 4: Delete the file and run a scan

Delete the executable file identified in Step 2. Then run a full Offline Scan with Microsoft Defender Antivirus to find and isolate all related components — the offline scan runs before Windows boots, so it can catch malware that hides during normal operation.

After Cleanup — Required Actions