linux-malware-detect icon indicating copy to clipboard operation
linux-malware-detect copied to clipboard

[HardenedBSD] maldet doesn't want to start after added to cron

Open bryn1u opened this issue 6 years ago • 3 comments

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 ?

bryn1u avatar Mar 07 '18 07:03 bryn1u

The monitor mode feature depends on Linux inotify which is not available on BSD.

What version of FreeBSD are you using?

rfxn avatar May 14 '18 16:05 rfxn

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.

bryn1u avatar Jun 02 '18 14:06 bryn1u

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,

gmrfrost avatar Sep 24 '18 18:09 gmrfrost