[Linux-Biella] PhpAntiVirus open source
abewayer
l.delvecchio a bilug.linux.it
Mar 24 Gen 2012 16:42:14 CET
Ciao.
Ho trovato un programmino open source che effettua lo scann dei file
archiviati sul server.
Molto funzionale.
C'e' solo un problema.
I file su cui esercita lo scann sono solo file php html txt pił altri
relativi agli script cgi.
Ho provato a modificarlo per effettuare lo scann su altre tipologie di
file ma mi da un errore relativo all'uso della memoria.
Ecco l'errore:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 280 bytes)
in /home/mhd-01/www.abelascimmia.org/htdocs/filesystem/av/index.php on
line 94
Ecco le linee di codice interessate (una funzione in particolare):
function virus_check($file, $defs, $debug) {
global $filecount, $infected, $report, $CONFIG;
// find scannable files
$scannable = 0;
foreach ($CONFIG['extensions'] as $ext) {
if (substr($file,-3)==$ext)
$scannable = 1;
}
// compare against defs
if ($scannable) {
// affectable formats
$filecount++;
$data = file($file); <== Questa e' la linea 94
$data = implode('\r\n', $data);
$clean = 1;
foreach ($defs as $virus) {
if (strpos($data, $virus[1])) {
// file matches virus defs
$report .= '<p class="r">Infected: ' .
$file . ' (' . $virus[0] . ')</p>'; $infected++;
$clean = 0;
}
}
if (($debug)&&($clean))
$report .= '<p class="g">Clean: ' . $file .
'</p>'; }
}
L'unica alternativa alla memoria sono le periferiche di input output.
Abe the n00b cutting/pasting ape
Abe is the #484397 linux registered user
Mio blog: http://www.abelascimmia.org
Maggiori informazioni sulla lista
Linux