A process occupies a lot of CPU, and when I kill it by kill -9, it just re-runs with another name.
How can I find it out, kill and delete it?. Its parent pid is 1, started by root user, and on the directory of /usr/bin with a random hex name like 3b62ba238f. And when I try to kill it, it just re runs with another new name/command. For example, if I kill the process 15459 in the first picture, another process starts to run with a new name/command.
The both occupy a lot of CPU and with the parent id of 1.
The syslog prints the following when the new process starts
How can I find, shut down and delete the process/file?
The malware was found following the steps below.
- Find the service corresponding to the process.
systemctl status <PID>
Locate the service file, stop and remove the service. Then delete the files.
systemctl stop pmapx_start_2
systemctl disable pmapx_start_2
rm -f /etc/systemd/system/multi-user.target.wants/pmapx_start_2.service
rm -f /usr/sbin/route_forbidden-close
/proc/22730/cmdline
? note that proc/*/cmdline is in NUL separated format so probably best to usehd
akahexdump
instead of justcat
. that might give you something to grep for in your system's startup files (which will vary depending on which init you're using, probably systemd as it's the default for most distros these days) – cas Jun 02 '21 at 08:01ls -lF
, because you want to see the symlink targets. – cas Jun 02 '21 at 08:04kill -s STOP <pid>
. – Jeremy Boden Jun 02 '21 at 12:26