2

I've noticed that one system user is constantly downloading a single JPEG file (every few seconds) via FTP server. The source IP is actually assigned to the server itself. I've tried to use tools like lsof, ps, top. I've also checked the cron jobs with no luck. Could you please advise how I can trace the source of this process, script? Please note that this server is running cPanel.

I could use strace however the process is not running long enough to catch it.

# tail /var/log/xferlog
    Wed Jan 23 14:21:26 2013 0 xxx.xxx.xxx.xxx 14558 /path_to_dir/file.jpg b _ o r user ftp 1 * c
    Wed Jan 23 14:21:26 2013 0 xxx.xxx.xxx.xxx 14558 /path_to_dir/file.jpg b _ o r user ftp 1 * c
    Wed Jan 23 14:21:27 2013 0 xxx.xxx.xxx.xxx 14558 /path_to_dir/file.jpg b _ o r user ftp 1 * c

2 Answers 2

5

You could temporarily replace that file with a much larger file, or a FIFO (see mkfifo command) and then look for that process again.

1
  • this is a great idea that I never thought of. perhaps a symlink to /dev/random would work if pureftpd follows symlinks. Then it will be held indefinitely. You would of course need to kill the process fairly quickly or you might run out of memory.
    – drone.ah
    Jan 23, 2013 at 15:28
3

You can use -f option of strace for tracing child processes. Get pid of suspicious process, then execute strace -f -p pid -o /tmp/strace.log. You should search "connect" or "RETR" keyword.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .