Possible Duplicate:
How do I deal with a compromised server?
This process is running on my Linux server and is sending spam (connecting to port 25 and port 80 with random IP's).
top - 12:28:42 up 108 days, 2:24, 1 user, load average: 0.08, 0.22, 0.37
Tasks: 116 total, 2 running, 114 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.3% us, 1.7% sy, 0.0% ni, 86.1% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 499540k total, 477096k used, 22444k free, 7916k buffers
Swap: 1015800k total, 1664k used, 1014136k free, 231476k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27850 <userid> 15 0 9808 5616 1400 S 9.3 1.1 47:14.62 perl
Pressing c while top is running shows:
27850 <userid> 15 0 9808 5616 1400 S 9.3 1.1 47:31.52 ./mail
I know the userid that is running the process. It appears to be an automated process that starts periodically (but is not running all of the time).
What can I do to find out exactly from where it's being launched (what script file, etc.)? If I look in /proc with the process ID, it shows:
-r--r--r-- 1 <userid> users 0 Jan 5 12:22 statm
-r--r--r-- 1 <userid> users 0 Jan 5 12:22 stat
-r--r--r-- 1 <userid> users 0 Jan 5 12:23 cmdline
-r--r--r-- 1 <userid> users 0 Jan 5 12:31 wchan
dr-xr-xr-x 3 <userid> users 0 Jan 5 12:31 task
-r--r--r-- 1 <userid> users 0 Jan 5 12:31 status
-r-------- 1 <userid> users 0 Jan 5 12:31 smaps
lrwxrwxrwx 1 <userid> users 0 Jan 5 12:31 root -> /
-r-------- 1 <userid> users 0 Jan 5 12:31 mountstats
-r--r--r-- 1 <userid> users 0 Jan 5 12:31 mounts
-rw------- 1 <userid> users 0 Jan 5 12:31 mem
-r--r--r-- 1 <userid> users 0 Jan 5 12:31 maps
-rw-r--r-- 1 <userid> users 0 Jan 5 12:31 loginuid
-r-------- 1 <userid> users 0 Jan 5 12:31 limits
-r--r--r-- 1 <userid> users 0 Jan 5 12:31 io
dr-x------ 2 <userid> users 0 Jan 5 12:31 fd
lrwxrwxrwx 1 <userid> users 0 Jan 5 12:31 exe -> /usr/bin/perl
-r-------- 1 <userid> users 0 Jan 5 12:31 environ
lrwxrwxrwx 1 <userid> users 0 Jan 5 12:31 cwd -> /
-rw-r--r-- 1 <userid> users 0 Jan 5 12:31 coredump_filter
-r-------- 1 <userid> users 0 Jan 5 12:31 auxv
dr-xr-xr-x 2 <userid> users 0 Jan 5 12:31 attr