How to set AV just for server wide but not email?
#1
Posted 14 July 2008 - 09:36 AM
is there a way to install just the AntiVirus to check the data on a server but not for email?
Regards,
Sergio
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#2
Posted 14 July 2008 - 11:22 AM
locate -i -r '^/home/' | xargs -i clamdscan --no-summary '{}'
It will take 15 - 30 minutes. You should test it by replacing /home to one of your client folder to see its result.
#3
Posted 14 July 2008 - 12:43 PM
locate -i -r '^/home/' | xargs -i clamdscan --no-summary '{}'
It will take 15 - 30 minutes. You should test it by replacing /home to one of your client folder to see its result.
Thank you Pairote.
This is a really nice command, it even could be set in a cron on the server. Why is not this a regular practice in all servers? or is only me?
Regards,
Sergio
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#4
Posted 14 July 2008 - 12:56 PM
locate -i -r '^/home/' | xargs -i clamdscan --no-summary '{}'
It will take 15 - 30 minutes. You should test it by replacing /home to one of your client folder to see its result.
Thank you Pairote.
This is a really nice command, it even could be set in a cron on the server. Why is not this a regular practice in all servers? or is only me?
Regards,
Sergio
Working on your locate -i -r '^/home/' | xargs -i clamdscan --no-summary '{}'
I have tweaked it a little bit and found that:
find /home/*/public_html -name *.php | xargs -i clamdscan --no-summary '{}'
runs a lot lot faster as it will only check on php files and not images files. A few seconds compared to a few minutes in the same account.
Regards,
Sergio
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#5
Posted 14 July 2008 - 01:32 PM
PS: find has -exec which can execute clamdscan without to pipe (|). I believe that it consumes resouce lower than using pipe.
#6
Posted 22 July 2008 - 12:21 AM
PS: find has -exec which can execute clamdscan without to pipe (|). I believe that it consumes resouce lower than using pipe.
Hi Pairote,
looking around for xargs and exec, I found the following article:
http://www.unixreview.com/documents/s=8274...0306g/0306g.htm
I have read a lot of different places and all of them recommends xarg over exec in find, I have used the XARG and it is really fast. I have checked my home directory with thousands of index.php files and it is done in less than 10 minutes in a double quad server, I like it.
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#7
Posted 22 July 2008 - 10:24 AM
If you runtime is not too long, I would suggest you remove public_html and also scan .html, .htm.
find /home/* -name *.php | xargs -i clamdscan --no-summary '{}'
find /home/* -name *.htm | xargs -i clamdscan --no-summary '{}'
#8
Posted 22 July 2008 - 11:33 AM
If you runtime is not too long, I would suggest you remove public_html and also scan .html, .htm.
find /home/* -name *.php | xargs -i clamdscan --no-summary '{}'
find /home/* -name *.htm | xargs -i clamdscan --no-summary '{}'
just elaborating a little bit more...
find /home/* -name *.php -o -name *.htm | xargs -i clamdscan --no-summary '{}'
This gives us a one line command checking for php or htm files, what do you think?
Now... How may I can set this in a cron?
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#9
Posted 22 July 2008 - 12:27 PM
BEGIN {
push( @INC, '/scripts' );
}
use strict;
use cPScript::OSSys ();
cPScript::OSSys::nice(19);
my ($runTime, $startTime);
$startTime = time();
system("find /home/* -name *.php -o -name *.htm | xargs -i clamdscan --no-summary '{}' | grep FOUND");
$runTime = (time() - $startTime) / 60;
print "Total runtime: $runTime minutes. \n\n";
#10
Posted 25 July 2008 - 01:42 AM
After playing with the find command I did a test with a trojan code that could be injected in a web page, like the one listed here:
http://www.webtalkforums.com/showthread.php?p=204106
but CLAMAV didn't find it
I wanted to create a cron like the one that you kindly wrote, but it seems that it will not work for what I am intending to do, that is to check in the server for this type of malicious code.
Any idea of what other AV could be used instead of CLAMAV?
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#11
Posted 25 July 2008 - 10:19 AM
#12
Posted 26 July 2008 - 02:32 PM
The weird thing is that I have copied all the code into a TXT file in my computer and my AntiVirus deleted the file because it says it is indeed a trojan horse virus.
Any way, I am using now the following find command:
Regards,
Sergio
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
#14
Posted 26 April 2010 - 08:04 PM
That was part of virus in the form of 64 eval code. With that search you can check if any of your pages is infected with that script.
Regards,
Sergio
www.prueba.biz/motorcycle
www.a-la-venta.com/volvo
Help












