-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maldet can't scan files/directories with whitespace. VERSION:1.6.4 #354
Comments
I solved the issue. Now maldet can scan and quarantine files with whitespaces and files with whitespaces inside directories with whitespaces. In the line 1569 of file internal/functions we have to set the filter on this way: $tlog $inotify_log inotify | awk -F"CREATE|MODIFY|MOVED_FROM|MOVED_TO" '{print My thanks to https://github.com/miglinux for helping me to monitor the contents of temporary random files that contained the path and file name. |
@rfxn well, I think that is a grave enough bug to warrant an immediate fix and release? |
@rfxn any updates on a release to fix this ? |
I think he might be busy with some other things. Last commit was April 2019. |
The issue was solved with my code on the version 1.6.5 Line 1569. |
Thanks for this guys. Happy to see work on 1.6.5 :) |
Think we can get an official 1.6.5 release now? |
I think the proposed solution needs a few improvements.
Basically, anything that's written to the inotify_log is then treated as a file.
|
I am using Maldet+Clamav+Inotify with monitor mode in a shared directory on Samba,
when I put a malware with no whitespace on name, Maldet can scan and move the file to quarantine, but when I put a file with whitespace on name the log clamscan_log show:
File: PDFXCview - Copy.exe
ERROR: Can't access file /media/raid5/samba/public/PDFXCview
The same error happens with whitespace on a directory name:
FILE: PDFXCview.exe
ERROR: Can't access file /media/raid5/samba/public/new
I tryied to change the filter rule on line 1569 of file internal/functions from:
$tlog $inotify_log inotify | grep -E "CREATE|MODIFY|MOVED_FROM|MOVED_TO" | grep -E -v '/.. ' | awk '{print$1}' | sort | uniq > $monitor_scanlist
to:
$tlog $inotify_log inotify | awk -F"CREATE|MODIFY|MOVED_FROM|MOVED_TO" '{print$1}' | grep -E -v '/.. ' | sort | uniq | sed -r 's/[ $ ]+/\&/g' | sed 's/.{2}$//' > $monitor_scanlist
clamscan_log:
ERROR: Can't access file /media/raid5/samba/public/PDFXCview\ -\ Copy.exe
AND
ERROR: Can't access file /media/raid5/samba/public/new\ folder/PDFXCview.exe
and to:
$tlog $inotify_log inotify | grep -E "CREATE|MODIFY|MOVED_FROM|MOVED_TO" | grep -E -v '/.. ' | awk -F'(CREATE|MODIFY|MOVED_FROM|MOVED_TO)' '{print $1}' | sort | uniq > $monitor_scanlist
clamscan_log:
ERROR: Can't access file /media/raid5/samba/public/PDFXCview - Copy.exe
AND
ERROR: Can't access file /media/raid5/samba/public/new folder/PDFXCview.exe
When I use the command clamscan -r /media/raid5/samba/public, it found the malwares, even with the whitespaces.
Does anyone know tell me where is the bug?
tnks!
The text was updated successfully, but these errors were encountered: