linux-malware-detect
linux-malware-detect copied to clipboard
[HardenedBSD] maldet doesn't want to start after added to cron
Hello guys,
I have a weird problem with running maldet on HardenedBSD/FreeBSD. I installed with install.sh and did well. When add to /etc/crontab, maldet doesn't want to start and do nothing.
My entry to /etc/crontab:
*/1 * * * * root /usr/local/sbin/maldet -u -d -a /home/zenek >> /root/maldet.raport
File maldet.raport is created but it's empty. I checked /var/log/cron and:
Mar 7 08:33:00 proton /usr/sbin/cron[32690]: (root) CMD (/usr/local/sbin/maldet -u -d -a /home/zenek >> /root/maldet.raport)
It shows that maldet is started. /usr/local/maldetect/logs/event_log is empty too. I really dont understand. When i do it manually it works great. Where can be a problem ?
Ahh one question more. Is there any way to use monitor option for FreeBSD ?
The monitor mode feature depends on Linux inotify which is not available on BSD.
What version of FreeBSD are you using?
Hey,
Im using FreeBSD 11.2. As i mentioned, when i run manually it works great but from cron it doesn't work :(. I checked many times but it still happens. Thank you for you replay.
Try this to check if there is any output error you are missing:
*/1 * * * * root /usr/local/sbin/maldet -u -d -a /home/zenek >> /root/maldet.raport 2>&1
Also, you can add the maldet command to a bash file and launch the .sh file with a -x optional argument from the crontab line and redirect the output, this way you'll have a debug file to check.
Regards,