[clamav-users] YARA rule - Fileszie

Nibin V M nibinvm at gmail.com
Fri May 17 17:10:19 UTC 2019


Hello All,

I am not sure whether its  a basic question...but I am struggling with this
issue for a few days. I have created a rule with the following condition.

=======
    condition:
    is_php and filesize < 1024 and $str1 and ($str2 or $str3 or $str4)
========

Ideally, I want to scan the files only under 1KB. But it is triggering for
files which is bigger than 1KB. For example.

========
[root at server1 ~]# stat -c '%n %s' /home/gal2.php
/home/gal2.php 3693
[root at server1 ~]# clamscan -d me.yara /home/gal2.php
/home/gal2.php: YARA.My_Test_Rule.UNOFFICIAL FOUND
===========

So as you can see the file is 3K+ in size but still triggering the rule. If
I reduce the filesize to 600 it will work fine. What can be the cause? But
when I try using direct YARA command this issue is not happening.

Any help will be appreciated...thanks in advance.

-- 
Regards....

Nibin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20190517/b99c74f5/attachment.htm>


More information about the clamav-users mailing list