pdfalyzer 1.16.6__py3-none-any.whl → 1.16.7__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 +5 -0
- pdfalyzer/detection/yaralyzer_helper.py +19 -15
- pdfalyzer/yara_rules/PDF.yara +898 -177
- pdfalyzer/yara_rules/PDF_binary_stream.yara +1 -3
- pdfalyzer/yara_rules/didier_stevens.yara +248 -0
- pdfalyzer/yara_rules/pdf_malware.yara +2996 -0
- {pdfalyzer-1.16.6.dist-info → pdfalyzer-1.16.7.dist-info}/METADATA +5 -7
- {pdfalyzer-1.16.6.dist-info → pdfalyzer-1.16.7.dist-info}/RECORD +11 -9
- {pdfalyzer-1.16.6.dist-info → pdfalyzer-1.16.7.dist-info}/LICENSE +0 -0
- {pdfalyzer-1.16.6.dist-info → pdfalyzer-1.16.7.dist-info}/WHEEL +0 -0
- {pdfalyzer-1.16.6.dist-info → pdfalyzer-1.16.7.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
rule PDF_with_XORed_JS_keywords
|
|
3
|
-
{
|
|
2
|
+
rule PDF_with_XORed_JS_keywords {
|
|
4
3
|
meta:
|
|
5
4
|
author = "Michel de Cryptadamus"
|
|
6
5
|
description = "Look for Javascript keywords with XOR"
|
|
@@ -16,7 +15,6 @@ rule PDF_with_XORed_JS_keywords
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
|
|
20
18
|
// rule Frontslash_regex
|
|
21
19
|
// {
|
|
22
20
|
// meta:
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
rule Contains_VBE_File {
|
|
2
|
+
meta:
|
|
3
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
4
|
+
description = "Detect a VBE file inside a byte sequence"
|
|
5
|
+
method = "Find string starting with #@~^ and ending with ^#~@"
|
|
6
|
+
strings:
|
|
7
|
+
$vbe = /#@~\^.+\^#~@/
|
|
8
|
+
condition:
|
|
9
|
+
$vbe
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
rule JPEG_EXIF_Contains_eval {
|
|
14
|
+
meta:
|
|
15
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
16
|
+
description = "Detect eval function inside JPG EXIF header (http://blog.sucuri.net/2013/07/malware-hidden-inside-jpg-exif-headers.html)"
|
|
17
|
+
method = "Detect JPEG file and EXIF header ($a) and eval function ($b) inside EXIF data"
|
|
18
|
+
strings:
|
|
19
|
+
$a = {FF E1 ?? ?? 45 78 69 66 00}
|
|
20
|
+
$b = /\beval\s*\(/
|
|
21
|
+
condition:
|
|
22
|
+
uint16be(0x00) == 0xFFD8 and $a and $b in (@a + 0x12 .. @a + 0x02 + uint16be(@a + 0x02) - 0x06)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
XORSearch wildcard rule(s):
|
|
28
|
+
API Hashing:10:AC84C07407C1CF0D01C7EBF481FF
|
|
29
|
+
API Hashing bis:10:AC84C07407C1CF0701C7EBF481FF
|
|
30
|
+
*/
|
|
31
|
+
rule maldoc_API_hashing {
|
|
32
|
+
meta:
|
|
33
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
34
|
+
strings:
|
|
35
|
+
$a1 = {AC 84 C0 74 07 C1 CF 0D 01 C7 EB F4 81 FF}
|
|
36
|
+
$a2 = {AC 84 C0 74 07 C1 CF 07 01 C7 EB F4 81 FF}
|
|
37
|
+
condition:
|
|
38
|
+
any of them
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
XORSearch wildcard rule(s):
|
|
44
|
+
Function prolog signature:10:558BEC83C4
|
|
45
|
+
Function prolog signature:10:558BEC81EC
|
|
46
|
+
Function prolog signature:10:558BECEB
|
|
47
|
+
Function prolog signature:10:558BECE8
|
|
48
|
+
Function prolog signature:10:558BECE9
|
|
49
|
+
*/
|
|
50
|
+
rule maldoc_function_prolog_signature {
|
|
51
|
+
meta:
|
|
52
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
53
|
+
strings:
|
|
54
|
+
$a1 = {55 8B EC 81 EC}
|
|
55
|
+
$a2 = {55 8B EC 83 C4}
|
|
56
|
+
$a3 = {55 8B EC E8}
|
|
57
|
+
$a4 = {55 8B EC E9}
|
|
58
|
+
$a5 = {55 8B EC EB}
|
|
59
|
+
condition:
|
|
60
|
+
any of them
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
XORSearch wildcard rule(s):
|
|
65
|
+
Structured exception handling :10:648B(B;00???101)00000000
|
|
66
|
+
Structured exception handling bis:10:64A100000000
|
|
67
|
+
*/
|
|
68
|
+
rule maldoc_structured_exception_handling {
|
|
69
|
+
meta:
|
|
70
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
71
|
+
strings:
|
|
72
|
+
$a1 = {64 8B (05|0D|15|1D|25|2D|35|3D) 00 00 00 00}
|
|
73
|
+
$a2 = {64 A1 00 00 00 00}
|
|
74
|
+
condition:
|
|
75
|
+
any of them
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
XORSearch wildcard rule(s):
|
|
80
|
+
Indirect function call:10:FF75(B;A???????)FF55(B;A???????)
|
|
81
|
+
*/
|
|
82
|
+
rule maldoc_indirect_function_call_1 {
|
|
83
|
+
meta:
|
|
84
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
85
|
+
strings:
|
|
86
|
+
$a = {FF 75 ?? FF 55 ??}
|
|
87
|
+
condition:
|
|
88
|
+
for any i in (1..#a): (uint8(@a[i] + 2) == uint8(@a[i] + 5))
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
XORSearch wildcard rule(s):
|
|
93
|
+
Indirect function call bis:10:FFB5(B;A???????)(B;B???????)(B;C???????)(B;D???????)FF95(B;A???????)(B;B???????)(B;C???????)(B;D???????)
|
|
94
|
+
*/
|
|
95
|
+
rule maldoc_indirect_function_call_2 {
|
|
96
|
+
meta:
|
|
97
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
98
|
+
strings:
|
|
99
|
+
$a = {FF B5 ?? ?? ?? ?? FF 95 ?? ?? ?? ??}
|
|
100
|
+
condition:
|
|
101
|
+
for any i in (1..#a): ((uint8(@a[i] + 2) == uint8(@a[i] + 8)) and (uint8(@a[i] + 3) == uint8(@a[i] + 9)) and (uint8(@a[i] + 4) == uint8(@a[i] + 10)) and (uint8(@a[i] + 5) == uint8(@a[i] + 11)))
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/*
|
|
106
|
+
XORSearch wildcard rule(s):
|
|
107
|
+
Find kernel32 base method 2:10:31(B;11A??A??)(B;10100A??)30648B(B;00B??A??)
|
|
108
|
+
*/
|
|
109
|
+
rule maldoc_find_kernel32_base_method_2 {
|
|
110
|
+
meta:
|
|
111
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
112
|
+
strings:
|
|
113
|
+
$a = {31 ?? ?? 30 64 8B ??}
|
|
114
|
+
condition:
|
|
115
|
+
for any i in (1..#a): ((uint8(@a[i] + 1) >= 0xC0) and (((uint8(@a[i] + 1) & 0x38) >> 3) == (uint8(@a[i] + 1) & 0x07)) and ((uint8(@a[i] + 2) & 0xF8) == 0xA0) and (uint8(@a[i] + 6) <= 0x3F) and (((uint8(@a[i] + 6) & 0x38) >> 3) != (uint8(@a[i] + 6) & 0x07)))
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
XORSearch wildcard rule(s):
|
|
121
|
+
Find kernel32 base method 3:10:6830000000(B;01011A??)648B(B;00B??A??)
|
|
122
|
+
*/
|
|
123
|
+
rule maldoc_find_kernel32_base_method_3 {
|
|
124
|
+
meta:
|
|
125
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
126
|
+
strings:
|
|
127
|
+
$a = {68 30 00 00 00 (58|59|5A|5B|5C|5D|5E|5F) 64 8B ??}
|
|
128
|
+
condition:
|
|
129
|
+
for any i in (1..#a): (((uint8(@a[i] + 5) & 0x07) == (uint8(@a[i] + 8) & 0x07)) and (uint8(@a[i] + 8) <= 0x3F) and (((uint8(@a[i] + 8) & 0x38) >> 3) != (uint8(@a[i] + 8) & 0x07)))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
XORSearch wildcard rule(s):
|
|
135
|
+
GetEIP method 4 FLDZ/FSTENV [esp-12]:10:D9EED97424F4(B;01011???)
|
|
136
|
+
GetEIP method 4:10:D9EE9BD97424F4(B;01011???)
|
|
137
|
+
*/
|
|
138
|
+
rule maldoc_getEIP_method_4 {
|
|
139
|
+
meta:
|
|
140
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
141
|
+
strings:
|
|
142
|
+
$a1 = {D9 EE D9 74 24 F4 (58|59|5A|5B|5C|5D|5E|5F)}
|
|
143
|
+
$a2 = {D9 EE 9B D9 74 24 F4 (58|59|5A|5B|5C|5D|5E|5F)}
|
|
144
|
+
condition:
|
|
145
|
+
any of them
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
XORSearch wildcard rule(s):
|
|
151
|
+
Indirect function call tris:10:FFB7(B;????????)(B;????????)(B;????????)(B;????????)FF57(B;????????)
|
|
152
|
+
*/
|
|
153
|
+
rule maldoc_indirect_function_call_3 {
|
|
154
|
+
meta:
|
|
155
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
156
|
+
strings:
|
|
157
|
+
$a = {FF B7 ?? ?? ?? ?? FF 57 ??}
|
|
158
|
+
condition:
|
|
159
|
+
$a
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
/*
|
|
164
|
+
XORSearch wildcard rule(s):
|
|
165
|
+
Find kernel32 base method 1:10:648B(B;00???101)30000000
|
|
166
|
+
Find kernel32 base method 1bis:10:64A130000000
|
|
167
|
+
*/
|
|
168
|
+
rule maldoc_find_kernel32_base_method_1 {
|
|
169
|
+
meta:
|
|
170
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
171
|
+
strings:
|
|
172
|
+
$a1 = {64 8B (05|0D|15|1D|25|2D|35|3D) 30 00 00 00}
|
|
173
|
+
$a2 = {64 A1 30 00 00 00}
|
|
174
|
+
condition:
|
|
175
|
+
any of them
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
/*
|
|
180
|
+
XORSearch wildcard rule(s):
|
|
181
|
+
GetEIP method 1:10:E800000000(B;01011???)
|
|
182
|
+
*/
|
|
183
|
+
rule maldoc_getEIP_method_1 {
|
|
184
|
+
meta:
|
|
185
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
186
|
+
strings:
|
|
187
|
+
$a = {E8 00 00 00 00 (58|59|5A|5B|5C|5D|5E|5F)}
|
|
188
|
+
condition:
|
|
189
|
+
$a
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
XORSearch wildcard rule(s):
|
|
195
|
+
OLE file magic number:10:D0CF11E0
|
|
196
|
+
*/
|
|
197
|
+
rule maldoc_OLE_file_magic_number {
|
|
198
|
+
meta:
|
|
199
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
200
|
+
strings:
|
|
201
|
+
$a = {D0 CF 11 E0}
|
|
202
|
+
condition:
|
|
203
|
+
$a
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
XORSearch wildcard rule(s):
|
|
209
|
+
Suspicious strings:2:str=UrlDownloadToFile
|
|
210
|
+
Suspicious strings:2:str=GetTempPath
|
|
211
|
+
Suspicious strings:2:str=GetWindowsDirectory
|
|
212
|
+
Suspicious strings:2:str=GetSystemDirectory
|
|
213
|
+
Suspicious strings:2:str=WinExec
|
|
214
|
+
Suspicious strings:2:str=ShellExecute
|
|
215
|
+
Suspicious strings:2:str=IsBadReadPtr
|
|
216
|
+
Suspicious strings:2:str=IsBadWritePtr
|
|
217
|
+
Suspicious strings:2:str=CreateFile
|
|
218
|
+
Suspicious strings:2:str=CloseHandle
|
|
219
|
+
Suspicious strings:2:str=ReadFile
|
|
220
|
+
Suspicious strings:2:str=WriteFile
|
|
221
|
+
Suspicious strings:2:str=SetFilePointer
|
|
222
|
+
Suspicious strings:2:str=VirtualAlloc
|
|
223
|
+
Suspicious strings:2:str=GetProcAddr
|
|
224
|
+
Suspicious strings:2:str=LoadLibrary
|
|
225
|
+
*/
|
|
226
|
+
rule maldoc_suspicious_strings {
|
|
227
|
+
meta:
|
|
228
|
+
author = "Didier Stevens (https://DidierStevens.com)"
|
|
229
|
+
strings:
|
|
230
|
+
$a01 = "CloseHandle"
|
|
231
|
+
$a02 = "CreateFile"
|
|
232
|
+
$a03 = "GetProcAddr"
|
|
233
|
+
$a04 = "GetSystemDirectory"
|
|
234
|
+
$a05 = "GetTempPath"
|
|
235
|
+
$a06 = "GetWindowsDirectory"
|
|
236
|
+
$a07 = "IsBadReadPtr"
|
|
237
|
+
$a08 = "IsBadWritePtr"
|
|
238
|
+
$a09 = "LoadLibrary"
|
|
239
|
+
$a10 = "ReadFile"
|
|
240
|
+
$a11 = "SetFilePointer"
|
|
241
|
+
$a12 = "ShellExecute"
|
|
242
|
+
$a13 = "UrlDownloadToFile"
|
|
243
|
+
$a14 = "VirtualAlloc"
|
|
244
|
+
$a15 = "WinExec"
|
|
245
|
+
$a16 = "WriteFile"
|
|
246
|
+
condition:
|
|
247
|
+
any of them
|
|
248
|
+
}
|