pdfalyzer 1.16.6__py3-none-any.whl → 1.16.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pdfalyzer might be problematic. Click here for more details.

CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # NEXT RELEASE
2
2
 
3
+ ### 1.16.8
4
+ * Even more PDF related YARA rules
5
+ * Upgrade `anytree` to 2.13.0
6
+ * Upgrade `yaralyzer` to 1.0.4
7
+
8
+ ### 1.16.7
9
+ * Lots of new PDF related YARA rules
10
+ * Upgrade `yaralyzer` to 1.0.3
11
+ * Upgrade `pypdf` to 5.9.0
12
+
3
13
  ### 1.16.6
4
14
  * Add the creator hash to GIFTEDCROOK rule
5
15
 
@@ -13,9 +13,11 @@ from pdfalyzer.config import PdfalyzerConfig
13
13
  YARA_RULES_DIR = files('pdfalyzer').joinpath('yara_rules')
14
14
 
15
15
  YARA_RULES_FILES = [
16
+ 'didier_stevens.yara',
16
17
  'lprat.static_file_analysis.yara',
17
18
  'PDF.yara',
18
19
  'PDF_binary_stream.yara',
20
+ 'pdf_malware.yara',
19
21
  ]
20
22
 
21
23
 
@@ -34,18 +36,20 @@ def _build_yaralyzer(scannable: Union[bytes, str], label: Optional[str] = None)
34
36
  with as_file(YARA_RULES_DIR.joinpath(YARA_RULES_FILES[0])) as yara0:
35
37
  with as_file(YARA_RULES_DIR.joinpath(YARA_RULES_FILES[1])) as yara1:
36
38
  with as_file(YARA_RULES_DIR.joinpath(YARA_RULES_FILES[2])) as yara2:
37
- # If there is a custom yara_rules argument file use that instead of the files in the yara_rules/ dir
38
- rules_paths = YaralyzerConfig.args.yara_rules_files or []
39
-
40
- if not YaralyzerConfig.args.no_default_yara_rules:
41
- rules_paths += [str(y) for y in [yara0, yara1, yara2]]
42
-
43
- try:
44
- return Yaralyzer.for_rules_files(rules_paths, scannable, label)
45
- except ValueError as e:
46
- # TODO: use YARA_FILE_DOES_NOT_EXIST_ERROR_MSG variable
47
- if "it doesn't exist" in str(e):
48
- print(str(e))
49
- exit(1)
50
- else:
51
- raise e
39
+ with as_file(YARA_RULES_DIR.joinpath(YARA_RULES_FILES[3])) as yara3:
40
+ with as_file(YARA_RULES_DIR.joinpath(YARA_RULES_FILES[4])) as yara4:
41
+ # If there is a custom yara_rules argument file use that instead of the files in the yara_rules/ dir
42
+ rules_paths = YaralyzerConfig.args.yara_rules_files or []
43
+
44
+ if not YaralyzerConfig.args.no_default_yara_rules:
45
+ rules_paths += [str(y) for y in [yara0, yara1, yara2, yara3, yara4]]
46
+
47
+ try:
48
+ return Yaralyzer.for_rules_files(rules_paths, scannable, label)
49
+ except ValueError as e:
50
+ # TODO: use YARA_FILE_DOES_NOT_EXIST_ERROR_MSG variable
51
+ if "it doesn't exist" in str(e):
52
+ print(str(e))
53
+ exit(1)
54
+ else:
55
+ raise e