forked from DFIR-ORC/dfir-orc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguring_ntfs_opt.html
606 lines (585 loc) · 37.3 KB
/
configuring_ntfs_opt.html
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Configuring Attributes of ntfs_find and ntfs_exclude Elements — DFIR ORC documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/solar.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Configuring Console Output, Logging" href="configuring_console_output.html" />
<link rel="prev" title="Configuring the Yara Scanner" href="configuring_yara.html" /><link href='http://fonts.googleapis.com/css?family=Source+Code+Pro|Open+Sans:300italic,400italic,700italic,400,300,700' rel='stylesheet' type='text/css'>
<link href="_static/solarized-dark.css" rel="stylesheet">
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" >
<a href="configuring_console_output.html" title="Configuring Console Output, Logging"
accesskey="N">next</a>
<li class="right" >
<a href="configuring_yara.html" title="Configuring the Yara Scanner"
accesskey="P">previous</a>
|</li>
<li class="nav-item nav-item-0"><a href="index.html">DFIR ORC documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="embedded_tool_suite.html" >Embedded Tool Suite</a> »</li>
<li class="nav-item nav-item-2"><a href="info_tools.html" accesskey="U">Common Options & Properties</a> »</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo.jpg" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="tuto.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="platforms.html">Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro_to_data_collection.html">Design and Architecture</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="embedded_tool_suite.html">Embedded Tool Suite</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="info_tools.html">Common Options & Properties</a></li>
<li class="toctree-l2"><a class="reference internal" href="FatInfo.html">FatInfo</a></li>
<li class="toctree-l2"><a class="reference internal" href="FastFind.html">FastFind</a></li>
<li class="toctree-l2"><a class="reference internal" href="GetThis.html">GetThis</a></li>
<li class="toctree-l2"><a class="reference internal" href="GetSamples.html">GetSamples</a></li>
<li class="toctree-l2"><a class="reference internal" href="GetSectors.html">GetSectors</a></li>
<li class="toctree-l2"><a class="reference internal" href="NTFSInfo.html">NTFSInfo</a></li>
<li class="toctree-l2"><a class="reference internal" href="NTFSUtil.html">NTFSUtil</a></li>
<li class="toctree-l2"><a class="reference internal" href="ObjInfo.html">ObjInfo</a></li>
<li class="toctree-l2"><a class="reference internal" href="RegInfo.html">RegInfo</a></li>
<li class="toctree-l2"><a class="reference internal" href="USNInfo.html">USNInfo</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="licenses.html">Licenses</a></li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="configuring-attributes-of-ntfs-find-and-ntfs-exclude-elements">
<h1>Configuring Attributes of <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> and <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> Elements<a class="headerlink" href="#configuring-attributes-of-ntfs-find-and-ntfs-exclude-elements" title="Permalink to this headline">¶</a></h1>
<div class="section" id="search-algorithm-and-result-of-a-search">
<h2>Search Algorithm and Result of a Search<a class="headerlink" href="#search-algorithm-and-result-of-a-search" title="Permalink to this headline">¶</a></h2>
<p>FastFind, RegInfo and GetThis can select NTFS file system entries based on multiple indicators to allow the precise definition of wanted items. Those indicators are specified by using two elements:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> to search for an indicator,</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> to reject a match.</p></li>
</ul>
<p>The search is conducted as follows. Each <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> element yields a (possibly combined) search clause, and the global search is conducted for records matching at least one clause.
Then, amongst matching records, those verifying any of the exclusion clauses yield by <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements are eliminated.</p>
<p>When using several <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> elements, a match is found if the artefact matches one of the elements. For instance</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">name=</span><span class="s">"qfe.dat"</span> <span class="nt">/></span>
<span class="nt"><ntfs_find</span> <span class="na">size=</span><span class="s">"104857600"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>indicates files should either be named “qfe.dat” <strong>OR</strong> their size should be 104857600 bytes to trigger a detection.</p>
<p>When using several <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements, a match is discarded if the artefact matches one of the elements. For instance</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_exclude</span> <span class="na">name=</span><span class="s">"qfe.dat"</span> <span class="nt">/></span>
<span class="nt"><ntfs_exclude</span> <span class="na">size=</span><span class="s">"104857600"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>indicates files are rejected if they are either named “qfe.dat” <strong>OR</strong> their size is 104857600 bytes.</p>
<p>Within an element <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> or <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code>, attributes of different classes can be combined to specify an “AND” condition. This combined condition is evaluated on MFT records.
For instance</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">name=</span><span class="s">"qfe.dat"</span> <span class="na">size=</span><span class="s">"104857600"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>indicates files should be named “qfe.dat” <strong>AND</strong> their size should be 104857600 bytes to trigger a detection. Furthermore</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_exclude</span> <span class="na">name=</span><span class="s">"qfe.dat"</span> <span class="na">size=</span><span class="s">"104857600"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>indicates files are rejected if they are named “qfe.dat” <strong>AND</strong> their size is 104857600 bytes.</p>
<p>For every record matching a clause, each NTFS attribute involved in a match is registered. Indeed, conditions can be imposed on various types of record features, such as <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> streams and extended attributes.
For instance, if a match is on an ADS name, only the <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> corresponding to this ADS is registered and not the other record attributes.</p>
<p>The search eventually results in the set of registered NTFS artefacts which are not eliminated by any <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> element.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The search algorithm defined above does not depend on the place of the <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> and <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements within an XML file; in particular, a <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> element <strong>does impact</strong> all artefacts to be collected by an XML configuration file, independently of its position with respect to other elements. Therefore, an <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> element should alwys be placed at the utmost level to emphasize their scope. Typically, in GetThis, <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements should be placed under the <code class="docutils literal notranslate"><span class="pre"><samples></span></code> element.</p>
</div>
<p>How the resulting set of NTFS artefacts is used depends on the tool using <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> and <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code>.
In general, only the NTFS attributes used for a record match are reported/collected. The only exception is that the resulting set must have at least a name and data. If a name is missing, the tool will use the first <code class="docutils literal notranslate"><span class="pre">$FILE_NAME</span></code> attribute. If a data is missing, the default (unnamed) <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> is used.
For instance, for GetThis, if the only condition used is on the file name, the resulting set will have a name but no data so the tool will also retrieve the default <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> (the file contents). This is detailed below.</p>
</div>
<div class="section" id="possible-attributes-of-a-ntfs-find-element">
<h2>Possible Attributes of a <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> Element<a class="headerlink" href="#possible-attributes-of-a-ntfs-find-element" title="Permalink to this headline">¶</a></h2>
<p>The list below enumerates the attributes that can be used to describe search indicators. The conditions are tested against MFT records. When an NTFS artefact matches a condition, it is registered. The whole MFT record has to match all conditions expressed in the scope of one element.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><code class="docutils literal notranslate"><span class="pre">*_regex</span></code> elements should use the ECMA-script syntax.</p>
</div>
<p>The conditions listed below are matched against each <code class="docutils literal notranslate"><span class="pre">$FILE_NAME</span></code> attribute.
The artefact registered is the <code class="docutils literal notranslate"><span class="pre">$FILE_NAME</span></code> attribute matching the condition.</p>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">name</span></code></dt><dd><p>The file name coincides with the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">name</span><span class="o">=</span><span class="s2">"qfe.dat"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">name_match</span></code></dt><dd><p>The file name matches the supplied expression.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">name_match</span><span class="o">=</span><span class="s2">"q*.dat"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">name_regex</span></code></dt><dd><p>The file name matches the regular expression.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">name_regex</span><span class="o">=</span><span class="s2">"q.*\.dat"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">path</span></code></dt><dd><p>The full path of the file coincides with the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">path</span><span class="o">=</span><span class="s2">"\Windows\System32\drivers\mgr.sys"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">path_match</span></code></dt><dd><p>The full path of the file matches the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">path_match</span><span class="o">=</span><span class="s2">"\Windows\System32\*\mgr.s?s"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">path_regex</span></code></dt><dd><p>The full path of the file matches the regular expression.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">path_regex</span><span class="o">=</span><span class="s2">"</span><span class="se">\\</span><span class="s2">Windows</span><span class="se">\\</span><span class="s2">System32</span><span class="se">\\</span><span class="s2">.*</span><span class="se">\\</span><span class="s2">mgr\.s.s"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ul>
<p>The conditions listed below are matched against each <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> attribute.
The artefact registered is the <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> attribute matching the condition.</p>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">size</span></code></dt><dd><p>The size of the file equals the supplied integer.
Multipliers can be used:</p>
<ul class="simple">
<li><p>1K for 1024 bytes,</p></li>
<li><p>1M for 1024 kilobytes,</p></li>
<li><p>1G for 1024 megabytes.</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">size</span><span class="o">=</span><span class="s2">"5M"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">size_gt</span></code></dt><dd><p>The size of the file is greater than the supplied integer.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">size_gt</span><span class="o">=</span><span class="s2">"5M"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">size_ge</span></code></dt><dd><p>The size of the file is greater than or equal to the supplied integer.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">size_ge</span><span class="o">=</span><span class="s2">"5M"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">size_lt</span></code></dt><dd><p>The size of the file is less than the supplied integer.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">size_lt</span><span class="o">=</span><span class="s2">"5M"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">size_le</span></code></dt><dd><p>The size of the file is less than or equal to the supplied integer.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">size_le</span><span class="o">=</span><span class="s2">"5M"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ads</span></code></dt><dd><p>The name of an ADS coincides with the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ads</span><span class="o">=</span><span class="s2">"MyAds"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ads_match</span></code></dt><dd><p>The file has an ADS which matches the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ads_match</span><span class="o">=</span><span class="s2">"My?ds"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ads_regex</span></code></dt><dd><p>The file has an ADS which matches the regular expression specified.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ads_regex</span><span class="o">=</span><span class="s2">"My.ds"</span>
<span class="n">ea_regex</span><span class="o">=</span><span class="s2">"My.A"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ul>
<p>The conditions listed below are matched against each <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> attribute actually stored data.
The artefact registered is the <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> attribute matching the condition.</p>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">md5</span></code></dt><dd><p>The MD5 hash of a data stream is the supplied value.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">md5</span><span class="o">=</span><span class="s2">"b092e1d683fc21cea137dba2a8b4b08b"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">sha1</span></code></dt><dd><p>The SHA1 hash of a data stream is the supplied value.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sha1</span><span class="o">=</span><span class="s2">"be0ccf54cdb3ec100de233b393d936d2ee1c33a3"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">sha256</span></code></dt><dd><p>The SHA256 hash of a data stream is the supplied value.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sha256</span><span class="o">=</span><span class="s2">"4cdb3ec100de233b393d936d2ee1c33a3..."</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">header</span></code></dt><dd><p>The header of a data stream coincides with the supplied string (ANSI encoding). Up to 128 bytes can be specified.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">header</span><span class="o">=</span><span class="s2">"MZ"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">header_hex</span></code></dt><dd><p>The header of a data stream coincides with the supplied bytes, written in hexadecimal.
“0x” prefix can be used and is optional. Up to 128 bytes can be specified.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">header_hex</span><span class="o">=</span><span class="s2">"ccf54cdb"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">header_regex</span></code></dt><dd><p>The header of a data stream matches the regular expression, against <code class="docutils literal notranslate"><span class="pre">header_length</span></code> bytes from the file.
The value has to be at least that of the minimal string matching the expression, or no hits
are found. For example, <code class="docutils literal notranslate"><span class="pre">header_regex="MZ"</span> <span class="pre">header_len="1"</span></code> does not match any file.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">header_regex</span><span class="o">=</span><span class="s2">"M[X-Y]"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">header_length</span></code></dt><dd><p>This attribute has to be used along <code class="docutils literal notranslate"><span class="pre">header_regex</span></code>.
It specifies the length of the header to read to make the comparison (in bytes).</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">header_length</span><span class="o">=</span><span class="s2">"1024"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">contains</span></code></dt><dd><p>A data stream contains the specified string (written in ASCII and case-sensitive).</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">contains</span><span class="o">=</span><span class="s2">"Hello World"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">contains_hex</span></code></dt><dd><p>A data stream contains a specific binary array.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">contains_hex</span><span class="o">=</span><span class="s2">"0x0BADF00DBAADF000D"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">yara_rule</span></code></dt><dd><p>A data stream verifies one rule amongst a comma or semicolon separated list of yara rules.
The rule specification may use “*” or “?” to match arbitrary characters.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">yara_rule</span><span class="o">=</span><span class="s2">"is_dll;apt??_rat"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ul>
<p>The conditions listed below are matched against each attribute in the MFT record.
The artefact registered is the attribute matching the condition.</p>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">attr_name</span></code></dt><dd><p>The name of an attribute coincides with the supplied string</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">attr_name</span><span class="o">=</span><span class="s2">"$I30"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">attr_match</span></code></dt><dd><p>Attribute name matches the supplied string</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">attr_match</span><span class="o">=</span><span class="s2">"?I30"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">attr_regex</span></code></dt><dd><p>Attribute name matches the regular expression</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">attr_regex</span><span class="o">=</span><span class="s2">".I30"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">attr_type</span></code></dt><dd><p>Attribute type is one of:</p>
<ul class="simple">
<li><p>$STANDARD_INFORMATION</p></li>
<li><p>$ATTRIBUTE_LIST</p></li>
<li><p>$FILE_NAME</p></li>
<li><p>$OBJECT_ID</p></li>
<li><p>$SECURITY_DESCRIPTOR</p></li>
<li><p>$VOLUME_NAME</p></li>
<li><p>$VOLUME_INFORMATION</p></li>
<li><p>$DATA</p></li>
<li><p>$INDEX_ROOT</p></li>
<li><p>$INDEX_ALLOCATION</p></li>
<li><p>$BITMAP</p></li>
<li><p>$REPARSE_POINT</p></li>
<li><p>$EA_INFORMATION</p></li>
<li><p>$EA</p></li>
<li><p>$LOGGED_UTILITY_STREAM</p></li>
<li><p>$FIRST_USER_DEFINED_ATTRIBUTE</p></li>
<li><p>$END</p></li>
<li><p>Or a custom integer value.</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">attr_type</span><span class="o">=</span><span class="s2">"$STANDARD_INFORMATION"</span>
<span class="n">attr_type</span><span class="o">=</span><span class="s2">"16"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ul>
<p>For the conditions listed below, the artefact registered is the content of any extended attribute (<code class="docutils literal notranslate"><span class="pre">$EA</span></code>) associated to the record - that is to say, pairs of names and values.</p>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ea</span></code></dt><dd><p>The name associated to a value in an extended attribute of the file coincides with the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ea</span><span class="o">=</span><span class="s2">"MyEA"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ea_match</span></code></dt><dd><p>The name associated to a value of an extended attribute of the file matches the supplied string.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ea_match</span><span class="o">=</span><span class="s2">"My?A"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">ea_regex</span></code></dt><dd><p>The name associated to a value of an extended attribute of the file matches the regular expression.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ea_regex</span><span class="o">=</span><span class="s2">"My.*"</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ul>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>At the end of the evaluation of a clause, when a record matches, the artefacts justifying the match have been registered. This artefact list can be completed with other elements:</p>
<ul class="simple">
<li><p>If there was no condition on the record name, there is no name amongst the artefacts registered. However, a name is needed to refer to the other artefacts registered (e.g. for GetThis). In this case, the name is chosen to be the first non-short file name listed in the record.</p></li>
<li><p>If there was no condition on data streams or attributes, namely, if only file names are constrained, there is no registered artefact with actual content. In this case, the default <code class="docutils literal notranslate"><span class="pre">$DATA</span></code> stream of the record is added to the list when it exists. This allows GetThis to collect it.</p></li>
</ul>
</div>
</div>
<div class="section" id="possible-attributes-of-a-ntfs-exclude-element">
<h2>Possible Attributes of a <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> Element<a class="headerlink" href="#possible-attributes-of-a-ntfs-exclude-element" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements can be used to exclude specific matches.
As explained in <a class="reference external" href="#search-algorithm-and-result-of-a-search">the first section of this page</a>,
when a record matches all attributes of an exclusion term, all NTFS artefacts related to this record are excluded from the matching set.</p>
<p>All ntfs_find attributes are supported by ntfs_exclude <strong>except</strong> extended attributes related ones (ea, ea_match, ea_regex).</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>As previously explained, the search algorithm defined above does not depend on the placement of the <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code> and <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> elements; in particular, an <code class="docutils literal notranslate"><span class="pre">ntfs_exclude</span></code> element <strong>does impact</strong> all artefacts to be collected, independently of its position with respect to other elements.</p>
</div>
</div>
<div class="section" id="order-of-evaluation-of-attributes-in-clauses">
<h2>Order of Evaluation of Attributes in Clauses<a class="headerlink" href="#order-of-evaluation-of-attributes-in-clauses" title="Permalink to this headline">¶</a></h2>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Attributes evaluation order is based on cost. For instance, size is a very cheap indicator to evaluate whereas hash value is very expensive. If both are present, the evaluator will first test file size and then (if size matches) will evaluate the file’s hash value. <strong>This means that coupling a size indicator to a hash one will dramatically enhance the performance of the search</strong>.</p>
</div>
<p>The evaluation order is as follows:</p>
<blockquote>
<div><ul>
<li><p>File Name:</p>
<blockquote>
<div><ul class="simple">
<li><p>name</p></li>
<li><p>name_match</p></li>
<li><p>name_regex</p></li>
</ul>
</div></blockquote>
</li>
<li><p>Path:</p>
<blockquote>
<div><ul class="simple">
<li><p>path</p></li>
<li><p>path_match</p></li>
<li><p>path_regex</p></li>
</ul>
</div></blockquote>
</li>
<li><p>$DATA name or size:</p>
<blockquote>
<div><ul class="simple">
<li><p>ads</p></li>
<li><p>ads_match</p></li>
<li><p>ads_regex</p></li>
<li><p>size</p></li>
<li><p>size_eq</p></li>
<li><p>size_gt</p></li>
<li><p>size_ge</p></li>
<li><p>size_lt</p></li>
<li><p>size_le</p></li>
</ul>
</div></blockquote>
</li>
<li><p>Verify if any of the record names are in the selected location (i.e. one of the specified directories in locations)</p></li>
<li><p>Attribute:</p>
<blockquote>
<div><ul class="simple">
<li><p>attr_type</p></li>
<li><p>attr_name</p></li>
<li><p>attr_match</p></li>
<li><p>attr_regex</p></li>
<li><p>ea</p></li>
<li><p>ea_match</p></li>
<li><p>ea_regex</p></li>
</ul>
</div></blockquote>
</li>
<li><p>$DATA content:</p>
<blockquote>
<div><ul class="simple">
<li><p>header</p></li>
<li><p>header_hex</p></li>
<li><p>header_regex & header_len</p></li>
<li><p>contains</p></li>
<li><p>contains_hex</p></li>
<li><p>MD5, SHA1, SHA256</p></li>
<li><p>yara_rule</p></li>
</ul>
</div></blockquote>
</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="typical-usage-examples">
<h2>Typical Usage Examples<a class="headerlink" href="#typical-usage-examples" title="Permalink to this headline">¶</a></h2>
<p>To specify the registry hives of the system, the element would be</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">path=</span><span class="s">"\Windows\System32\config\SOFTWARE"</span> <span class="na">header=</span><span class="s">"regf"</span><span class="nt">/></span>
<span class="nt"><nffs_find</span> <span class="na">path=</span><span class="s">"\Windows\System32\config\SYSTEM"</span> <span class="na">header=</span><span class="s">"regf"</span><span class="nt">/></span>
</pre></div>
</div>
<p>To search for all user registry hives, one can use</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">path_match=</span><span class="s">"\Users\*\NTUSER.DAT"</span><span class="nt">/></span>
<span class="nt"><ntfs_find</span> <span class="na">path_match=</span><span class="s">"\Documents and Settings\*\NTUSER.DAT"</span><span class="nt">/></span>
</pre></div>
</div>
<p>For instance, you could be interested in getting all fields named <code class="docutils literal notranslate"><span class="pre">explorer.exe</span></code> except the one located in <code class="docutils literal notranslate"><span class="pre">\Windows\explorer.exe</span></code>. This can be done as follows:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_exclude</span> <span class="na">path=</span><span class="s">"\Windows\explorer.exe"</span> <span class="nt">/></span>
<span class="nt"><ntfs_find</span> <span class="na">name=</span><span class="s">"explorer.exe"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>The following lines search for Windows catalogs, while excluding known ones:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">path_match=</span><span class="s">"\Windows\System32\catroot\*\*.cat"</span> <span class="nt">/></span>
<span class="nt"><ntfs_exclude</span> <span class="na">size=</span><span class="s">"138618"</span> <span class="na">md5=</span><span class="s">"d2182e5de2b13d2e68ee66d1bb44fe34"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>To search for a file name qfe.dat which has a data stream whose sha1 is 7894ec01651ff3fcdf9d117f416875bbaef03b6d, which has an extended attribute with a value named toto and whose size is not 104857600, one can write</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><ntfs_find</span> <span class="na">name=</span><span class="s">"qfe.dat"</span> <span class="na">ea=</span><span class="s">"toto"</span> <span class="na">sha1=</span><span class="s">"7894ec01651ff3fcdf9d117f416875bbaef03b6d"</span><span class="nt">/></span>
<span class="nt"><ntfs_exclude</span> <span class="na">size=</span><span class="s">"104857600"</span> <span class="nt">/></span>
</pre></div>
</div>
<p>For a record with the matching file name, the NTFS artefacts registered in this case are all the data streams matching the sha1, on top of the content of matching extended attributes. All of these artefacts are eliminated if the size associated with the record is “104857600”, and they are all treated by the tool using the configuration file otherwise.</p>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" >
<a href="configuring_console_output.html" title="Configuring Console Output, Logging"
>next</a>
<li class="right" >
<a href="configuring_yara.html" title="Configuring the Yara Scanner"
>previous</a>
|</li>
<li class="nav-item nav-item-0"><a href="index.html">DFIR ORC documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="embedded_tool_suite.html" >Embedded Tool Suite</a> »</li>
<li class="nav-item nav-item-2"><a href="info_tools.html" >Common Options & Properties</a> »</li>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").toggle(400);
$(this).parent().children(".header").toggleClass("open");
})
});
</script>
</body>
</html>