0

Trying to make ClamAV ignore several files. These are almost cryptocoin miners which I do use. Cryptocoin miners get flagged by most antivirus programs for they can be distributed as malware (using other people’s computers for the attacker’s profit). At the same time, they can be used for a tiny profit by the computer’s user himself, knowing what he is doing. ClamAV also reports the miners as malware and I’d like to teach it to ignore the files I actually use, knowing what I am doing.

I also want to ignore the files on a per-file basis. Ignoring a whole malware type can be dangerous.

Well, still no success here.

Read this manual page: http://pig.made-it.com/clamav.html.

Then this manual page: https://www.clamav.net/documents/allow-list-databases.

Then this: https://www.clamav.net/documents/file-hash-signatures.

In all these documents, they state that all I have to do is:

  • Create a file in the ClamAV database folder (on Ubuntu, it’s /var/lib/clamav) with the .fp extension,
  • place the file signatures therein, following the format MD5:SIZE:COMMENT, one per line,
    • MD5 being the MD5 sum of the file,
    • SIZE being the file size, and
    • COMMENT being anything, defaulting to the file name.

However, this blog entry states that the format has to be MD5:SIZE:ID_NAME, where:

  • ID is a 6-digit identifier (can be the current date in the YYMMDD format) and
  • NAME is the file name without the extension.

Tried to follow even the second, restricted ruleset but to no avail. Clamscan still marks the file as a virus.

I have got this file:

clamav@precision-7510:~$ ls -l /var/lib/clamav/*.fp
-rw-rw-r-- 1 clamav clamav  81 dub 12 22:54 /var/lib/clamav/sigfile.fp

with this content:

2461e99e1135fe07ced7fc035db93797:2089980:210412_xmr-stak-linux-2.10.5-cpu.tar

Then I run clamscan:

clamav@precision-7510:~$ clamscan /home/pavel/Installace/Těžba\ a kryptoměny/Horníci/xmr-stak-linux-2.10.5-cpu.tar.xz 
/home/pavel/Installace/Těžba a kryptoměny/Horníci/xmr-stak-linux-2.10.5-cpu.tar.xz: Multios.Coinminer.Miner-6781728-2 FOUND

----------- SCAN SUMMARY -----------
Known viruses: 8653609
Engine version: 0.102.4
Scanned directories: 0
Scanned files: 1
Infected files: 1
Data scanned: 7.19 MB
Data read: 1.99 MB (ratio 3.61:1)
Time: 17.547 sec (0 m 17 s)

So I still get a detection. What am I doing wrong?

5
  • I think you would be better off asking in a ClamAV related forum. Unless you are hosting Windows files for Windows systems (like file-shares or mail) there don't seems to be much gained in running antivirus on a Linux machine.
    – Soren A
    Apr 13, 2021 at 8:33
  • I agree.99.999999999999999% (I made that up :+)) of the time an antivirus uses windows definitions to scan linux files. Never ever going to work and as such it is a waste of cpu cycles. If you want to make money that seems counterproductive to me. Make sure you use trusted sources for your software. That is the main thing to do to prevent malware. Next up is a good admin password. If you are going to whitelist software there is no point in using an antivirus program like clamav.
    – Rinzwind
    Apr 13, 2021 at 8:49
  • A better method is to check your ROUTER log on outgoing traffic every so often.
    – Rinzwind
    Apr 13, 2021 at 8:52
  • So I’d be better off uninstalling clamav? Maybe there’s a point because I use ownCloud synchronization and the Windows files get checked time to time on my Windows 10 system with ESET when I boot to it. As for the Linux malware, there seemed to be some clamav detections in my browsers’ cache (Firefox, Brave) so I am going to think twice before nuking clamav altogether…
    – Cigydd
    Apr 13, 2021 at 10:35
  • To clarify things, I don’t use clamav on my ownCloud server. It’s a Raspberry Pi that didn’t make it when I tried. The system resources weren’t sufficient. I run clamav on my two laptops as a clamscan cronjob. I don’t use clamd so the waste of resources isn’t so big.
    – Cigydd
    Apr 13, 2021 at 14:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.