Commit Graph
2561 Commits
Author SHA1 Message Date
Ԝеѕ 39076d2eb2 docs - update pe pdb_path example formatting
use consistent italic format for example
2020-08-12 10:18:09 +02:00
Ladislav Zezula 305b79dc78 Fixed possible referencing of an uninitialized value 2020-08-08 11:18:19 +02:00
Rosen Penev b9ae541bd3 Fix compilation without deprecated OpenSSL APIs
The previous commit was totally broken. It was still using deprecated
APIs.

Signed-off-by: Rosen Penev <[email protected]>
2020-08-08 11:15:12 +02:00
Konrad Weihmann 52e6866023 Makefile.am: remove hardcoded static lib
When compiling without static libraries the recently
introduced change prevented compilation.
As it looks like a forgotten debug settings, revert this
pariticular line

Signed-off-by: Konrad Weihmann <[email protected]>
2020-07-26 19:05:21 +02:00
Victor M. Alvarez 1ca904a1ab Make sure that we set the null terminator for the SIZED_STRING allocated in _yr_base64_get_base64_substring. 2020-07-21 14:16:09 +02:00
Victor M. Alvarez e64b381f84 Fix issue introduced in a63d579b2c. 2020-07-21 14:14:13 +02:00
Mike Wiacek e7a4372b84 Define HAVE_MKSTEMP for building libmagic 2020-07-20 09:34:17 +02:00
Victor M. Alvarez a63d579b2c Set null terminator when creating SIZED_STRING in yr_re_ast_extract_literal. 2020-07-17 18:32:04 +02:00
Victor M. Alvarez c69943b317 Use memcpy instead of strncpy in sized_string_dup.
With this change sized_string_dup works correctly even if the SIZED_STRING contains zeroes.
2020-07-16 23:45:09 +02:00
Victor M. Alvarez 541d00bf5e Fix buffer overrun in sized_string_convert_to_wide.
The buffer overrun started after 65904503c9, due to SIZED_STRING not having the extra 3 padding bytes a the end.
2020-07-16 23:43:23 +02:00
Victor M. Alvarez 65904503c9 Change packing of SIZED_STRING from 4 bytes to 1.
This removes 3 unused bytes at the end of each SIZED_STRING. Those 3 bytes are not initialized by alloc_sized_string and cause MemorySanitizer to fail with use-of-uninitialized-value.
2020-07-16 23:22:06 +02:00
Ԝеѕ cdc148567d docs- fix rst link to yara.Rules match method
keyword for methods is `meth` - https://stackoverflow.com/questions/22700606/how-would-i-cross-reference-a-function-generated-by-autodoc-in-sphinx 

fixes #1307, #1308 regression
2020-07-14 09:19:52 +02:00
Hilko Bengen 4d7b4d10ac Make compiled rules smaller by introducing shorter PUSH variants
This cuts the condition evaluation program generated from the
signature-base[1] ruleset from 429053 to 329558 bytes, saving 23.1%

