Hi everyone,
I have trouble with getting PMG to detect viruses inside RAR archives.
I am using the free EICAR mail tests from Heise Security (https://www.heise.de/security/dienste/emailcheck/virendummies/rar_mit_eicar/) to test the functionality.
When sending the plain EICAR file (without it being embedded in a RAR file), PMG correctly blocks the mail. So my rule is working fine.
The mail fiter rule looks like this:
- Name: Block Virus
- Direction: in
- What objects: Virus (Type: "Virus Filter", Value: "active")
- Action Objects: Notify Admin, Quarantine
However, this rule does not fire when sending the EICAR file inside a RAR archive.
From another thread here (click) I already saw that the package "p7zip-rar" should be installed, which I did; unfortunately, the result is still the same.
If I upload the RAR attachment to the PMG VM, I can manually extract the RAR file using
unrar e eicar.rar
and then scan the eicar.com file using
clamscan eicar.com
The EICAR file is then correctly recognized by ClamAV:
eicar.com: Win.Test.EICAR_HDB-1 FOUND
However, if I run clamscan on the RAR file itself, it does not detect anything.
If I run clamconf, I can see the following output:
Configure: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' '--libexecdir=/usr/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FILE_OFFSET_BITS=64' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FILE_OFFSET_BITS=64' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' '--with-dbdir=/var/lib/clamav' '--sysconfdir=/etc/clamav' '--disable-clamav' '--disable-unrar' '--enable-milter' '--enable-dns-fix' '--with-libjson' '--with-system-libmspack' '--with-libcurl=/usr' '--with-gnu-ld' '--with-systemdsystemunitdir=/lib/systemd/system' 'build_alias=x86_64-linux-gnu' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security'
Notice the --disable-unrar.
I also verified that p7zip can correctly handle RAR archives, by executing 7z e eicar.rar, which can extract the RAR file successfully.
At this point, I am out of ideas.
Can anyone help me?
Thanks and regards
Alexander
I have trouble with getting PMG to detect viruses inside RAR archives.
I am using the free EICAR mail tests from Heise Security (https://www.heise.de/security/dienste/emailcheck/virendummies/rar_mit_eicar/) to test the functionality.
When sending the plain EICAR file (without it being embedded in a RAR file), PMG correctly blocks the mail. So my rule is working fine.
The mail fiter rule looks like this:
- Name: Block Virus
- Direction: in
- What objects: Virus (Type: "Virus Filter", Value: "active")
- Action Objects: Notify Admin, Quarantine
However, this rule does not fire when sending the EICAR file inside a RAR archive.
From another thread here (click) I already saw that the package "p7zip-rar" should be installed, which I did; unfortunately, the result is still the same.
If I upload the RAR attachment to the PMG VM, I can manually extract the RAR file using
unrar e eicar.rar
and then scan the eicar.com file using
clamscan eicar.com
The EICAR file is then correctly recognized by ClamAV:
eicar.com: Win.Test.EICAR_HDB-1 FOUND
However, if I run clamscan on the RAR file itself, it does not detect anything.
If I run clamconf, I can see the following output:
Configure: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' '--libexecdir=/usr/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FILE_OFFSET_BITS=64' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -D_FILE_OFFSET_BITS=64' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' '--with-dbdir=/var/lib/clamav' '--sysconfdir=/etc/clamav' '--disable-clamav' '--disable-unrar' '--enable-milter' '--enable-dns-fix' '--with-libjson' '--with-system-libmspack' '--with-libcurl=/usr' '--with-gnu-ld' '--with-systemdsystemunitdir=/lib/systemd/system' 'build_alias=x86_64-linux-gnu' 'OBJCFLAGS=-g -O2 -fdebug-prefix-map=/build/clamav-AOJLfo/clamav-0.102.3+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security'
Notice the --disable-unrar.
I also verified that p7zip can correctly handle RAR archives, by executing 7z e eicar.rar, which can extract the RAR file successfully.
At this point, I am out of ideas.
Can anyone help me?
Thanks and regards
Alexander