Results 1 to 9 of 9
-
19th Jun 2009, 04:05 PM #1OPMember
How to Scan & 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).
1. Make sure Clamav is installed on your server and/or up-to-date.
Clamav binary files are installed in (for a cPanel and DirectAdmin powered server)
/usr/local/bin and /usr/bin/
Using your favorite Linux text editor such as vi or pico, edit /etc/pure-ftpd.conf file and set the entry:
From:
#CallUploadScript yes
To:
CallUploadScript yes
Save and exit the file /etc/pure-ftpd.conf.
2. Edit the file /etc/init.d/pure-ftpd
Find the following entry:
$DAEMONIZE $fullpath /etc/pure-ftpd.conf -O clf:/var/log/xferlog $OPTIONS --daemonize
right underneath this entry add the following line:
$DAEMONIZE /usr/sbin/pure-uploadscript -B -r /var/run/pure-ftpd/clamscan.sh
3. Find the following entry:
kill $(cat /var/run/pure-ftpd.pid)
right underneath this entry add the following line:
kill $(cat /var/run/pure-ftpd/pure-uploadscript.pid)
4. Save and exit the file /etc/init.d/pure-ftpd
5. Change the directory to:
cd /var/run/pure-ftpd/
6. Create the following script: clamscan.sh and insert the following text
PHP Code:#!/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
* chmod 755 /var/run/pure-ftpd/clamscan.sh
* /sbin/service pure-ftpd restart
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:
scan=`/usr/bin/clamdscan --remove --no-summary "$1"`;
To:
scan=`/usr/bin/clamdscan --move=/root/junk --no-summary "$1"`;
If you do that, you need to create the subdirectory junk in the /root directory. To do so, execute this command:
* mkdir /root/junk
NOW ALL DONE!ashutariyal Reviewed by ashutariyal on . How to Scan & 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). 1. Make sure Clamav is installed on your server and/or up-to-date. Clamav binary files are installed in (for a cPanel and DirectAdmin powered server) /usr/local/bin and /usr/bin/ Using your favorite Linux text editor such as vi or pico, edit /etc/pure-ftpd.conf file and set the entry: From: Rating: 5
-
24th Jun 2009, 09:09 PM #2Member
Can anyone confrim this?
-
25th Jun 2009, 11:05 AM #3(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comProbably works but non-c99 shells wont be detected, so say hello to script kiddies.
-
26th Jun 2009, 06:11 AM #4MemberWebsite's:
qwerty-roms.netCould you have a PHP script which did this -
Looked at the PHP file, and if it contained keywords which are in shells e.g. -
C99
C100
Hacking
Shell
It would not upload it, if it didnt have any of the keywords, it would upload it.
-
27th Jun 2009, 10:44 PM #5Member
I would also like to know this
-
27th Jun 2009, 11:04 PM #6Member
Another way could be to stop peopel from uploading to your server and just upload to file hosting sites.
-
7th Aug 2009, 05:12 AM #7Probation
Make sure to have php edit config access /usr/local/bin and /usr/bin/ like here. Most of hosting won't gave you so just ask.
-
12th Aug 2009, 04:54 AM #8Member
Intersesting.
-
13th Aug 2009, 06:09 AM #9Member
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
sourceforge files clean or infected?
By darkpichu in forum General DiscussionReplies: 7Last Post: 26th Aug 2011, 10:57 AM -
stop while uploading
By tut2tut in forum Webmaster DiscussionReplies: 8Last Post: 1st Jul 2011, 11:38 AM -
PHP Scan dir for idetical files
By Porsche_maniak in forum Web Development AreaReplies: 30Last Post: 14th Jul 2010, 06:23 AM -
Stop uploading to RS?
By yasser37 in forum General DiscussionReplies: 1Last Post: 17th May 2010, 01:23 PM -
Always scan files befor opeing...
By MrPeanut420 in forum Useful SitesReplies: 3Last Post: 5th Feb 2010, 09:57 AM
themaCreator - create posts from...
Version 3.22 released. Open older version (or...