Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds functionality to enable alerts to control panel user contact emails. Includes the following functions:
Changes
Testing
CentOS 6, no control panel
CentOS 7, no control panel
Ubuntu 20.04, no control panel
CentOS 7, cPanel 108
[root@cpanel linux-malware-detect]# maldet -a /home/ Linux Malware Detect v1.6.5 (C) 2002-2019, R-fx Networks (C) 2019, Ryan MacDonald This program may be freely redistributed under the terms of the GNU GPL v2maldet(67993): {scan} signatures loaded: 17370 (14533 MD5 | 2054 HEX | 783 YARA | 0 USER)
maldet(67993): {scan} building file list for /home/, this might take awhile...
maldet(67993): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6
maldet(67993): {scan} file list completed in 0s, found 1801 files...
maldet(67993): {scan} found clamav binary at /usr/local/cpanel/3rdparty/bin/clamscan, using clamav scanner engine...
maldet(67993): {scan} scan of /home/ (1801 files) in progress...
maldet(67993): {scan} processing scan results for hits: 936 hits 0 cleaned
maldet(67993): {scan} scan completed on /home/: files 1801, malware hits 936, cleaned hits 0, time 112s
maldet(67993): {scan} scan report saved, to view run: maldet --report 230317-1119.67993
maldet(67993): {scan} quarantine is disabled! set quarantine_hits=1 in conf.maldet or to quarantine results run: maldet -q 230317-1119.67993
maldet(67993): {alert} sent scan report to [email protected]
maldet(67993): {alert} Panel alerts
maldet(67993): {panel} Detecting control panel and sending alerts...
maldet(67993): {panel} Detected control panel cpanel. Will send alerts to control panel account contacts.
CentOS 7, Interworx
[root@lmd-iworx7 linux-malware-detect]# maldet -a /home/ Linux Malware Detect v1.6.5 (C) 2002-2019, R-fx Networks (C) 2019, Ryan MacDonald This program may be freely redistributed under the terms of the GNU GPL v2maldet(21699): {scan} signatures loaded: 17370 (14533 MD5 | 2054 HEX | 783 YARA | 0 USER)
maldet(21699): {scan} building file list for /home/, this might take awhile...
maldet(21699): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6
maldet(21699): {scan} file list completed in 0s, found 2003 files...
maldet(21699): {scan} found clamav binary at /usr/bin/clamdscan, using clamav scanner engine...
maldet(21699): {scan} scan of /home/ (2003 files) in progress...
maldet(21699): {scan} processing scan results for hits: 1037 hits 0 cleaned
maldet(21699): {scan} scan completed on /home/: files 2003, malware hits 1037, cleaned hits 0, time 119s
maldet(21699): {scan} scan report saved, to view run: maldet --report 230317-1519.21699
maldet(21699): {scan} quarantine is disabled! set quarantine_hits=1 in conf.maldet or to quarantine results run: maldet -q 230317-1519.21699
maldet(21699): {alert} sent scan report to [email protected]
maldet(21699): {alert} Panel alerts
maldet(21699): {panel} Detecting control panel and sending alerts...
maldet(21699): {panel} Detected control panel interworx. Will send alerts to control panel account contacts.
Test to verify that disabling email_alert disables control panel user alerts as well
[root@lmd-iworx7 linux-malware-detect]# grep ^email_alert /usr/local/maldetect/conf.maldet
email_alert="0"
[root@lmd-iworx7 linux-malware-detect]# maldet -a /home/
Linux Malware Detect v1.6.5
(C) 2002-2019, R-fx Networks [email protected]
(C) 2019, Ryan MacDonald [email protected]
This program may be freely redistributed under the terms of the GNU GPL v2
maldet(27655): {scan} signatures loaded: 17370 (14533 MD5 | 2054 HEX | 783 YARA | 0 USER)
maldet(27655): {scan} building file list for /home/, this might take awhile...
maldet(27655): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6
maldet(27655): {scan} file list completed in 0s, found 2003 files...
maldet(27655): {scan} found clamav binary at /usr/bin/clamdscan, using clamav scanner engine...
maldet(27655): {scan} scan of /home/ (2003 files) in progress...
maldet(27655): {scan} processing scan results for hits: 1037 hits 0 cleaned
maldet(27655): {scan} scan completed on /home/: files 2003, malware hits 1037, cleaned hits 0, time 115s
maldet(27655): {scan} scan report saved, to view run: maldet --report 230317-2014.27655
maldet(27655): {scan} quarantine is disabled! set quarantine_hits=1 in conf.maldet or to quarantine results run: maldet -q 230317-2014.27655
Misc
Malware samples for testing obtained from the following repos:
https://github.com/JohnTroony/php-webshells
https://github.com/tennc/webshell