Support Forums
Virus Scanning help [php] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36)
+---- Forum: Web Server Support and Setup Help (https://www.supportforums.net/forumdisplay.php?fid=37)
+---- Thread: Virus Scanning help [php] (/showthread.php?tid=4899)



Virus Scanning help [php] - p0w3r0fchr1st - 02-19-2010

I am trying to make a file scanner to check if it has viruses with php. I made the upload form already. Can someone help me with the code? I heard you can do it with clamscan. I tried:

exec("clamscan /var/www/upload", $file, $return)

if ($return == 0)
{
echo "clean"
}

else
{
echo "virus!"
}

But it always comes out as infected, even if it is not. Help please? show me the right path or somethnig. Or just the right code.

thanksBlackhat


RE: Virus Scanning help [php] - ELY_M - 02-20-2010

$return is whole reply from clamscan.
you would have to parse the reply from clamscan.


RE: Virus Scanning help [php] - p0w3r0fchr1st - 02-20-2010

I don't understand, could you put more details please?