Linux – How to scan for Windows viruses on Linux servers

anti-viruscentoslinuxmalwarewindows

I have a CentOS server storing files for windows users.

How do I scan for windows viruses in these files, and meanwhile prevent quarantine and other measures?

I do not want the files altered in any way, and would prefer if it can be done purely in command line with parsable results.

The antivirus we have a license for is Kaspersky Endpoint Security.
That is the preferred antivirus, but the question applies to Linux Anti-viruses in general.

Best Answer

Untested, but if you are happy using ClamAV the following should work:

Install the ClamAV (enabling EPEL repo first):

yum install -y epel-release
yum install clamav

Via: https://www.clamav.net/documents/installing-clamav#rhel

Then you can update ClamAV:

/usr/bin/freshclam

Then scan:

/usr/bin/clamscan -r --infected /

--infected (-i): Only print infected files. --recursive (-r): Scan directories recursively. All the subdirectories in the given directory will be scanned.

It's worth noting that by default clamscan does not remove files, you would have to manually set the switch: --remove[=yes/no(*)]

Via: https://linux.die.net/man/1/clamscan

Regarding scanning for windows signatures in linux I will refer you to this accepted answer on AskUbuntu: Does ClamAV Scan Windows virus?

In practice however, you will mainly use a virusscanner to protect your Windows partners. ClamAV does scan for Windows viruses as well.

Related Topic