Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://travis-ci.org/VirusTotal/yara-python.svg :target: https://travis-ci.org/VirusTotal/yara-python .. image:: https://ci.appveyor.com/api/projects/status/gidnb9ulj3rje5s2?svg=true :target: https://ci.appveyor.com/project/plusvic/yara-python
With this library you can use YARA <https://github.com/VirusTotal/yara>
_ from
your Python programs. It covers all YARA's features, from compiling, saving
and loading rules to scanning files, strings and processes.
Here it goes a little example:
.. code-block:: python
>>> import yara
>>> rule = yara.compile(source='rule foo: bar {strings: $a = "lmn" condition: $a}')
>>> matches = rule.match(data='abcdefgjiklmnoprstuvwxyz')
>>> print(matches)
[foo]
>>> print(matches[0].rule)
foo
>>> print(matches[0].tags)
['bar']
>>> print(matches[0].strings)
[(10L, '$a', 'lmn')]
The easiest way of installing YARA is by using pip
:
.. code-block:: bash
$ pip install yara-python
But you can also get the source from GitHub and compile it yourself:
.. code-block:: bash
$ git clone --recursive https://github.com/VirusTotal/yara-python $ cd yara-python $ python setup.py build $ sudo python setup.py install
Notice the --recursive
option used with git
. This is important because
we need to download the yara
subproject containing the source code for
libyara
(the core YARA library). It's also important to note that the two
methods above link libyara
statically into yara-python. If you want to link
dynamically against a shared libyara
library use:
.. code-block:: bash
$ sudo python setup.py install --dynamic-linking
For this option to work you must build and install
YARA <https://github.com/VirusTotal/yara>
_ separately before installing
yara-python
.
Find more information about how to use yara-python at https://yara.readthedocs.org/en/latest/yarapython.html.
FAQs
Python interface for YARA
We found that yara-python-dex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.