rfxn / linux-malware-detect

Linux Malware Detection (LMD)
http://www.rfxn.com/projects/linux-malware-detect/
GNU General Public License v2.0
1.2k stars 234 forks source link

Maldet haave problem when path have spaces #428

Open KRUXLEX opened 3 months ago

KRUXLEX commented 3 months ago

Hi, Reproduce of bug I think is simple. Maldet have trouble with space with path... Look:

└─# maldet -a /srv/Case\ \#\ 6044/dane
Linux Malware Detect v1.6.5
            (C) 2002-2023, R-fx Networks <proj@rfxn.com>
            (C) 2023, Ryan MacDonald <ryan@rfxn.com>
This program may be freely redistributed under the terms of the GNU GPL v2

maldet(3144981): {scan} signatures loaded: 17638 (14801 MD5 | 2054 HEX | 783 YARA | 0 USER)
maldet(3144981): {scan} building file list for /srv/Case # 6044/dane, this might take awhile...
maldet(3144981): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6
maldet(3144981): {scan} file list completed in 0s, found 11 files...
maldet(3144981): {scan} found clamav binary at /usr/bin/clamscan, using clamav scanner engine...
maldet(3144981): {scan} scan of /srv/Case # 6044/dane (11 files) in progress...

maldet(3144981): {scan} scan completed on /srv/Case # 6044/dane: files 11, malware hits 0, cleaned hits 0, time 12s
maldet(3144981): {scan} scan report saved, to view run: maldet --report 240821-1431.3144981

But this path have a lot of data... I was change name deleting spaces and we have rightt result :)

└─$ sudo maldet -a /srv/Case\#6044/dane
Linux Malware Detect v1.6.5
            (C) 2002-2023, R-fx Networks <proj@rfxn.com>
            (C) 2023, Ryan MacDonald <ryan@rfxn.com>
This program may be freely redistributed under the terms of the GNU GPL v2

maldet(3148880): {scan} signatures loaded: 17638 (14801 MD5 | 2054 HEX | 783 YARA | 0 USER)
maldet(3148880): {scan} building file list for /srv/Case#6044/dane, this might take awhile...
maldet(3148880): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6
maldet(3148880): {scan} file list completed in 15s, found 726417 files...
maldet(3148880): {scan} found clamav binary at /usr/bin/clamscan, using clamav scanner engine...
maldet(3148880): {scan} scan of /srv/Case#6044/dane (726417 files) in progress...