-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRegInfo.html
450 lines (418 loc) · 30.2 KB
/
RegInfo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>RegInfo — DFIR ORC documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/solar.css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="USNInfo" href="USNInfo.html" />
<link rel="prev" title="ObjInfo" href="ObjInfo.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="USNInfo.html" title="USNInfo"
accesskey="N">next</a>
<li class="right" >
<a href="ObjInfo.html" title="ObjInfo"
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" accesskey="U">Embedded Tool Suite</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"><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 current"><a class="current reference internal" href="#">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">
<section id="reginfo">
<h1>RegInfo<a class="headerlink" href="#reginfo" title="Permalink to this heading">¶</a></h1>
<section id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this heading">¶</a></h2>
<p>RegInfo is a registry parser which can analyze either online or offline registry files.</p>
<p>Online analysis uses the MFT parser and therefore allows enumeration of registry hives without the need to either rely on APIs or be able to open the registry hive file itself.
This allows the collection of registry related information by simply opening the volume (or physical drive, dd image, VSS snapshot).</p>
<p>This analysis works in two steps: file system parsing and hive parsing.</p>
<p>For file system parsing, RegInfo is based on the same parser capabilities as <a class="reference internal" href="GetThis.html"><span class="doc">GetThis</span></a> and <a class="reference internal" href="FastFind.html"><span class="doc">FastFind</span></a>.
That gives the tool unique capabilities to evade hiding techniques such as API hooking techniques, registry permissions, and sharing or permission issues.</p>
<p>The parsing of hive files is then accomplished by a parser which only rely on the C++ standard API.
This allows independence from third party library, permits cross platform and precise control of the output of the tool.</p>
<p>Offline analysis only uses this second step (hive parsing) to inspect registry hives retrieved by other tools (e.g. GetThis).</p>
</section>
<section id="output">
<h2>Output<a class="headerlink" href="#output" title="Permalink to this heading">¶</a></h2>
<p>RegInfo produces 2 kinds of files:</p>
<ul class="simple">
<li><p>one or more CSV file which contains the result of the different searches (one file for each hive),</p></li>
<li><p>a variable number of .ddmp files which contain data for values, whose size exceeds a certain threshold (512 bytes).</p></li>
</ul>
<p>Each CSV file can contain the following registry related information:</p>
<table class="docutils align-left">
<thead>
<tr class="row-odd"><th class="head"><p>ColumnName</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>ComputerName</p></td>
<td><p>Computer name</p></td>
</tr>
<tr class="row-odd"><td><p>TemplateName</p></td>
<td><p>Name of the template associated with the query if any</p></td>
</tr>
<tr class="row-even"><td><p>SearchTerm</p></td>
<td><p>Criteria used to match result</p></td>
</tr>
<tr class="row-odd"><td><p>LastModificationDate</p></td>
<td><p>Last modification date of the registry key</p></td>
</tr>
<tr class="row-even"><td><p>KeyName</p></td>
<td><p>Key name</p></td>
</tr>
<tr class="row-odd"><td><p>KeyTree</p></td>
<td><p>Key path</p></td>
</tr>
<tr class="row-even"><td><p>ValueName</p></td>
<td><p>Value name</p></td>
</tr>
<tr class="row-odd"><td><p>ValueType</p></td>
<td><p>Value type</p></td>
</tr>
<tr class="row-even"><td><p>ValueSize</p></td>
<td><p>Size of value</p></td>
</tr>
<tr class="row-odd"><td><p>ValueFlag</p></td>
<td><p>Flag of value (explained below)</p></td>
</tr>
<tr class="row-even"><td><p>ValueData</p></td>
<td><p>Value data when possible</p></td>
</tr>
<tr class="row-odd"><td><p>ValueDumpFile</p></td>
<td><p>File where the data was dumped</p></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The ValueData field contains only the first 512 bytes of the actual data. If the data size exceed this limit, a .ddmp file which contains the entire data is dumped alongside the CSV file.</p>
</div>
<p>Most of the CSV output file columns are self explanatory but some of them need to be detailed.</p>
<ul class="simple">
<li><p>SearchTerm: This column represent the type of query that matched the current result. The value displayed is the combination of values associated with <code class="docutils literal notranslate"><span class="pre">registry_find</span></code> element attributes.</p></li>
<li><dl class="simple">
<dt>ValueFlag: This column can take four different values:</dt><dd><ul>
<li><p>VALUE_PRESENT: the data associated with the value is present in the CSV file in the ValueData column.</p></li>
<li><p>VALUE_NOTINHIVE: the data associated with the value has a size but is not present in the hive. This can happen if the registry was not flushed before dumping a hive.</p></li>
<li><p>VALUE_HASBADCHARS: the data associated with the value contains non-printable characters. The data is not written in the CSV file but in a separate file. The full path of this file is written in the ValueDumpFile column.</p></li>
<li><p>VALUE_DUMPFILE: the data associated with the value was too long to be written in the CSV file. It is instead written in a separate file. The full path of this file is written in the ValueDumpFile column.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>As for every tool, an output for logging is also available from the command line. The syntax can be found in <a class="reference internal" href="configuring_console_output.html"><span class="doc">Configuring Console Output</span></a>.</p>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading">¶</a></h2>
<p>When called from the command line, the syntax of RegInfo looks like the following:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>DFIR-Orc.exe RegInfo /config=reginfo_config.xml /out=reginfo_output.csv
</pre></div>
</div>
<section id="config-path-option">
<h3><code class="docutils literal notranslate"><span class="pre">/config=<Path></span></code> Option<a class="headerlink" href="#config-path-option" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>Takes an XML configuration file as argument.</p>
<p>RegInfo is intended to be used with an XML configuration file.
A typical RegInfo configuration file looks like:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><reginfo></span>
<span class="w"> </span><span class="nt"><output</span><span class="w"> </span><span class="na">encoding=</span><span class="s">"UTF16"</span><span class="nt">></span>d:\test<span class="nt"></output></span>
<span class="w"> </span><span class="cm"><!-- Fields to be included inside the result file --></span>
<span class="w"> </span><span class="nt"><information></span>ComputerName,TemplateName,SearchTerm,LastModificationDate,KeyName,KeyTree,ValueName,ValueType,ValueData<span class="nt"></information></span>
<span class="w"> </span><span class="cm"><!-- Locations to be parsed (MFT parser) --></span>
<span class="w"> </span><span class="nt"><location></span>%SystemDrive%<span class="nt"></location></span>
<span class="w"> </span><span class="nt"><location></span>c:\<span class="nt"></location></span>
<span class="w"> </span><span class="cm"><!-- A search query --></span>
<span class="w"> </span><span class="nt"><hive></span>
<span class="w"> </span><span class="cm"><!-- FileFind like criteria on hive --></span>
<span class="w"> </span><span class="nt"><ntfs_find</span><span class="w"> </span><span class="na">name=</span><span class="s">"SYSTEM"</span><span class="w"> </span><span class="nt">/></span>
<span class="w"> </span><span class="cm"><!-- Search query criteria --></span>
<span class="w"> </span><span class="nt"><registry_find</span><span class="w"> </span><span class="na">key_path_regex=</span><span class="s">"\\ControlSet001\\Services\\[^\\]*"</span><span class="w"> </span><span class="na">value_regex=</span><span class="s">".*"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"></hive></span>
<span class="w"> </span><span class="cm"><!-- Another search query --></span>
<span class="w"> </span><span class="nt"><hive></span>
<span class="w"> </span><span class="cm"><!-- Path to an offline hive --></span>
<span class="w"> </span><span class="nt"><filename></span>c:\temp\SOFTWARE<span class="nt"></filename></span>
<span class="w"> </span><span class="cm"><!-- Search query criterias --></span>
<span class="w"> </span><span class="nt"><registry_find</span><span class="w"> </span><span class="na">key=</span><span class="s">"CurrentVersion"</span><span class="w"> </span><span class="na">value=</span><span class="s">"CurrentMajorVersionNumber"</span><span class="w"> </span><span class="na">data_hex=</span><span class="s">"0000000a"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"></hive></span>
<span class="nt"></reginfo></span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Hive files can also be specified on command line for <em>offline</em> registry hives. Online hives (locked by NTFS) <strong>must</strong> be located via the MFT parser (i.e. <code class="docutils literal notranslate"><span class="pre">location</span></code> and <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code>).</p>
</div>
</section>
<section id="reginfo-element">
<h3><code class="docutils literal notranslate"><span class="pre">reginfo</span></code> Element<a class="headerlink" href="#reginfo-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>Root element.</p>
</section>
<section id="output-element-out-path-option">
<h3><code class="docutils literal notranslate"><span class="pre">output</span></code> Element, <code class="docutils literal notranslate"><span class="pre">/out=<Path></span></code> Option<a class="headerlink" href="#output-element-out-path-option" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>The value must be a directory (already existing or not), a CSV file or a TSV file in which the tool will generate the results.
This element can also be specified from the command line with the <code class="docutils literal notranslate"><span class="pre">/out</span></code> option. For details on the syntax, please refer to the <a class="reference internal" href="configuring_tool_output.html"><span class="doc">output documentation</span></a>.</p>
<p>Attribute <code class="docutils literal notranslate"><span class="pre">encoding</span></code> allows to specify output encoding. Possible values are <code class="docutils literal notranslate"><span class="pre">UTF8</span></code> or <code class="docutils literal notranslate"><span class="pre">UTF16</span></code> (case-insensitive). Encoding can also be specified with <code class="docutils literal notranslate"><span class="pre">/utf8</span></code> and <code class="docutils literal notranslate"><span class="pre">/utf16</span></code> options.</p>
</section>
<section id="information-element">
<h3><code class="docutils literal notranslate"><span class="pre">information</span></code> Element<a class="headerlink" href="#information-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>Selects the columns to fill in the CSV output.</p>
</section>
<section id="location-element">
<h3><code class="docutils literal notranslate"><span class="pre">location</span></code> Element<a class="headerlink" href="#location-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>When configuring to use the MFT parser, RegInfo can locate registry hives on a specific volume. For this purpose, one can use any syntax described in <a class="reference internal" href="configuring_locations.html"><span class="doc">Configuring Locations</span></a>.</p>
</section>
<section id="hive-element">
<h3><code class="docutils literal notranslate"><span class="pre">hive</span></code> Element<a class="headerlink" href="#hive-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>Encloses a query. One can configure different queries on different hives inside the same configuration file.</p>
<p>It is highly recommended to run RegInfo with a complete set of queries for better performance, especially when using the MFT parser.</p>
</section>
<section id="filename-element">
<h3><code class="docutils literal notranslate"><span class="pre">filename</span></code> Element<a class="headerlink" href="#filename-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=yes, default=N/A</em></p>
<p>Used to directly specify the full path of a registry hive. This must only be used with offline hives.</p>
</section>
<section id="template-element">
<h3><code class="docutils literal notranslate"><span class="pre">template</span></code> Element<a class="headerlink" href="#template-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=yes, default=N/A</em></p>
<p>In order to simplify both capitalization and usage, RegInfo provides a way to <code class="docutils literal notranslate"><span class="pre">template</span></code> search queries.
“Templated” queries are in the form of XML files and can be included in any <code class="docutils literal notranslate"><span class="pre">hive</span></code> tag via the <code class="docutils literal notranslate"><span class="pre">template</span></code> element.</p>
<p>This element has two attributes :</p>
<ul class="simple">
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">name</span></code> <em>(optional=no, default=N/A)</em>:</dt><dd><p>Name that identify the template (it is displayed in the CSV file.)</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">location</span></code> <em>(optional=no, default=”no”)</em>:</dt><dd><p>Path to the template file.</p>
</dd>
</dl>
</li>
</ul>
<p>A standard template file typically looks like :</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><reginfo_template></span>
<span class="w"> </span><span class="cm"><!-- Query terms --></span>
<span class="w"> </span><span class="nt"><registry_find</span><span class="w"> </span><span class="na">key=</span><span class="s">"Run"</span><span class="w"> </span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><registry_find</span><span class="w"> </span><span class="na">key=</span><span class="s">"RunOnce"</span><span class="w"> </span><span class="na">value_regex=</span><span class="s">".*"</span><span class="w"> </span><span class="nt">/></span>
<span class="nt"></reginfo_template></span>
</pre></div>
</div>
<p>The syntax used inside the element <code class="docutils literal notranslate"><span class="pre">registry_find</span></code> is the same as the one explained previously in <a class="reference internal" href="#reginfo-registryfind"><span class="std std-ref">registry related elements</span></a>.</p>
</section>
<section id="ntfs-find-or-ntfs-exclude-element">
<h3><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> Element<a class="headerlink" href="#ntfs-find-or-ntfs-exclude-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>Used to specify a set of rules which matches the hive in each previously specified location. For details on the <code class="docutils literal notranslate"><span class="pre"><ntfs_find></span></code> element syntax, please refer to the <a class="reference internal" href="configuring_ntfs_opt.html"><span class="doc">ntfs_find documentation</span></a>.</p>
</section>
<section id="registry-find-element">
<span id="reginfo-registryfind"></span><h3><code class="docutils literal notranslate"><span class="pre">registry_find</span></code> Element<a class="headerlink" href="#registry-find-element" title="Permalink to this heading">¶</a></h3>
<p><em>optional=no, default=N/A</em></p>
<p>The <code class="docutils literal notranslate"><span class="pre">registry_find</span></code> element is used to specify a rule on which to match a registry key, value or data.
There are different types of rules which can be combined (logical AND) to obtain the desired criteria.
Just like for <code class="docutils literal notranslate"><span class="pre">ntfs_find</span></code>, each rule is specified as an attribute of <code class="docutils literal notranslate"><span class="pre">registry_find</span></code>.</p>
<p>Here is a list and a short description of those attributes:</p>
<table class="docutils align-left">
<thead>
<tr class="row-odd"><th class="head"><p>Attribute name</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>key</p></td>
<td><p>Short name of the key (exact match)</p></td>
</tr>
<tr class="row-odd"><td><p>key_regex</p></td>
<td><p>Short name of the key (regular expression match)</p></td>
</tr>
<tr class="row-even"><td><p>key_path</p></td>
<td><p>Full tree key name (exact match)</p></td>
</tr>
<tr class="row-odd"><td><p>key_path_regex</p></td>
<td><p>Full tree key name (regular expression match)</p></td>
</tr>
<tr class="row-even"><td><p>value</p></td>
<td><p>Value name (exact match)</p></td>
</tr>
<tr class="row-odd"><td><p>value_regex</p></td>
<td><p>Value name (regular expression match)</p></td>
</tr>
<tr class="row-even"><td><p>value_type</p></td>
<td><p>Match on value type (see table below)</p></td>
</tr>
<tr class="row-odd"><td><p>data</p></td>
<td><p>Match on data content, attribute value is considered as a string (exact match)</p></td>
</tr>
<tr class="row-even"><td><p>data_hex</p></td>
<td><p>Match on data content, attribute value is a hexadecimal string either taken as is (to match DWORD or QWORD) or interpreted as binary data (exact match)</p></td>
</tr>
<tr class="row-odd"><td><p>data_regex</p></td>
<td><p>Match on data content, attribute value is considered as a string (regular expression match)</p></td>
</tr>
<tr class="row-even"><td><p>data_size</p></td>
<td><p>Match on data size (exact match)</p></td>
</tr>
<tr class="row-odd"><td><p>data_size_gt</p></td>
<td><p>Match if data size is greater than</p></td>
</tr>
<tr class="row-even"><td><p>data_size_ge</p></td>
<td><p>Match if data size is greater than or equal</p></td>
</tr>
<tr class="row-odd"><td><p>data_size_lt</p></td>
<td><p>Match if size is lower than</p></td>
</tr>
<tr class="row-even"><td><p>data_size_le</p></td>
<td><p>Match if size is lower than or equal</p></td>
</tr>
<tr class="row-odd"><td><p>data_contains</p></td>
<td><p>Match a pattern, attribute value is a string (case-sensitive)</p></td>
</tr>
<tr class="row-even"><td><p>data_contains_hex</p></td>
<td><p>Match a pattern, attribute value is a hexadecimal string interpreted as binary data (case-sensitive)</p></td>
</tr>
</tbody>
</table>
<p>The <code class="docutils literal notranslate"><span class="pre">value_type</span></code> attribute can only take one of the following values:</p>
<ul class="simple">
<li><p>REG_NONE</p></li>
<li><p>REG_SZ</p></li>
<li><p>REG_EXPAND_SZ</p></li>
<li><p>REG_BINARY</p></li>
<li><p>REG_DWORD</p></li>
<li><p>REG_DWORD_LITTLE_ENDIAN</p></li>
<li><p>REG_DWORD_BIG_ENDIAN</p></li>
<li><p>REG_LINK</p></li>
<li><p>REG_MULTI_SZ</p></li>
<li><p>REG_RESSOURCE_LIST</p></li>
<li><p>REG_FULL_RESSOURCE_DESCRIPTOR</p></li>
<li><p>REG_RESSOURCE_REQUIREMENTS_LIST</p></li>
<li><p>REG_QWORD</p></li>
<li><p>REG_QWORD_LITTLE_ENDIAN</p></li>
</ul>
<p>Matching method on data depends on the type of data:</p>
<ul class="simple">
<li><p>If registry data is of type <code class="docutils literal notranslate"><span class="pre">REG_SZ</span></code> or <code class="docutils literal notranslate"><span class="pre">REG_EXPAND_SZ</span></code> the input value in <code class="docutils literal notranslate"><span class="pre">data</span></code> or <code class="docutils literal notranslate"><span class="pre">data_regex</span></code> is transformed into a Unicode string. The same happen with <code class="docutils literal notranslate"><span class="pre">REG_MULTI_SZ</span></code>, but in this case, the input value is tested against each string of the multi sz.</p></li>
<li><p>The input for <code class="docutils literal notranslate"><span class="pre">data_hex</span></code> must be a valid hexadecimal string (no specific prefix is needed, yet one can still prefix the string with <code class="docutils literal notranslate"><span class="pre">0x</span></code>). The input is transformed into raw binary and compared to the content of the data in all cases, except for <code class="docutils literal notranslate"><span class="pre">REG_DWORD*</span></code> and <code class="docutils literal notranslate"><span class="pre">REG_QWORD</span></code>. In those cases, the input is transformed into a DWORD or a QWORD in the correct endianness and then compared.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">data_contains</span></code> is used to match against data of type <code class="docutils literal notranslate"><span class="pre">REG_SZ</span></code>, <code class="docutils literal notranslate"><span class="pre">REG_MULTI_SZ</span></code> or <code class="docutils literal notranslate"><span class="pre">REG_EXPAND_SZ</span></code>, the input is transformed into a Unicode string. In any other cases, it will be considered as ANSI string.</p></li>
<li><p>When <code class="docutils literal notranslate"><span class="pre">data_contains_hex</span></code> is used, the input is transformed into raw binary and directly compared to the data content despite its type. This implies that it cannot be used to match <code class="docutils literal notranslate"><span class="pre">REG_DWORD*</span></code> and <code class="docutils literal notranslate"><span class="pre">REG_QWORD</span></code>.</p></li>
<li><p>All string comparisons and regex matchings are case-insensitive except for pattern matching (<code class="docutils literal notranslate"><span class="pre">data_contains*</span></code>) which is case-sensitive.</p></li>
</ul>
<p>Some additional usage recommendations:</p>
<ul>
<li><p>Exact matches are always faster than regex matches. Exact matches should always be preferred when possible (even if less compact than regex matches).</p></li>
<li><p>Regex matches use ECMAScript syntax and all DOS-like pattern syntax is forbidden (thus <code class="docutils literal notranslate"><span class="pre">*</span></code> is invalid, <code class="docutils literal notranslate"><span class="pre">.*</span></code> should be used instead).</p></li>
<li><p>When searching for a fixed pattern to find inside a data, the usage of <code class="docutils literal notranslate"><span class="pre">data_contains</span></code> or <code class="docutils literal notranslate"><span class="pre">data_contains_hex</span></code> is to be preferred in place of <code class="docutils literal notranslate"><span class="pre">data_regex</span></code>. They are faster as they use BoyerMoore algorithm instead of regex matching.</p></li>
<li><p>Matching (regex or exact) only on key name/key path only returns the key name and its full path. To retrieve associated values and/or data, one should specify either a value or a data rule (one rule is sufficient to retrieve both the values and data). For instance:</p>
<blockquote>
<div><div class="highlight-bat notranslate"><div class="highlight"><pre><span></span><span class="p"><</span>registry_find key_path_regex=<span class="s2">"\\ControlSet001\\Services\\[^\\]*"</span> value_regex=<span class="s2">".*"</span>/>
</pre></div>
</div>
<p>This example retrieves every value and data under a direct subkey of <code class="docutils literal notranslate"><span class="pre">\\ControlSet001\\Services\\</span></code>.</p>
</div></blockquote>
</li>
</ul>
</section>
</section>
</section>
<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="USNInfo.html" title="USNInfo"
>next</a>
<li class="right" >
<a href="ObjInfo.html" title="ObjInfo"
>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>
</ul>
</div>
<div class="footer">
© Copyright 2019, ANSSI. The contents of this documentation is available under the Open License version 2.0 as published by Etalab (French task force for Open Data). The name DFIR ORC and the associated logo belong to ANSSI, no use is permitted without its express approval. Le contenu de cette documentation est disponible sous license Open License version 2.0 telle que publiée par Etalab (organisation francaise pour Open Data). Le nom DFIR ORC et le logo associé appartiennent à l'ANSSI, tout usage doit être expressément autorisé par l'ANSSI..
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 5.3.0.Theme is <a href="http://github.com/vimalkvn/solar-theme">Solar</a>
</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>