Python interface for YARA
Project description
yara-python
With this library you can use 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:
>>> 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')]
Installation
The easiest way of installing YARA is by using pip:
$ pip install yara-python
But you can also get the source from GitHub and compile it yourself:
$ 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:
$ python setup.py build --dynamic-linking
For this option to work you must build and install YARA separately before installing yara-python.
Documentation
Find more information about how to use yara-python at https://yara.readthedocs.org/en/latest/yarapython.html.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for yara_python-4.0.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a572d850ab612fdfca540a980cdf1494bb537b5c30e0da9e8bf1d9224d6207b5 |
|
MD5 | 6d79642717031950ae7732c375a07681 |
|
BLAKE2b-256 | 9611e8dad4a4372dea80fc7231d08628d739a04b514895be180abfb8d6d8bce0 |
Hashes for yara_python-4.0.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0642d2210af666075a551cad6fbccab7e4d08c530c7df96692679f21ac45d3b |
|
MD5 | 2aceba56f20b29bce09c741bd3816efd |
|
BLAKE2b-256 | b866cbf6096dd79e935162670d10cbcbcc69133b7a85f92e575c641052d6270e |
Hashes for yara_python-4.0.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57779d476586dc4b58053a1421e6550785975fff52ad0e9091bb0c9deba21035 |
|
MD5 | c5001bb8b7d0ecc645356ebb479f6243 |
|
BLAKE2b-256 | 17f40a7338ac55edcae234f702b13dbba9895a719174acd39952606845d1c290 |
Hashes for yara_python-4.0.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cdce1a3638ad47e4f4b2eec42ab4d4a0881a231d4e5a2380296a505ad64c35f |
|
MD5 | 6f8bdfa5bca17daa269e8cee7b3a6425 |
|
BLAKE2b-256 | 4e8ccf6aa039fde96d0ae313180f7cad76daf0bc3c367466d6ae7b8448d82f86 |
Hashes for yara_python-4.0.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f537e8c58c0e31a9c6bc1b4fa28d1467cc4abf1e7f5e55fc20ab4a179dc3971e |
|
MD5 | bbf23021ee458405c60fb60d99a752fe |
|
BLAKE2b-256 | c7f7dce423160bb42976cee87a056bd7f870bf718a1e097406526f2cf48eb501 |
Hashes for yara_python-4.0.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8205fdc7e5db7659ecb3c9df639c4626f846ad55fbb3c19725db25c78e783bbb |
|
MD5 | 1378e8750b49c5210bcb58fac3eca53f |
|
BLAKE2b-256 | 23948b2fd09f004a0eab5116f69e7e6dee4b936d122294d271b1bbf8800f2e0f |
Hashes for yara_python-4.0.4-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9558ee92b7e9f006953297018faa7412b2e0d94549a5b86e7ba8bc4df2622f |
|
MD5 | 86684c8c1d80bcefca15449e899734fb |
|
BLAKE2b-256 | 3860c8fe0e62db71f730506406995d65300660cdb6b595fd46eeccda69553dfd |
Hashes for yara_python-4.0.4-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6a09a03fbdea362d3b733342252225fcf700f662edc7cd661cb0769c0069556 |
|
MD5 | 0776cf318b7c016ae818439a84dbf2a5 |
|
BLAKE2b-256 | 282d517e6711b18e4f0939fe18b94bd5626b73de899f593948418d81a52bae85 |