-
Notifications
You must be signed in to change notification settings - Fork 132
/
hashdeep.html
329 lines (299 loc) · 12.3 KB
/
hashdeep.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
<!-- manual page source format generated by PolyglotMan v3.2, -->
<!-- available at http://polyglotman.sourceforge.net/ -->
<html>
<head>
<title>hashdeep man page</title>
</head>
<body bgcolor='white'>
<a href='#toc'>Table of Contents</a><p>
<p>
<h2><a name='sect0' href='#toc0'>Name</a></h2>
hashdeep - Compute, compare, or audit multiple message digests
<p>
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
<b>hashdeep
</b> -V | -h <br>
<b>hashdeep</b> [-c <alg1>[,<alg2>]] [-k <file>] [-i <size>] [-f <file>] [-o <fbcplsde>] [-amxwMXrespblvv]
[-F<bum>] [-j <num>] [<b>FILES</b>]
<p>
<p>
<h2><a name='sect2' href='#toc2'>Description</a></h2>
<p>
Computes multiple hashes, or message
digests, for any number of files while optionally recursively digging
through the directory structure. By default the program computes MD5 and
SHA-256 hashes, equivalent to -c md5,sha256. Can also take a list of known
hashes and display the filenames of input files whose hashes either do
or do not match any of the known hashes. Can also use a list of known hashes
to audit a set of FILES. Errors are reported to standard error. If no FILES
are specified, reads from standard input.
<p>
<p>
<p>
<dl>
<dt><b>-c <alg1>[,<alg2>...]</b> </dt>
<dd>Computation mode.
Compute hashes of FILES using the algorithms specified. Legal values are
md5, sha1, sha256, tiger, and whirlpool.
<p>
<p> </dd>
<dt><b>-k </b> </dt>
<dd>Load a file of known hashes.
This flag is required when using any of the matching or audit modes (i.e.
-m, -x, -M, -X, or -a) This flag may be used more than once to add multiple
sets of known hashes.
<p> Loading sets with different hash algorithms can
sometimes generate spurrious hash collisions. For example, let’s say we have
two hash sets, A and B, which have some overlapping files. For example,
the file /usr/bin/bad is in both sets. In A we’ve recorded the MD5 and SHA-256.
In B we’ve recorded the MD5, SHA-1, and SHA-256. Because these two records
are different, they will both be loaded. When the program computes all
three hashes and compares them to the set of knowns, we will get an exact
match from the record in B and a collision from the record in A.
<p>
<p> </dd>
<dt><b>-a </b>
</dt>
<dd>Audit mode. Each input file is compared against the set of knowns. An audit
is said to pass if each input file is matched against exactly one file
in set of knowns. Any collisions, new files, or missing files will make
the audit fail. Using this flag alone produces a message, either "Audit
passed" or "Audit Failed". Use the verbose modes, -v, for more details. Using
-v prints the number of files in each category. Using -v a second time prints
any discrepancies. Using -v a third time prints the results for every file
examined and every known file. <br>
Due to limitations in the program, any filenames with Unicode characters
will appear to have moved during an audit. See the section "UNICODE SUPPORT"
below.
<p> </dd>
<dt><b>-m </b> </dt>
<dd>Positive matching, requires at least one use of the -k flag. The
input files are examined one at a time, and only those files that match
the list of known hashes are output. The only acceptable format for known
hashes is the output of previous hashdeep runs. <br>
<b></b> If standard input is used with the -m flag, displays "stdin" if the input
matches one of the hashes in the list of known hashes. If the hash does
not match, the program displays no output. <br>
<b></b> This flag may not be used in conjunction with the -x, -X, or -a flags. See
the section "UNICODE SUPPORT" below.
<p> </dd>
<dt><b>-x </b> </dt>
<dd>Negative matching. Same as the -m
flag above, but does negative matching. That is, only those files NOT in
the list of known hashes are displayed. <br>
<b></b> This flag may not be used in conjunction with the -m, -M, or -a flags. See
the section "UNICODE SUPPORT" below.
<p> </dd>
<dt><b>-f</b> <file> </dt>
<dd>Takes a list of files to be
hashed from the specified file. Each line is assumed to be a filename. This
flag can only be used once per invocation. If it’s used a second time, the
second instance will clobber the first. <br>
Note that you can still use other flags, such as the -m or -x modes, and
submit additional FILES on the command line.
<p> </dd>
<dt><b>-w </b> </dt>
<dd>When used with positive
matching modes (-m,-M) displays the filename of the known hash that matched
the input file. See the section "UNICODE SUPPORT" below.
<p> </dd>
<dt><b>-M</b> and <b>-X</b> </dt>
<dd>Same as
-m and -x above, but displays the hash for each file that does (or does
not) match the list of known hashes.
<p>
<p> </dd>
<dt><b>-r</b> </dt>
<dd>Enables recursive mode. All subdirectories
are traversed. Please note that recursive mode cannot be used to examine
all files of a given file extension. For example, calling hashdeep -r *.txt
will examine all files in <i>directories</i> that end in .txt.
<p>
<p> </dd>
<dt><b>-e</b> </dt>
<dd>Displays a progress
indicator and estimate of time remaining for each file being processed.
Time estimates for files larger than 4GB are not available on Windows. This
mode may not be used with th -p mode.
<p>
<p> </dd>
<dt><b>-i <size> </b> </dt>
<dd>Size threshold mode. Only
hash files smaller than the given the threshold. Sizes may be specified
using IEC multipliers b,k,m,g,t,p, and e.
<p>
<p> </dd>
<dt><b>-o</b> <bcpflsd> </dt>
<dd>Enables expert mode.
Allows the user specify which (and only which) types of files are processed.
Directory processing is still controlled with the -r flag. The expert mode
options allowed are: <br>
f - Regular files <br>
b - Block Devices <br>
c - Character Devices <br>
p - Named Pipes <br>
l - Symbolic Links <br>
s - Sockets <br>
d - Solaris Doors <br>
e - Windows PE executables
<p>
<p> </dd>
<dt><b>-s</b> </dt>
<dd>Enables silent mode. All error messages are
supressed.
<p>
<p> </dd>
<dt><b>-p</b> </dt>
<dd>Piecewise mode. Breaks files into chunks before hashing. Chunks
may be specified using IEC multipliers b,k,m,g,t,p, and e. (Never let it
be said that the author didn’t plan ahead.)
<p>
<p> </dd>
<dt><b>-b</b> </dt>
<dd>Enables bare mode. Strips
any leading directory information from displayed filenames. This flag may
not be used in conjunction with the -l flag.
<p> </dd>
<dt><b>-l</b> </dt>
<dd>Enables relative file paths.
Instead of printing the absolute path for each file, displays the relative
file path as indicated on the command line. This flag may not be used in
conjunction with the -b flag.
<p> </dd>
<dt><b>-v</b> </dt>
<dd>Enables verbose mode. Use again to make the
program more verbose. This mostly changes the behvaior of the audit mode,
-a.
<p> </dd>
<dt><b>-jnn</b> </dt>
<dd>Controls multi-threading. By default the program will create one producer
thread to scan the file system and one hashing thread per CPU core. Multi-threading
causes output filenames to be in non-deterministic order, as files that
take longer to hash will be delayed while they are hashed. If a deterministic
order is required, specify <b>-j0</b> to disable multi-threading
<p> </dd>
<dt><b>-d</b> </dt>
<dd>Output in Digital
Forensics XML (DFXML) format.
<p> </dd>
<dt><b>-u</b> </dt>
<dd>Quote Unicode output. For example, the snowman
is shown as <b>U+C426</b>.
<p> </dd>
<dt><b>-F<bum></b> </dt>
<dd>Specifies the input mode that is used to read
files. The default is <b>-Fb</b> (buffered I/O) which reads files with fopen(). Specifying
<b>-Fu</b> will use unbuffered I/O and read the file with open(). Specifying <b>-Fm</b>
will use memory-mapped I/O which will be faster on some platforms, but which
(currently) will not work with files that produce I/O errors.
<p>
<p>
<p> </dd>
<dt><b>-h</b> </dt>
<dd>Show
a help screen and exit.
<p> </dd>
<dt><b>-V</b> </dt>
<dd>Show the version number and exit.
<p>
<p>
<p> </dd>
</dl>
<h2><a name='sect3' href='#toc3'>Unicode Support</a></h2>
As
of version 3.0 the program supports Unicode characters in filenames on Microsoft
Windows systems for filenames specified on the command line with globbing
(e.g. *), for files specified with the <b>-f</b> of files to hash, and for files
read from directories using the <b>-r</b> option.
<p> By default all program input
and output should be in UTF-8. The program automatically converts this to
UTF-16 for opening files).
<p> On Unix/Linux/MacOS, you should use a terminal
emulator that supports UTF-8 and UTF-8 characters in filenames will be properly
displayed.
<p> On Windows, please note that the onsole is not capiable of displaying
Unicode characters. You must either redirect output to a file and open the
file with Wordpad (which can display Unicode), or you must specify the
<b>-u</b> option to quote Unicode using standard <b>U+XXXX</b> notation.
<p> Currently the
file name of a file containing known hashes may not be specified as a unicode
filename, but you can specify the name using tab completition or an asterisk
(e.g. md5deep -m *.txt where there is only one file with a .txt extension).
<p>
<h2><a name='sect4' href='#toc4'>Return Value</a></h2>
Returns zero on success, one on error.
<p>
<h2><a name='sect5' href='#toc5'>Author</a></h2>
hashdeep was
written by Jesse Kornblum, [email protected], and Simson Garfinkel.
<p>
<h2><a name='sect6' href='#toc6'>Known Issues</a></h2>
Using the -r flag cannot be used to recursively process all
files of a given extension in a directory. This is a feature, not a bug.
If you need to do this, use the <a href='find.1'><b>find</b>(1)</a>
command.
<p> The program will fail
if you attempt to compare 2^64 or more input files against a set of known
files.
<p>
<p>
<h2><a name='sect7' href='#toc7'>Reporting Bugs</a></h2>
We take all bug reports <i>very</i> seriously. Any bug that
jeopardizes the forensic integrity of this program could have serious consequences
on people’s lives. When submitting a bug report, please include a description
of the problem, how you found it, and your contact information. <p>
Send bug
reports to the author at the address above.
<p> <p>
<h2><a name='sect8' href='#toc8'>Copyright</a></h2>
This program is a
work of the US Government. In accordance with 17 USC 105, copyright protection
is not available for any work of the US Government. This program is PUBLIC
DOMAIN. Portions of this program contain code that is licensed under the
terms of the General Public License (GPL). Those portions retain their original
copyright and license. See the file COPYING for more details. <p>
There is NO
warranty for this program; not even for MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
<p>
<h2><a name='sect9' href='#toc9'>See Also</a></h2>
More information and installation instructions
can be found in the README file. Current versions of both documents can
be found on the project homepage: <a href='http://md5deep.sourceforge.net/'>http://md5deep.sourceforge.net/</a>
<p>
The MD5
specification, RFC 1321, is available at <br>
<a href='http://www.ietf.org/rfc/rfc1321.txt'>http://www.ietf.org/rfc/rfc1321.txt</a>
<p>
The SHA-1 specification, RFC 3174, is available
at <br>
<a href='http://www.faqs.org/rfcs/rfc3174.html'>http://www.faqs.org/rfcs/rfc3174.html</a>
<p>
The SHA-256 specification, FIPS 180-2,
is available at <br>
<a href='http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf'>http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf</a>
<p>
The Tiger specification
is available at <br>
<a href='http://www.cs.technion.ac.il/~biham/Reports/Tiger/'>http://www.cs.technion.ac.il/~biham/Reports/Tiger/</a>
<p>
The Whirlpool specification
is available at <br>
<a href='http://planeta.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html'>http://planeta.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html</a>
<p>
<hr><p>
<a name='toc'><b>Table of Contents</b></a><p>
<ul>
<li><a name='toc0' href='#sect0'>Name</a></li>
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
<li><a name='toc2' href='#sect2'>Description</a></li>
<li><a name='toc3' href='#sect3'>Unicode Support</a></li>
<li><a name='toc4' href='#sect4'>Return Value</a></li>
<li><a name='toc5' href='#sect5'>Author</a></li>
<li><a name='toc6' href='#sect6'>Known Issues</a></li>
<li><a name='toc7' href='#sect7'>Reporting Bugs</a></li>
<li><a name='toc8' href='#sect8'>Copyright</a></li>
<li><a name='toc9' href='#sect9'>See Also</a></li>
</ul>
</body>
</html>