diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-09-10 17:12:44 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-09-10 17:12:44 +0300 |
commit | 903016df362e39444d314a81dd4a0ebc61b67da0 (patch) | |
tree | e922e2e0039428dec461bfea52ff8e503720370a /include/tests_malware | |
parent | 2534fb99a9dbc869fd90f0967c6917191b306b69 (diff) |
Code cleanups and generic enhancements
Diffstat (limited to 'include/tests_malware')
-rw-r--r-- | include/tests_malware | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/include/tests_malware b/include/tests_malware index 19523931..0cc9424f 100644 --- a/include/tests_malware +++ b/include/tests_malware @@ -41,13 +41,13 @@ Register --test-no MALW-3275 --weight L --network NO --category security --description "Check for chkrootkit" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: checking presence chkrootkit" - if [ ! "${CHKROOTKITBINARY}" = "" ]; then + if [ ! -z "${CHKROOTKITBINARY}" ]; then Display --indent 2 --text "- ${GEN_CHECKING} chkrootkit" --result "${STATUS_FOUND}" --color GREEN LogText "Result: Found ${CHKROOTKITBINARY}" MALWARE_SCANNER_INSTALLED=1 AddHP 2 2 Report "malware_scanner[]=chkrootkit" - else + else LogText "Result: chkrootkit not found" fi fi @@ -59,13 +59,13 @@ Register --test-no MALW-3276 --weight L --network NO --category security --description "Check for Rootkit Hunter" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: checking presence Rootkit Hunter" - if [ ! "${RKHUNTERBINARY}" = "" ]; then + if [ ! -z "${RKHUNTERBINARY}" ]; then Display --indent 2 --text "- ${GEN_CHECKING} Rootkit Hunter" --result "${STATUS_FOUND}" --color GREEN LogText "Result: Found ${RKHUNTERBINARY}" MALWARE_SCANNER_INSTALLED=1 AddHP 2 2 Report "malware_scanner[]=rkhunter" - else + else LogText "Result: Rootkit Hunter not found" fi fi @@ -83,7 +83,7 @@ MALWARE_SCANNER_INSTALLED=1 AddHP 2 2 Report "malware_scanner[]=lmd" - else + else LogText "Result: LMD not found" fi fi @@ -113,11 +113,11 @@ LogText "Test: checking process cma or cmdagent (McAfee)" # cma is too generic to match on, so we want to ensure that it is related to McAfee first if [ -x /opt/McAfee/cma/bin/cma ]; then - IsRunning cma - if [ ${RUNNING} -eq 1 ]; then MCAFEE_SCANNER_RUNNING=1; fi - else - IsRunning cmdagent - if [ ${RUNNING} -eq 1 ]; then MCAFEE_SCANNER_RUNNING=1; fi + IsRunning cma + if [ ${RUNNING} -eq 1 ]; then MCAFEE_SCANNER_RUNNING=1; fi + else + IsRunning cmdagent + if [ ${RUNNING} -eq 1 ]; then MCAFEE_SCANNER_RUNNING=1; fi fi if [ ${MCAFEE_SCANNER_RUNNING} -eq 1 ]; then FOUND=1 @@ -167,7 +167,7 @@ MALWARE_SCANNER_INSTALLED=1 CLAMSCAN_INSTALLED=1 AddHP 2 2 - else + else LogText "Result: clamscan couldn't be found" fi fi @@ -185,7 +185,7 @@ LogText "Result: found running clamd process" MALWARE_SCANNER_INSTALLED=1 CLAMD_RUNNING=1 - else + else LogText "Result: clamd not running" fi fi @@ -204,7 +204,7 @@ Display --indent 4 --text "- ${GEN_CHECKING} freshclam" --result "${STATUS_FOUND}" --color GREEN LogText "Result: found running freshclam process" AddHP 2 2 - else + else Display --indent 4 --text "- ${GEN_CHECKING} freshclam" --result "${STATUS_SUGGESTION}" --color YELLOW LogText "Result: freshclam is not running" ReportSuggestion ${TEST_NO} "Confirm that freshclam is properly configured and keeps updating the ClamAV database" @@ -218,14 +218,14 @@ if [ -d /Applications/ClamXav.app/Contents/Resources/ScanningEngine/bin/ ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no MALW-3288 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check for ClamXav" if [ ${SKIPTEST} -eq 0 ]; then - CLAMSCANBINARY=`ls /Applications/ClamXav.app/Contents/Resources/ScanningEngine/bin/ 2> /dev/null | ${GREPBINARY} 'clamscan'` - if [ ! "${CLAMSCANBINARY}" = "" ]; then + CLAMSCANBINARY=$(${LSBINARY} /Applications/ClamXav.app/Contents/Resources/ScanningEngine/bin/ 2> /dev/null | ${GREPBINARY} 'clamscan') + if [ ! -z "${CLAMSCANBINARY}" ]; then LogText "Result: Found ClamXav clamscan installed" Display --indent 2 --text "- ${GEN_CHECKING} ClamXav AV scanner" --result "${STATUS_FOUND}" --color GREEN MALWARE_SCANNER_INSTALLED=1 CLAMSCAN_INSTALLED=1 AddHP 3 3 - else + else LogText "Result: ClamXav malware scanner not found" AddHP 0 3 fi |