forked from urule99/jsunpack-n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules
353 lines (343 loc) · 7.32 KB
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
/***
Yara Rules file for jsunpackn
http://jsunpack.jeek.org/
Blake Hartstein
blake[@]jeek.org
Feel free to send me new or custom rules!
If you want the most up to date rules, check http://jsunpack.jeek.org/dec/current_rules
Last updated 3/22/2010
Alert modifiers: (does not affect detection)
ref = CVE-NAME
impact = (between 0 - 10, 10 being most severe)
hide = (true|false), if hide=true, don't pass detected strings to program
use this if the rule name captures everything of value, or you just don't care about the data
Detection modifiers:
decodedPDF = rules that only alert if decoding within a PDF file
decodedOnly = rules that only alert if decoding level > 0 (ie. a decoding and not the original file)
(add your own) I will support them (maybe not) ;)
*/
rule Utilprintf: decodedPDF
{
meta:
ref = "CVE-2008-2992"
hide = true
strings:
$cve20082992 = "util.printf" nocase fullword
condition:
1 of them
}
rule SpellcustomDictionaryOpen: decodedPDF
{
meta:
ref = "CVE-2009-1493"
hide = true
strings:
$cve20091493 = "spell.customDictionaryOpen" nocase fullword
condition:
1 of them
}
rule printSeps: decodedPDF
{
meta:
ref = "CVE-2010-4091"
hide = true
strings:
$cve20104091_1 = "doc.printSeps"
$cve20104091_2 = "this.printSeps"
condition:
1 of them
}
/*
//This rule is not strong enough, handled by detecting createElement x 100 in pre.js now
rule MSIEUseAfterFree: decodedOnly
{
meta:
ref = "CVE-2010-0249"
hide = true
impact = 5
strings:
$cve20100249_1 = "createEventObject" nocase fullword
$cve20100249_2 = "getElementById" nocase fullword
$cve20100249_3 = "onload" nocase fullword
$cve20100249_4 = "srcElement" nocase fullword
condition:
all of them
}
*/
rule getAnnots: decodedPDF
{
meta:
impact = 3 //Since getAnnots may be legitimate
ref = "CVE-2009-1492"
hide = true
strings:
$cve20091492 = "getAnnots" nocase fullword
condition:
1 of them
}
rule mediaNewplayer: decodedPDF
{
meta:
ref = "CVE-2009-4324"
hide = true
strings:
$cve20094324 = "media.newPlayer" nocase fullword
condition:
1 of them
}
rule collectEmailInfo: decodedPDF
{
meta:
ref = "CVE-2007-5659"
hide = true
strings:
$cve20075659 = "collab.collectEmailInfo" nocase fullword
condition:
1 of them
}
rule CollabgetIcon: decodedPDF
{
meta:
ref = "CVE-2009-0927"
hide = true
strings:
$cve20090927 = "collab.getIcon" nocase fullword
condition:
1 of them
}
rule PDFobfuscation: decodedPDF
{
meta:
impact = 5
strings:
$cveNOMATCH = "collab[" nocase //hidden collab string
condition:
1 of them
}
rule UnconfirmedPDFexploit: decodedPDF
{
meta:
impact = 0
//unconfirmed exploitation
strings:
$cve20084813 = "getCosObj" nocase fullword
$cve20082042 = "app.checkForUpdate" nocase fullword
$cve20080726 = "printSepsWithParams" nocase fullword
$cve20073902 = "setExpression" nocase fullword
$cve20090773 = "ResizeSlots" nocase fullword
condition:
1 of them
}
rule DecodedGenericCLSID : decodedOnly
{
meta:
impact = 0
strings:
$gen = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/ nocase
condition:
1 of them
}
rule MSOfficeSnapshotViewer
{
meta:
ref = "CVE-2008-2463"
impact = 7
strings:
$cve20082463 = /(F0E42D50|F0E42D60|F2175210)-368C-11D0-AD81-00A0C90DC8D9/ nocase
condition:
1 of them
}
rule MSOfficeWebComponents
{ //Expect ActiveX with it, OWC10.Spreadsheet OWC11.Spreadsheet
meta:
ref = "CVE-2009-1136"
impact = 7
strings:
$cve20091136_1 = "msDataSourceObject" nocase fullword
$cve20091136_2 = "OWC10.Spreadsheet" nocase fullword
$cve20091136_3 = "OWC11.Spreadsheet" nocase fullword
condition:
1 of them
}
rule COMObjectInstantiationMemoryCorruption
{
meta:
ref = "CVE-2005-2127"
impact = 7
strings:
$cve20052127 = "EC444CB6-3E7E-4865-B1C3-0DE72EF39B3F" nocase fullword
condition:
1 of them
}
/** rule MSXMLCoreServicesdd
{ //match with open(a,b,c,d,e)? or setRequestHeader?
meta:
ref = "CVE-2006-5745"
impact = 7
strings:
$cve20065745 = "88d969c5-f192-11d4-a65f-0040963251e5" nocase fullword
condition:
1 of them
}*/
rule MSDirectShowCLSID
{
meta:
ref = "CVE-2008-0015"
impact = 7
strings:
$cve20080015 = "0955AC62-BF2E-4CBA-A2B9-A63F772D46CF" nocase fullword
condition:
1 of them
}
rule MSWindowsVMLElement
{
meta:
ref = "CVE-2007-0024"
impact = 7
strings:
$cve20070024 = "10072CEC-8CC1-11D1-986E-00A0C955B42E"
condition:
1 of them
}
rule MSsetSlice
{
meta:
ref = "CVE-2006-3730"
impact = 4
strings:
$cve20063730_1 = "setSlice" nocase fullword
$cve20063730_2 = "WebViewFolderIcon.WebViewFolderIcon.1" nocase fullword
condition:
1 of them
}
rule ActiveXDataObjectsMDAC
{
meta:
impact = 0
strings:
$cve20060003_1 = "MSXML2.ServerXMLHTTP" nocase fullword
$cve20060003_2 = "Microsoft.XMLHTTP" nocase fullword
condition:
1 of them
}
rule AOLSuperBuddyActiveX
{
meta:
ref = "CVE-2006-5820"
impact = 7
strings:
$cve20065820 = "Sb.SuperBuddy.1" nocase fullword
condition:
1 of them
}
rule Alert
{
strings:
$alert = /\/\/alert CVE-.+/
condition:
1 of them
}
rule Warning
{
meta:
impact = 5
strings:
$alert = /\/\/warning CVE-.+/
condition:
1 of them
}
rule DecodedMsg
{
meta:
impact = 0
strings:
$activex = /\/\/info\.ActiveXObject (.*)/
$shellcode = /\/\/shellcode len .{150,}/ //150 is %u1234 (6 characters) X (25)
//jsunpack\..*
condition:
1 of them
}
rule DecodedIframe: decodedOnly
{
meta:
impact = 0
hide = true
strings:
$iframe = "<iframe" nocase fullword
//possible in the future, if alerts are too common:
//style\s*=["'\s\\]*([a-z0-9:\s]+;\s*)?(display\s*:\s*none|visibility\s*:\s*hidden)
//(width|height)\s*=["'\s\\]*[01]["'\s\\>]
//style=['"]display:none['"]>\s*<iframe
//src\s*=\s*['"\s\\]*(&#\d+){10}
//advertisers use DecodedIframe all the time
//maybe domain name whitelisting?
condition:
1 of them
}
/*
rule ObfuscationPattern
{
meta:
impact = 0
strings:
$eval = "eval" nocase fullword
$charcode = "String.fromCharCode" nocase fullword
$loc = "location" nocase fullword
$deanEdwards = "function(p,a,c,k,e,d)" nocase
condition:
2 of them
}*/
rule SuspicousBodyOnload
{
meta:
impact = 6
hide = true
strings:
$body = /<body [^>]*onload\s*=\s*['"]*[a-z0-9]+\(['"][a-f0-9]{300}/
condition:
1 of them
}
rule MSIENestedSpan
{
meta:
ref = "CVE-2008-4844"
impact = 8
hide = true
strings:
$cve20084844_1 = "<span datasrc=" nocase
$cve20084844_2 = "CDATA[<image SRC=http://&#" nocase
$cve20084844_3 = "dataformatas=" nocase
$cve20084844_4 = "datasrc=" nocase
$cve20084844_5 = "datafld=" nocase
condition:
all of them
}
/*
rule ShellcodePattern
{
meta:
impact = 1 //while testing
hide = true
strings:
$unescape = "unescape" fullword nocase
$shellcode = /%u[A-Fa-f0-9]{4}/
$shellcode5 = /(%u[A-Fa-f0-9]{4}){5}/
condition:
($unescape and $shellcode) or $shellcode5
}
*/
rule MSIEUseAfterFreePeersDll
{
meta:
ref = "CVE-2010-0806"
hide = true
impact = 5
strings:
$cve20100806_1 = "createElement" nocase fullword
$cve20100806_2 = "onclick" nocase fullword
$cve20100806_3 = "setAttribute" nocase fullword
$cve20100806_4 = "window.status" nocase fullword
$cve20100806_5 = /getElementById[^<>;]+\.onclick/ nocase
condition:
all of them
}