avast / yaramod

Parsing of YARA rules into AST and building new rulesets in C++.
MIT License
120 stars 44 forks source link

AttributeError: module 'yaramod' has no attribute 'Features' #259

Open benjamin44 opened 8 months ago

benjamin44 commented 8 months ago

Hello, I have an issue with yaramod module in Python

When I use : import yaramod yara_obj = yaramod.Yaramod(yaramod.Features.AllCurrent)

I have this error :

Traceback (most recent call last): File "", line 1, in AttributeError: module 'yaramod' has no attribute 'Features'

My config:

$ uname -a Linux debian 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

Python Version: Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux

$ sudo pip3 freeze

Brlapi==0.8.4 certifi==2022.9.24 cffi==1.16.0 chardet==5.1.0 charset-normalizer==3.0.1 colorclass==2.2.2 cryptography==42.0.5 cupshelpers==1.0 dbus-python==1.3.2 defusedxml==0.7.1 easygui==0.98.3 feedparser==6.0.10 httplib2==0.20.4 idna==3.3 Jinja2==3.1.3 lark-parser==0.12.0 louis==3.24.0 MarkupSafe==2.1.5 msoffcrypto-tool==5.3.1 musicbrainzngs==0.7.1 mutagen==1.46.0 olefile==0.47 oletools==0.60.1 pcodedmp==1.2.6 psutil==5.9.8 pycairo==1.20.1 pycparser==2.21 pycups==2.0.1 pycurl==7.45.2 PyGObject==3.42.2 pyinotify==0.9.6 pyparsing==2.4.7 PyQt5==5.15.9 PyQt5-sip==12.11.1 PySimpleSOAP==1.16.2 pysmbc==1.0.23 python-apt==2.6.0 python-debian==0.1.49 python-debianbts==4.0.1 python-magic==0.4.27 pyudev==0.24.1 pyxdg==0.28 pyxlsb2==0.0.9 PyYAML==6.0.1 quodlibet==4.5.0 reportbug==12.0.0 requests==2.28.1 roman==4.1 sgmllib3k==1.0.0 six==1.16.0 untangle==1.2.1 urllib3==1.26.12 xdg==5 XLMMacroDeobfuscator==0.2.7 xlrd2==1.3.4 yara-python==4.2.3 yaramod==3.6.0

In addition, all was good with :

yara-python==4.2.3 yaramod==3.16.0

Do you know what's append?

Thanks in advance.

MatejKastak commented 8 months ago

Hi @benjamin44, is there any particular reason why you trying to use yaramod==3.6.0?

It is an older version of Yaramod, so most likely yaramod.Features was not implemented yet at that point.

The current version is v3.21.0. Can you try using that version instead? (e.g. pip install yaramod -U)