| HowTo scan and stop uploading infected files to your server | |||||||||||||
To scan and stop uploading infected files to your server , you need to enable ClamAV with PureFTP (Do not use this with ProFTP or other FTP services on your server).
Clamav binary files are installed in (for a cPanel and DirectAdmin powered servers) Using your favorite Linux text editor such as vi or pico, edit /etc/pure-ftpd.conf file and set the entry: From: Save and exit the file /etc/pure-ftpd.conf.
#!/bin/sh
if [ "$1" = "" ]; then
echo 'Variable is blank';
exit;
fi
if [ ! -f "$1" ]; then
echo "$1 file not found"
exit;
fi
date=`date '+%d-%m-%y %H:%M'`;
scan=`/usr/bin/clamdscan --remove --no-summary "$1"`;
echo "$date ClamAV $scan" >> /var/log/messages
Since we used the switch --remove with the clamscan command in the script above, infected files will be permanently deleted. If you do not want the script to delete infected files and just move them to a directory, change the following entry: From: To: If you do that, you need to create the subdirectory junk in the /root directory. To do so, execute this command:
DONE! |
|||||||||||||

