Following is the output of the "top" command. I have clipped the result. Here, I want to know the detail of the process called httpd.pl
.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
23546 user 20 0 55596 5428 808 S 0.7 0.1 0:01.52 httpd.pl
This looks suspicious for me, because when I do lsof -p 5182
, it shows following output, showing that the process is opening port 39331:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd.pl 5182 user 3u IPv4 168936033 0t0 TCP *:39331 (LISTEN)
I have used few commands to find out from where it is running, but I was unable to find. I have used following commands so far:
#ls -l /proc/PID/cwd
#cat /proc/PID/environ | tr '\0' '\n'
#ps -p PID -o command
However, none of them shows the exact location. It shows /
as cwd but there is no such file called httpd.pl
there. Also a friend of mine told me that httpd.pl
may be a fake name, because it is trivial to change a process name:
-bash-4.1# cat testing.pl
#!/usr/bin/perl
print `ps $$`;
$0="my_name_is_httpd.pl .. honest";
print `ps $$`;
-bash-4.1#
-bash-4.1# ./testing.pl
PID TTY STAT TIME COMMAND
6762 pts/0 S+ 0:00 /usr/bin/perl ./testing.pl
PID TTY STAT TIME COMMAND
6762 pts/0 S+ 0:00 my_name_is_httpd.pl .. honest
-bash-4.1#