Skip to content

Commit

Permalink
v1.7 - Improved securityCore, logging, Apps, A/V.
Browse files Browse the repository at this point in the history
-v1.7.
-Removed the option for "High-Performance A/V Scanning".
-Improved Clam-AV calls.
-Improved securityCore.php logging.
-PHP-AV App to v2.4. Reduce "out-of memory" errors & code readability.
-Pell App to v2.2 . Working on loading files.
-Contacts App to v2.3. Fixed bug with loading contacts.
  • Loading branch information
zelon88 authored Jul 31, 2017
1 parent cc9c7d5 commit fd39f46
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions compatibilityCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/*
HRCLOUD2 VERSION INFORMATION
THIS VERSION : v1.6.6
WRITTEN ON : 7/25/2017
THIS VERSION : v1.7
WRITTEN ON : 7/30/2017
*/

// / -----------------------------------------------------------------------------------
Expand Down
36 changes: 26 additions & 10 deletions securityCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@
// / using alternate methods (ignoring it's settings configuration). With Persistence enabled
// / HRCloud2 will spare no expense to complete a sucessful scan on it's target.
if ($HighPerformanceAV == 1) {
$HighPerf = '-m '; }
$HighPerf = '-m'; }
if (!isset($HighPerformanceAV) or $HighPerformanceAV == '0') {
$HighPerf = ''; }
if ($ThoroughAVAV == 1) {
if ($ThoroughAV == 1) {
$Thorough = ''; }
if (!isset($ThoroughAV) or $ThouroughAV == '0') {
$Thorough = '-fdpass'; }
$Thorough = '-fdpass '; }
if ($PersistentAV !== '1') {
$PersistenceEcho = 'Stopping.'; }
if ($PersistentAV == '1') {
$PersistenceEcho = 'Continuing...';
$ThoroughRAW = $Thorough;
if ($ThoroughRAW == '') {
$Thorough = '-fdpass'; }
if ($ThoroughRAW !== '-fdpass') {
$Thorough = '-fdpass '; }
if ($ThoroughRAW !== '-fdpass ') {
$Thorough = ''; } }

// / Handle pre-existing VirusLog files (increment the filename until one is found that doesn't exist).
Expand All @@ -142,9 +142,13 @@
$userscanfilename = $_POST['userscanfilename'];
// / Update anti-virus definitions from ClamAV.
@shell_exec('sudo freshclam');
$txt = ('OP-Act: Executing \'sudo freshclam\' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
echo nl2br('<a style="padding-left:15px;">Updated Virus Definitions.</a>'."\n");
?><hr /><?php
// / Perform a ClamScan on the supplied user file and cache the results.
$txt = ('OP-Act: Executing \'clamscan -r '.$CloudLoc.'/'.$userscanfilename.' | grep FOUND >> '.'Virus Detected!!! '.$LogFile1.'\' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.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);
Expand All @@ -155,15 +159,21 @@
// / The following code is used to scan the entire Cloud drive.
if (isset($_POST['Scan'])) {
// / Update anti-virus definitions from ClamAV.
$txt = ('OP-Act: Executing \'sudo freshclam\' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
shell_exec('sudo freshclam');
echo nl2br('<a style="padding-left:15px;">Updated Virus Definitions.</a>'."\n");
?><hr /><?php
// / Perform a ClamScan on the HRCloud2 Cloud Location Directory and cache the results.
$LogFileSize3 = 0;
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$HighPerf.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1)));
$txt = ('OP-Act: Executing \'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$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)) {
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$HighPerf.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1))); }
$txt = ('OP-Act: Executing \'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$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))); }
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);
Expand All @@ -184,17 +194,23 @@
?><hr /><?php
// / Perform a ClamScan on the HRCloud2 Installation Directory and cache the results.
$LogFileSize3 = 0;
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$HighPerf.' '.$InstLoc.' | grep FOUND >> '.$LogFile2)));
$txt = ('OP-Act: Executing \'clamscan -r '.$Thorough.' '.$InstLoc.' | grep FOUND >> '.$LogFile2.'\' on '.$Time.'.');
$MAKELogFile = file_put_contents($LogFile, $txt.PHP_EOL, FILE_APPEND);
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$InstLoc.' | grep FOUND >> '.$LogFile2)));
sleep(1);
if (!file_exists($LogFile1)) {
shell_exec(str_replace(' ', ' ', str_replace(' ', ' ', 'clamscan -r '.$Thorough.' '.$HighPerf.' '.$CloudLoc.' | grep FOUND >> '.$LogFile1))); }
$txt = ('OP-Act: Executing \'clamscan -r '.$Thorough.' '.$CloudLoc.' | grep FOUND >> '.$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))); }
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;
$WriteClamLogFile = file_put_contents($LogFile2, 'Virus Detected!!!'.PHP_EOL, FILE_APPEND); }
$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);
Expand Down
6 changes: 4 additions & 2 deletions settingsCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,16 @@
<option value="1">Enabled</option>
<option value="0">Disabled</option>
</select></p>

<?php
/*
<p alt="Options to enable high performance (Multithreaded) A/V scanning." title="Options to enable high performance (Multithreaded) A/V scanning." style="padding-left:15px;"><strong>6.</strong> High Performance A/V Scanning (Multi-threading): </p>
<p><select id="NEWHighPerformanceAV" name="NEWHighPerformanceAV" style="width:100%;">
<option value="<?php echo $HighPerformanceAV; ?>">Current (<?php echo $HPAVEcho; ?>)</option>
<option value="1">Enabled</option>
<option value="0">Disabled</option>
</select></p>

*/
?>
<p alt="Options to enable thorough A/V scanning (May require advanced ClamAV permission configuration)." title="Options to enable thorough A/V scanning (May require advanced ClamAV permission configuration)." style="padding-left:15px;"><strong>7.</strong> Thorough A/V Scanning: </p>
<p><select id="NEWThoroughAV" name="NEWThoroughAV" style="width:100%;">
<option value="<?php echo $ThoroughAV; ?>">Current (<?php echo $TAVEcho; ?>)</option>
Expand Down
2 changes: 1 addition & 1 deletion versionInfo.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
// / This file contains the current HRCloud2 version for auto-update purposes.
// /
$Version = 'v1.6.6';
$Version = 'v1.7';

0 comments on commit fd39f46

Please sign in to comment.