Commit Graph
93 Commits
Author SHA1 Message Date
Wesley Shields 87bc03d587 Add a math.abs() (#1545)
As mentioned in #1454, this makes checking the distance between two matches
regardless of the order of matches easier.
2021-08-23 12:17:45 +02:00
xbabka01 b8650dfa05 Add imports_details and delayed_imports_details (#1523) 2021-08-20 09:42:57 +02:00
xbabka01andVictor M. Alvarez 21f4c6ec06 Added pe.version_info_list with the list of all version info records (#1509)
Co-authored-by: Victor M. Alvarez <[email protected]>
2021-08-11 09:49:47 +02:00
xbabka01 5f34c1e466 Fix typo from pe.SECTION_FARDATA to SECTION_MEM_FARDATA (#1533) 2021-08-09 14:25:15 +02:00
xbabka01 0c8d91f705 Added missing PE constants (#1520) 2021-08-09 12:10:32 +02:00
Steven 60b1b4d4e6 Add warnings_callbacks to Python Rules class summary (#1517)
Spelling corrections
Consistent indents in documentation
2021-08-09 11:50:26 +02:00
KashiwabaYuki 946ad9b0f2 Add "EM_NONE" at ELF module MACHINE reference (#1513)
I know "EM_NONE" is difined in elf.h.
(https://github.com/VirusTotal/yara/blob/e1360f6cbe3d8daf350018661bc6772bd5b726f2/libyara/include/yara/elf.h)
However this doc has not "EM_NONE".
2021-07-09 23:46:32 +02:00
Victor M. Alvarez 7588ed630f Rename tonumber function to to_number, for consistency with other names. 2021-03-15 12:38:53 +01:00
LiYang 2edd10c735 add math.tonumber function to convert bool to number (#1450)
more data types can be supported if needed, for example
string to number, etc.
2021-03-15 12:36:14 +01:00
Wesley Shields 2c3e032ab6 Fix overlay docs. (#1456)
Fix a bug in the overlay docs so that the example is syntactically valid.

Fixes #1455
2021-02-26 23:40:50 -06:00
Runa Sandvik c88b2dcd64 Clarify that pe.imphash() requires a lowercase string (#1441)
* Clarify that pe.imphash() requires a lowercase string

* Update language for imphash()
2021-02-03 09:14:10 +01:00
Ԝеѕ c6b3c4d1e0 docs - add PE timestamp example (#1439) 2021-01-19 10:18:37 +01:00
Victor M. Alvarez 0ffcba00a6 Set pe.overlay.offset to 0 for PE files that don't have an overlaid.
Until now pe.overlay.offset was undefined in such cases. For non-PE files this fields keep being undefined.
2021-01-07 10:17:37 +01:00
Hilko Bengen 9fd9a80db6 pe: add signature[i].algorithm_oid (#1421)
* pe: add signature[i].algorithm_oid

Certificate signature algorithms are encoded using object identifiers
whose text representations depend on the cryptographic library. For
stable YARA rules, it is wiser to rely on the OID, so let's provide
it.

For example, while OpenSSL 1.1.1d resolves 1.2.840.113549.1.1.11 to
"sha256WithRSAEncryption" (or "RSA-SHA256" for the short name), the
only string representation I have gotten out of the Windows CryptoAPI
is "sha256RSA".

* Add documentation for signature[i].algorithm_oid
2020-12-27 18:04:50 +01:00
Wesley ShieldsandVictor M. Alvarez 77328011a3 Implement pe.entry_point_raw. (#1410)
* Implement pe.entry_point_raw.

Add pe.entry_point_raw which is the raw value of the entry point field from the
optional header. This value is NOT converted to a file offset or a virtual
address, and is just the raw bytes taken straight from the header.

This allows you to use the entry point as it is specified in the file without
having to jump through hoops to parse it by hand in your condition.

* Specify the version in which entry_point_raw was added.

Co-authored-by: Victor M. Alvarez <[email protected]>
2020-12-02 10:16:26 +01:00
Wesley Shields a8d52ea40f Add number_of_imported_functions. (#1348)
Add the number of imported functions which were parsed. This is the TOTAL number
of functions across ALL imported libraries.
2020-11-23 10:18:27 +01:00
Wesley Shields 472c5817dc Add documentation for rva field in resources. 2020-08-23 11:26:19 +02:00
Ԝеѕ 39076d2eb2 docs - update pe pdb_path example formatting
use consistent italic format for example
2020-08-12 10:18:09 +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 f4a5daab94 Minor changes in documentation. 2020-04-28 10:41:59 +02:00
malvidin d60d3727db Error if string modified with base64 and fullword
Added more string modifier information to writingrules.rst
Update version to 4.0.0 for post 3.11.0 changes
2020-04-23 12:46:35 +02:00
Victor M. Alvarez 0a49ac72f1 Reflect API changes in the documentation. 2020-03-16 14:55:38 +01:00
Wesley Shields cacd755305 Fix incorrect version number in docs.
Fixes #1230.
2020-03-10 13:04:00 +01:00
Victor M. Alvarez d2fd6fe5f1 Fix minor issues in previous commit. 2020-03-02 10:23:43 +01:00
Wesley Shields 5750d7e33e Merge branch 'master' into export_addresses 2020-02-18 14:53:37 -05:00
Victor M. Alvarez 8d5241917b Rename pdb to pdb_path and document it. 2020-02-18 10:02:57 +01:00
Wesley Shields ab41c7efca Merge branch 'master' into export_addresses 2020-02-04 13:39:46 -05:00
Victor M. Alvarez 5094308ef0 Minor style changes in the documentation. 2020-01-29 16:18:08 +01:00
Marc-Etienne M.Léveilléandmposlusny d764d2fe2b Change the pe.imports(...) functions to return the count of matches (#1156)
instead of a boolean value.

This change affects pe.imports(dll_name) and pe.imports(dll_regex, func_regex).

Like in e68eff98, it remains backward compatible because the count, when
casted to a boolean, will be true if it is larger or equal to 1.

Co-authored-by: mposlusny <[email protected]>
2020-01-29 16:06:28 +01:00
mtonsmann 3e970d4beb Cuckoo module upgrades (#1177)
Added network.udp, network.tcp,network.host and network.https_user_agent
2020-01-29 15:13:54 +01:00
Malware Utkonos 2066a0a9ba Remove duplicate entry (#1204) 2020-01-27 08:47:11 +01:00
Wesley Shields 87873adfac Merge branch 'master' into export_addresses 2019-10-22 12:40:16 -04:00
Wesley Shields 49a0045c84 Add field offsets. (#1112)
* Add field offsets.

Add field offsets. This is particularly interesting for certain obfuscators
where the fields contain highly interesting values. Knowing their offsets lets
us use these specific values in detections.

* Add docs and pluralize field_offset.
2019-09-24 10:36:15 +02:00
Ԝеѕ 4df40fca36 Note that hash matching requires lowercase hash (#1106)
* Note that hash matching requires lowercase hash

https://github.com/VirusTotal/yara/issues/1004

* Clarify why hash cond needs to be lowercase
2019-09-23 13:02:44 +02:00
Marc-Etienne M.Léveillé e68eff9868 PE rich signature improvements (#1135)
* rich_internal function now returns the sum of counts
of the matching rich entries instead of a boolean

It remains backwards compatible thanks to non-null values being
considered as true and when not found it returns 0 (false).

* Update documentation of the `toolid` and `version` in PE module
to reflect changes of behavior: it now returns the sum of counts matching
to given `toolid` and `version`.

* Added test for the updated rich_signature function
2019-09-23 12:49:22 +02:00
Wesley Shields 78241f498c Merge branch 'master' into export_addresses 2019-09-03 12:08:29 -04:00
Malware Utkonos 6883100592 Fix typo in example (#1116) 2019-08-26 22:19:47 +02:00
Wesley Shields b9a740a720 Add docs for pe.exports_index() functions. 2019-07-27 20:36:43 -04:00
Wesley Shields 1e776ad59f Add documentation for new export information in PE module. 2019-07-15 08:42:44 -04:00
Wesley Shields 4f89f7f106 Add crc32 to hash module. (#1076)
Add crc32 functions to the hash module. They work in the normal "offset and
size" way and on arbitrary strings.

While here, add tests for it and also documentation.
2019-06-10 16:41:38 +02:00
Wesley Shields 310aff2608 A better attempt at clarifiying this function. 2019-02-22 14:52:35 +01:00
Wesley Shields 0ddd8185d4 Add a note about pe.rva_to_offset(pe.entry_point) 2019-02-22 14:52:35 +01:00
Victor M. Alvarez 598a564133 Minor style fixes in documentation. 2018-08-01 23:47:20 +02:00
Ԝеѕ 47699e7b4f Describe pe characteristics (#923) 2018-08-01 23:32:13 +02:00
Victor M. Alvarez 2a47806435 Add test cases for new "import" function in PE module and document it. 2018-07-26 11:22:42 +02:00
Victor M. Alvarez 4ef8f4a573 Change some version number in the documentation that should be 3.8.0 instead of 3.7.2 and break long lines. 2018-07-25 20:43:03 +02:00
Ladislav Zezula 4d1529f825 Added more fields from IMAGE_FILE_HEADER, IMAGE_OPTIONAL_HEADER(64) a… (#870)
* Added more fields from IMAGE_FILE_HEADER, IMAGE_OPTIONAL_HEADER(64) and IMAGE_SECTION_HEADER

* Added constants for data directory indices

* Fixed whitespaces

* Documented changes in "bug_868_add_more_pe_fields"

* Added IMAGE_FILE_HEADER::SizeOfOptionalHeader
Fixed typos in the RST documentation file

* Fixed whitespaces

* Fixed example

* Added missing declaration of "size_of_optional_header"
2018-07-25 20:36:53 +02:00
Wesley Shields a43c41614c Add thumbprint to pe.signatures[] (#897)
* Add thumbprint to pe.signatures[]

* Add tests for certificate parsing.
2018-07-25 20:28:40 +02:00
Wesley Shields cffc6277b8 Use unsigned integers for math.min() and math.max(). (#886) 2018-06-01 09:20:49 +02:00