Skip to content
Permalink
Browse files

v1.7 - PHP-AV App to v4.0. Defs to v4.9. Improve consistency of scan …

…results.

-v1.7. 
-PHP-AV App to v4.0. 
-Defs to v4.9.
-Improve consistency of scan results.
  • Loading branch information...
zelon88 committed Apr 11, 2019
1 parent 2ad5eca commit 615c2b8f31d64cedb5699ef1bbf455b47e69c04d
Showing with 24 additions and 15 deletions.
  1. +9 −0 CHANGELOG.txt
  2. +8 −8 PHP-AV-Lib.php
  3. +6 −6 scanCore.php
  4. +1 −1 versionInfo.php
@@ -1,3 +1,12 @@
COMMIT 4/10/2019
v1.7 - PHP-AV App to v4.0. Defs to v4.9. Improve consistency of scan results.

-v1.7.
-PHP-AV App to v4.0.
-Defs to v4.9.
-Improve consistency of scan results.

--------------------
COMMIT 3/25/2019
v1.6 - PHP-AV App to v3.9. Defs to v4.7. Add SHA1 detection.

@@ -71,7 +71,7 @@ function virus_check($file, $defs, $debug, $defData, $AVLogFile) {
foreach ($defs as $virus) {
$virus = explode("\t", $virus[0]);
if (isset($virus[1]) && $virus[1] !== '' && $virus[1] !== ' ') {
if (strpos($data, $virus[1]) !== FALSE or strpos($file, $virus[1]) !== FALSE) {
if (strpos(strtolower($data), strtolower($virus[1])) !== FALSE or strpos(strtolower($file), strtolower($virus[1])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', Data Match: '.$virus[1].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
@@ -84,23 +84,23 @@ function virus_check($file, $defs, $debug, $defData, $AVLogFile) {
$report .= '<p class="r">'.$txt.'</p>'; }
fclose($handle); }
if (isset($virus[2]) && $virus[2] !== '' && $virus[2] !== ' ') {
if (strpos($data1, $virus[2]) !== FALSE) {
if (strpos(strtolower($data1), strtolower($virus[2])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', MD5 Hash Match: '.$virus[2].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
$report .= '<p class="r">'.$txt.'</p>';
$infected++;
$clean = 0; } }
if (isset($virus[3]) && $virus[3] !== '' && $virus[3] !== ' ') {
if (strpos($data2, $virus[3]) !== FALSE) {
if (strpos(strtolower($data2), strtolower($virus[3])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', SHA256 Hash Match: '.$virus[3].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
$report .= '<p class="r">'.$txt.'</p>';
$infected++;
$clean = 0; } }
if (isset($virus[4]) && $virus[4] !== '' && $virus[4] !== ' ') {
if (strpos($data3, $virus[4])) {
if (strpos(strtolower($data3), strtolower($virus[4])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', SHA1 Hash Match: '.$virus[4].')';
$MAKELogFile = file_put_contents($AVLogFile, $txt.PHP_EOL, FILE_APPEND);
@@ -115,31 +115,31 @@ function virus_check($file, $defs, $debug, $defData, $AVLogFile) {
foreach ($defs as $virus) {
$virus = explode("\t", $virus[0]);
if (isset($virus[1]) && $virus[1] !== '' && $virus[1] !== ' ') {
if (strpos($data, $virus[1]) !== FALSE or strpos($file, $virus[1]) !== FALSE) {
if (strpos(strtolower($data), strtolower($virus[1])) !== FALSE or strpos(strtolower($file), strtolower($virus[1])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', Data Match: '.$virus[1].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
$report .= '<p class="r">'.$txt.'</p>';
$infected++;
$clean = 0; } }
if (isset($virus[2]) && $virus[2] !== '' && $virus[2] !== ' ') {
if (strpos($data1, $virus[2]) !== FALSE) {
if (strpos(strtolower($data1), strtolower($virus[2])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', MD5 Hash Match: '.$virus[2].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
$report .= '<p class="r">'.$txt.'</p>';
$infected++;
$clean = 0; } }
if (isset($virus[3]) && $virus[3] !== '' && $virus[3] !== ' ') {
if (strpos($data2, $virus[3]) !== FALSE) {
if (strpos(strtolower($data2), strtolower($virus[3])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', SHA256 Hash Match: '.$virus[3].')';
$MAKELogFile = file_put_contents($AVLogFile, 'OP-Act: '.$txt.PHP_EOL, FILE_APPEND);
$report .= '<p class="r">'.$txt.'</p>';
$infected++;
$clean = 0; } }
if (isset($virus[4]) && $virus[4] !== '' && $virus[4] !== ' ') {
if (strpos($data3, $virus[4])) {
if (strpos(strtolower($data3), strtolower($virus[4])) !== FALSE) {
// File matches virus defs.
$txt = 'Infected: '.$file.' ('.$virus[0].', SHA1 Hash Match: '.$virus[4].')';
$MAKELogFile = file_put_contents($AVLogFile, $txt.PHP_EOL, FILE_APPEND);
@@ -50,8 +50,8 @@
// / -----------------------------------------------------------------------------------
// / The following code sets the global variables for the session.
$HRScanVersion = 'v1.6';
$versions = 'PHP-AV App v3.9 | Virus Definition v4.8, 3/25/2019';
$HRScanVersion = 'v1.7';
$versions = 'PHP-AV App v4.0 | Virus Definition v4.9, 4/10/2019';
$Date = date("m_d_y");
$Time = date("F j, Y, g:i a");
$JanitorDeleteIndex = FALSE;
@@ -136,7 +136,7 @@ function cleanFiles($path) {
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code creates required data directories if they do not exist.
// / The following code creates required data directoreis if they do not exist.
if (!is_dir($ScanLoc)) {
$txt = ('ERROR!!! HRScan278, The specified ScanLoc does not exist at '.$ScanLoc.' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND); }
@@ -223,7 +223,7 @@ function cleanFiles($path) {
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code is performed when a user selects to scan the files they've uploaded with ClamAV.
// / The following code is performed when a user selects to Clamscan the files they've uploaded with ClamAV.
if (isset($_POST["clamScanButton"])) {
$_POST['clamScanButton'] = str_replace('//', '/', str_replace('///', '/', str_replace(str_split('[]{};:$!#^&%@>*<'), '', $_POST['clamScanButton'])));
$txt = ('OP-Act: Initiated ClamScanner on '.$Time.'.');
@@ -286,7 +286,7 @@ function cleanFiles($path) {
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code consolidates the logfiles from ClamAV and PHP-AV when the ScanAll button is selected.
// / The following code consolididates the logfiles from ClamAV and PHP-AV when the ScanAll button is selected.
if ($ConsolidateLogs === 1) {
$spacer = '----------';
$txt1 = 'OP-Act: User selected to scan all files on '.$Time.'.';
@@ -313,4 +313,4 @@ function cleanFiles($path) {
if (isset($_GET['showFiles']) or isset($_POST['showFiles'])) require_once('scanGui2.php');
if (!isset($_GET['showFiles'])) require_once('scanGui1.php');
// / -----------------------------------------------------------------------------------
?>
?>
@@ -1,4 +1,4 @@
<?php
// / This file contains the current HRScan2 version for auto-update purposes.
$Version = 'v1.6';
$Version = 'v1.7';

0 comments on commit 615c2b8

Please sign in to comment.
You can’t perform that action at this time.