Scan Complete!
Updated Virus Definitions.'."\n");
?>
> '.'Virus Detected!!! '.$LogFile1.'\' on '.$Time.'.'.PHP_EOL, FILE_APPEND);
shell_exec('clamscan -r '.$CloudLoc.'/'.$userscanfilename.' | grep FOUND >> '.'Virus Detected!!! '.$LogFile1);
$LogTXT = file_get_contents($LogFile1);
$WriteClamLogFile = file_put_contents($LogFile, $LogTXT.PHP_EOL, FILE_APPEND);
$WriteClamLogFile = file_put_contents($LogFile0, $LogTXT.PHP_EOL, FILE_APPEND);
echo nl2br('Scanned Supplied File.'."\n");
?>
Updated Virus Definitions.'."\n");
?>
> '.$LogFile1.'\' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1)));
sleep(1);
if (!file_exists($LogFile1)) {
$MAKELogFile = file_put_contents($LogFile, 'OP-Act: Executing \'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1.'\' on '.$Time.'.'.PHP_EOL, FILE_APPEND);
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1))); }
if (!file_exists($LogFile1)) {
$txt = ('ERROR!!! HRC2SecCore136, Could not generate scan results on '.$Time.'! Continuing...');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
echo nl2br(''.$txt.''."\n"); }
if (file_exists($LogFile1)) {
$LogFileSize2 = @filesize($LogFile1);
$LogFileDATA1 = file($LogFile1);
foreach ($LogFileDATA1 as $LogDATA1) {
if (strpos($LogDATA1, 'FOUND') == 'true' or $LogFileSize2 >= 3) {
$INFECTION_DETECTED = 1;
$WriteClamLogFile = file_put_contents($LogFile1, 'Virus Detected!!!'.PHP_EOL, FILE_APPEND); }
if (strpos($LogDATA1, 'FOUND') == 'false') $WriteClamLogFile = file_put_contents($LogFile1, ''.PHP_EOL, FILE_APPEND); }
$LogTXT = @file_get_contents($LogFile1);
$WriteClamLogFile = file_put_contents($LogFile, $LogTXT.PHP_EOL, FILE_APPEND);
$WriteClamLogFile = file_put_contents($LogFile0, $LogTXT.PHP_EOL, FILE_APPEND);
echo nl2br('Scanned Cloud Directory.'."\n"); }
?>
> '.$LogFile2.'\' on '.$Time.'.'.PHP_EOL, FILE_APPEND);
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$InstLoc.' | grep FOUND >> '.$LogFile2)));
sleep(1);
if (!file_exists($LogFile1)) {
$MAKELogFile = file_put_contents($LogFile, 'OP-Act: Executing \'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1.'\' on '.$Time.'.'.PHP_EOL, FILE_APPEND);
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1))); }
if (file_exists($LogFile2)) {
$LogFileSize4 = @filesize($LogFile2);
$LogFileDATA2 = file($LogFile2);
foreach ($LogFileDATA2 as $LogDATA2) {
if (strpos($LogDATA2, 'FOUND') == 'true' or $LogFileSize4 >= 3) {
$INFECTION_DETECTED = 1;
$txt = 'Virus Detected!!!';
$WriteClamLogFile = file_put_contents($LogFile2, $txt.PHP_EOL, FILE_APPEND);
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
if (strpos($LogDATA2, 'FOUND') == 'false') $WriteClamLogFile = file_put_contents($LogFile1, ''.PHP_EOL, FILE_APPEND); }
$LogTXT = @file_get_contents($LogFile2);
$WriteClamLogFile = file_put_contents($LogFile, $LogTXT.PHP_EOL, FILE_APPEND);
$WriteClamLogFile = file_put_contents($LogFile0, $LogTXT.PHP_EOL, FILE_APPEND);
echo nl2br('Scanned HRCloud2 Installation Directory.'."\n"); } }
// / -----
// / Gather results from scans.
if (!is_file($LogFile0) or !is_file($LogFile1) or !is_file($LogFile2)) {
$txt = ('ERROR!!! HRC2SecCore185, There was a problem generating scan results on '.$Time.'!
Try adding user exceptions for ClamAV to the CloudLoc and InstLoc, or disable "ThoroughScanning" in the Settings page.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
die(''.$txt.''); }
// / -----
// / Gather data from ClamAV generated log files.
$LogFileDATA0 = file_get_contents($LogFile0);
$LogFileDATA00 = file($LogFile0);
$LogFileDATA1 = file_get_contents($LogFile1);
$LogFileDATA11 = file($LogFile1);
$LogFileDATA2 = file_get_contents($LogFile2);
$LogFileDATA22 = file($LogFile2);
// / -----
// / Re-define permissions for files generated by ClamAV, just-in-case.
@system("/bin/chown -R $user $LogFile0");
@system("/bin/chown -R $user $LogFile1");
@system("/bin/chown -R $user $LogFile2");
@system("/bin/chgrp -R $user $LogFile0");
@system("/bin/chgrp -R $user $LogFile1");
@system("/bin/chgrp -R $user $LogFile2");
@system("/bin/chmod -R 0750 $LogFile0");
@system("/bin/chmod -R 0750 $LogFile1");
@system("/bin/chmod -R 0750 $LogFile2");
// / -----
// / Infection handler will throw the $INFECTION_DETECTED variable to '1' if potential infections were found.
if (strpos($LogFileDATA0, 'Virus Detected') == 'true' or strpos($LogFileDATA1, 'Virus Detected') == 'true' or strpos($LogFileDATA2, 'Virus Detected') == 'true'
or strpos($LogFileDATA0, 'FOUND') == 'true' or strpos($LogFileDATA1, 'FOUND') == 'true' or strpos($LogFileDATA3, 'FOUND') == 'true') $INFECTION_DETECTED = 1;
foreach ($LogFileDATA00 as $LogDATA00) if (strpos($LogDATA00, 'Virus Detected') == 'true' or strpos($LogDATA00, 'FOUND') == 'true') $INFECTION_DETECTED = 1;
foreach ($LogFileDATA11 as $LogDATA11) if (strpos($LogDATA11, 'Virus Detected') == 'true' or strpos($LogDATA11, 'FOUND') == 'true') $INFECTION_DETECTED = 1;
foreach ($LogFileDATA22 as $LogDATA22) if (strpos($LogDATA22, 'Virus Detected') == 'true' or strpos($LogDATA22, 'FOUND') == 'true') $INFECTION_DETECTED = 1;
// / -----
// / If infections were dected, return scan results to the user.
if ($INFECTION_DETECTED == 1) {
$ThreatCount = substr_count($LogFileDATA0, 'FOUND');
if (!is_int($ThreatCount)) $ThreatCount = 0;
if ($LogFileInc0 == 0) $incEcho = '';
if ($LogFileInc0 !== 0 && $LogFileInc0 !== '') $incEcho = $LogFileInc0.'_';
$ClamURL = 'DATA/'.$UserID.'/.AppData/'.$Date.'/VirusLog_'.$incEcho.$Date.'.txt';
?>