[1] https://github.com/Neo23x0/signature-base
2020-07-13 14:03:07 +02:00
Victor M. Alvarez 1822d363bc More adjustments to the size of hash tables. 2020-07-13 14:02:30 +02:00
Victor M. Alvarez 1dd48ba24e Adjust hash table sizes. 2020-07-13 14:02:30 +02:00
Victor M. Alvarez ea6f24ce3b Make compiled rules smaller by not saving the same string twice.
Before this change if the identifier $a was used in 100 rules, the text string  "$a" would appear 100 times in the compiled rules. After this change it is saved once and referenced from multiple places. The same happens with module names, literal strings used in the rules and so on.
2020-07-13 14:02:30 +02:00
Victor M. Alvarez 510f366099 Fix issue #1317. 2020-07-08 11:45:20 +02:00
Hilko Bengen 4e22d4cbdf Use correct comment syntax for unused opcode #define's 2020-07-01 23:31:34 +02:00
mattnotmax 8a749b70ad Minor adjustment
Changed to: "Return true if the file is a PE."
2020-07-01 22:14:12 +02:00
mattnotmax 1f3bf627cf added pe.is_pe() documentation 2020-07-01 22:14:12 +02:00
Victor M. Alvarez 1c17965e72 Fix warning. 2020-06-30 10:55:48 +02:00
Victor M. Alvarez 9df6f063bd Fix preprocessor condition. 2020-06-26 18:36:33 +02:00
Victor M. Alvarez d39044535c When building with Bazel disable assertions and compile with the maximum optimization level by default. 2020-06-26 18:20:41 +02:00
Victor M. Alvarez 7a5b3a29cc Accept escape sequence \t (carriage return) in text strings. 2020-06-26 16:41:58 +02:00
Victor M. Alvarez 1595e53ea6 Bump version to 4.0.2 v4.0.2 2020-06-26 09:17:35 +02:00
Victor M. Alvarez 2d5f600ccb Simplify atom quality calculation. 2020-06-26 09:17:35 +02:00
Victor M. Alvarez 8d3f8259ad Move command line tools to their own directory. 2020-06-26 09:17:35 +02:00
Amey Chavan 98484eb9ad Update yara-python.spec (#1310)
Some word spacing corrections in %description section.
2020-06-19 09:00:03 +02:00
Ԝеѕ d00bd91f59 Docs - fix link to Rules match() method (#1308)
should fix link from #1307
2020-06-18 17:33:23 +02:00
Victor M. Alvarez 6eb7cef519 Use flags MAP_RESILIENT_MEDIA and MAP_RESILIENT_CODESIGN with mmap in MacOS.
These flags prevent crashes while reading from memory-mapped files in MacOS. MAP_RESILIENT_MEDIA prevents crashes while reading from a file in removable media that becomes unavailable, while MAP_RESILIENT_CODESIGN prevents crashes when reading binaries whose digital signature is invalid.

Closes #1309
2020-06-18 17:31:22 +02:00
Ԝеѕ 1169051181 Python docs - show python exceptions raised (#1307)
* Python docs - show python exceptions raised

* link to yara.match() method
2020-06-17 21:56:55 +02:00
Victor M. Alvarez 33ec9bbd67 Enable some tests that were disabled. 2020-06-15 10:19:43 +02:00
Victor M. Alvarez 843e730299 Fix integer overflow causing missed matches on files larger than 2GB.
Closes #1304
2020-06-15 10:19:10 +02:00
Victor M. Alvarez fc100a8670 Fix integer overflows in timeout logic when compiling in 32-bits. (#1301)
Closes #1299
2020-06-12 19:58:19 +02:00
mrmekuandDan Muller d652e4fcef Print OpenSSL compilation logs on error (#1300)
Co-authored-by: Dan Muller <[email protected]>
2020-06-12 08:56:27 +02:00
Victor M. Alvarez ecd25bfe69 Remove mention to META_TYPE_NULL from the documentation. 2020-06-10 12:04:02 +02:00
Ilya Shipitsin bc16cb416a libyara/strutils.c: fix potential null pointer dereference found by cppcheck
libyara/strutils.c:236:18: warning: Either the condition 'haystack==NULL'
is redundant or there is pointer arithmetic with NULL pointer.
2020-06-10 10:54:23 +02:00
Victor M. Alvarez bb42569d90 Fix issue #1295 2020-06-05 13:17:53 +02:00
Victor M. Alvarez 510fb169fc Merge branch 'master' of github.com:VirusTotal/yara 2020-06-03 12:36:57 +02:00
Victor M. Alvarez ea73608a77 Return an error instead of aborting the program when looking for field name that doesn't exist during the scan.
This does't occur often, as this kind of errors are catch during compilation. However, this may occur when you try to use rules that were compiled with a version of YARA that has support for OpenSSL with another version that doesn't have it. That's because YARA with OpenSSL supports some fields in the "pe" module that are not allowed by YARA without OpenSSL. The compiled rules are valid for YARA with OpenSSL, but the fields won't be found when they are used without OpenSSL support.

Closes #1288
2020-06-03 12:34:32 +02:00
Victor M. Alvarez 46985d33f8 Return an error instead of aborting the program when looking for field name that doesn't exist during the scan.
This does't occur often, as this kind of errors are catch during compilation. However, this may occur when you try to use rules that were compiled with a version of YARA that has support for OpenSSL with another version that doesn't have it. That's because YARA with OpenSSL supports some fields in the "pe" module that are not allowed by YARA without OpenSSL. The compiled rules are valid for YARA with OpenSSL, but the fields won't be found when they are used without OpenSSL support.
2020-06-03 12:33:42 +02:00
Victor M. Alvarez 02e7c97e35 Fix issue #1294 2020-06-03 11:43:39 +02:00
hepler d6c469f41f Fix typos and inconsistent indentation in docs 2020-06-02 11:41:56 +02:00
Victor M. Alvarez 9a3b4e3d7d Adding Touchweb to "who's using YARA". 2020-05-29 10:46:53 +02:00
Vitaly Kamluk f45abbecfe Fixed use-after-free bug in PE module
The bug was triggered by digitally signed malformed PE file
  md5: fd6d7a3b087e9a0d6d4abafb47701da0
  To reproduce run any rule that does import "pe", but the
  effects may vary depending on your memory state.
2020-05-22 10:18:54 +02:00
Victor M. Alvarez cd5820f4ae Add additional integrity checks while in paranoid mode. 2020-05-21 13:24:53 +02:00
Victor M. Alvarez 05d5effcb0 Make buffer IDs an unsigned integer.
As buffer IDs are non-negative number it makes more sense to declare them as uint32_t, which is coherent with the definition of YR_ARENA_REF, which is:

struct YR_ARENA_REF
{
  uint32_t buffer_id;
  uint32_t offset;
};
2020-05-20 19:08:42 +02:00
Victor M. Alvarez b5378bfb3d Bump version number to 4.0.1 v4.0.1 2020-05-15 10:43:21 +02:00
Victor M. Alvarez 7edc12b22d Fix issue in logic expression.
Both operands in a logic OR expression where the same.
2020-05-15 09:53:53 +02:00
Victor M. Alvarez 59817591c4 Add missing data files to Bazel tests. 2020-05-12 15:58:09 +02:00