1
1
.\" Text automatically generated by txt2man
2
- .TH dcfldd 1 "30 Oct 2019" "dcfldd-1.5" "enhanced version of dd for forensics and security"
2
+ .TH dcfldd 1 "01 Nov 2019" "dcfldd-1.5" "enhanced version of dd for forensics and security"
3
3
.SH NAME
4
4
\fB dcfldd \fP - enhanced version of dd for forensics and security
5
5
\fB
@@ -39,6 +39,10 @@ natively.
39
39
.IP \(bu 3
40
40
When dd uses a default block size (bs, ibs, obs) of 512 bytes, \fB dcfldd \fP uses 32768 bytes (32 KiB)
41
41
which is HUGELY more efficient.
42
+ .IP \(bu 3
43
+ The following options are present in \fB dcfldd \fP but not in dd: ALGORITHMlog:, errlog, hash, hashconv,
44
+ hashformat, hashlog, hashlog:, hashwindow, limit, of:, pattern, sizeprobe, split, splitformat,
45
+ statusinterval, textpattern, totalhashformat, verifylog, verifylog:, vf.
42
46
.PP
43
47
\fB dcfldd \fP supports the following letters to specify amount of data: k for kilo, M for Mega, G for Giga,
44
48
T for Tera, P for Peta, E for Exa, Z for Zetta and Y for Yotta. E.g. 10M is equal to 10 MiB. See
@@ -47,8 +51,9 @@ the BLOCKS AND BYTES section to get other possibilities.
47
51
.TP
48
52
.B
49
53
bs=BYTES
50
- Force ibs=BYTES and obs=BYTES. Default value is 32768 (32KiB). (see BLOCKS AND BYTES
51
- section)
54
+ Force ibs=BYTES and obs=BYTES. Default value is 32768 (32KiB). See BLOCKS AND BYTES
55
+ section. Warning: the block size will be created in RAM. Make sure you have sufficient
56
+ amount of free memory.
52
57
.TP
53
58
.B
54
59
cbs=BYTES
@@ -97,30 +102,32 @@ Skip BLOCKS ibs-sized blocks at start of input. (see BLOCKS AND BYTES section)
97
102
.TP
98
103
.B
99
104
pattern=HEX
100
- Use the specified binary pattern as input.
105
+ Use the specified binary pattern as input. You can use a byte only.
101
106
.TP
102
107
.B
103
108
textpattern=TEXT
104
- Use repeating TEXT as input.
109
+ Use repeating TEXT as input. You can use a character only.
105
110
.TP
106
111
.B
107
112
errlog=FILE
108
113
Send error messages to FILE as well as stderr.
109
114
.TP
110
115
.B
111
- hashwindow=BYTES
112
- Perform a hash on every BYTES amount of data.
113
- .TP
114
- .B
115
116
hash=NAME
116
- Either md5, sha1, sha256, sha384 or sha512. Default algorithm is md5. To select multiple
117
- algorithms to run simultaneously enter the names in a comma separated list.
117
+ Do hash calculation in parallel with the disk reading. Either md5, sha1, sha256, sha384
118
+ or sha512 can be used. Default algorithm is md5. To select multiple algorithms to run
119
+ simultaneously enter the names in a comma separated list.
118
120
.TP
119
121
.B
120
122
hashlog=FILE
121
- Send MD5 hash output to FILE instead of stderr. If you are using multiple hash algorithms
122
- you can send each to a separate file using the convention ALGORITHMlog=FILE, for example
123
- md5log=FILE1, sha1log=FILE2, etc.
123
+ Send hash output to FILE instead of stderr. If you are using multiple hash
124
+ algorithms you can send each to a separate file using the convention ALGORITHMlog=FILE,
125
+ for example md5log=FILE1, sha1log=FILE2, etc.
126
+ .TP
127
+ .B
128
+ hashwindow=BYTES
129
+ Perform a hash on every BYTES amount of data. The partial results will be shown in
130
+ screen. The default hash is md5 but you can use hash= option to choose other.
124
131
.TP
125
132
.B
126
133
hashlog:=COMMAND
@@ -154,35 +161,38 @@ Update the status message every N blocks. Default value is 256.
154
161
.TP
155
162
.B
156
163
sizeprobe=[if|of|BYTES]
157
- Determine the size of the input or output file or an amount of BYTES for use with
158
- status messages. This option gives you a percentage indicator around the sizeprobe
159
- value. WARNING: do not use this option against a tape device. (see BLOCKS AND
160
- BYTES section)
164
+ Determine the size of the input or output file or an amount of BYTES for use
165
+ with status messages. This option gives you a percentage indicator around the
166
+ sizeprobe value. WARNING: do not use this option against a tape device. (see
167
+ BLOCKS AND BYTES section)
161
168
.TP
162
169
.B
163
170
split=BYTES
164
171
Write every BYTES amount of data to a new file. This operation applies to any
165
- of=FILE that follows. (see BLOCKS AND BYTES section)
172
+ of=FILE that follows (split= must be put before of=). (see BLOCKS AND BYTES
173
+ section)
166
174
.TP
167
175
.B
168
176
splitformat=[TEXT|MAC|WIN]
169
- The file extension format for split operation. You may use "a" for letters and "n"
170
- for numbers. If you use annn, an extension started as a000 will be appended; the
171
- last possible extension for this format will be z999. splitformat=an will provide
172
- a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2\.\.\. If nothing is specified the
173
- default format is "nnn". NOTE: the split and splitformat options take effect only
174
- for output files (option of=) specified AFTER these options appear in the command
175
- line (e.g. split=50M splitformat=annn of=/tmp/test.iso). Likewise, you may specify
176
- these several times for different output files within the same command line. You
177
- may use as many digits in any combination you would like. E.g. "anaannnaana"
178
- would be valid, but quite insane (see BLOCKS AND BYTES section). Other possible
179
- approach is MAC. If "MAC" is used, a suffix dmg and several dmgpart will be
180
- appended. In other words, it will generate a partial disk image file, used by
181
- the Mac OS X operating system. dmgpart files are usually provided with a
182
- corresponding dmg file, which is the master file for the split archive. If dmg
183
- is opened in Mac OS X, all dmgpart will be read too. The last option is WIN,
184
- which will automatically output file naming of foo.001, foo.002, \.\.\. , foo.999,
185
- foo.1000, \.\.\. .
177
+ The file extension format for split operation. You may use "a" for letters
178
+ and "n" for numbers. If you use annn, an extension started as a000 will be
179
+ appended; the last possible extension for this format will be z999.
180
+ splitformat=an will provide a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1,
181
+ b2, b3\.\.\. If nothing is specified the default format is "nnn". NOTE: the split
182
+ and splitformat options take effect only for output files (option of=) specified
183
+ AFTER these options appear in the command line (e.g. split=50M splitformat=annn
184
+ of=/tmp/test.iso).
185
+ Likewise, you may specify it several times for different output files within
186
+ the same command line. You may use as many digits in any combination you would
187
+ like. E.g. "anaannnaana" would be valid, but a quite insane (see BLOCKS AND BYTES
188
+ section).
189
+ Other possible approach is MAC. If "MAC" is used, a suffix dmg and several
190
+ dmgpart will be appended. In other words, it will generate a partial disk image
191
+ file, used by the Mac OS X operating system. dmgpart files are usually provided
192
+ with a corresponding dmg file, which is the master file for the split archive.
193
+ If dmg is opened in Mac OS X, all dmgpart will be read too. The last option is
194
+ WIN, which will automatically output file naming of foo.001, foo.002, \.\.\. ,
195
+ foo.999, foo.1000, \.\.\. .
186
196
.TP
187
197
.B
188
198
vf=FILE
@@ -251,14 +261,14 @@ Continue after read errors.
251
261
.TP
252
262
.B
253
263
sync
254
- Pad every input block with NULs to ibs-size. When used with block or unblock, pad with spaces rather
255
- than NULs.
264
+ Pad every input block with NULs to ibs-size. When used with block or unblock, pad with spaces
265
+ rather than NULs.
256
266
.SH FORMAT
257
267
The structure of FORMAT may contain any valid text and special variables. The built-in variables are the
258
- following format: #variable_name#. To pass FORMAT strings to the program from a command line, it may be necessary to
268
+ following format: #variable_name#. To pass FORMAT strings to the program from a command line, it may be
259
269
.TP
260
270
.B
261
- surround your FORMAT strings with "quotes."
271
+ necessary to surround your FORMAT strings with "quotes."
262
272
The built-in variables are listed below:
263
273
.TP
264
274
.B
@@ -297,23 +307,134 @@ The FORMAT structure accepts the following escape codes:
297
307
.TP
298
308
.B
299
309
\\n
300
- Newline.
310
+ Newline
301
311
.TP
302
312
.B
303
313
\\t
304
- Tab.
314
+ Tab
305
315
.TP
306
316
.B
307
317
\\r
308
- Carriage return.
318
+ Carriage return
309
319
.TP
310
320
.B
311
321
\\
312
- Insert the '\\' character.
322
+ Insert the '\\' character
313
323
.TP
314
324
.B
315
325
##
316
- Insert the '#' character as text, not a variable.
326
+ Insert the '#' character as text, not a variable
327
+ .SH EXAMPLES
328
+
329
+ Each following line will create a 100 MiB file containing zeros:
330
+ .PP
331
+ .nf
332
+ .fam C
333
+ $ dcfldd if=/dev/zero of=test bs=1M count=100
334
+ $ dcfldd if=/dev/zero of=test bs=100M count=1
335
+ $ dcfldd if=/dev/zero of=test bs=50M count=2
336
+ $ dcfldd if=/dev/zero of=test limit=100M
337
+
338
+ .fam T
339
+ .fi
340
+ To create a copy (forensics image) from a disk called /dev/sdb inside a file, using input/output blocks
341
+ of 4096 bytes (4 KiB) instead of 32 KiB (default):
342
+ .PP
343
+ .nf
344
+ .fam C
345
+ $ dcfldd if=/dev/sdb bs=4096 of=sdb.img
346
+
347
+ .fam T
348
+ .fi
349
+ As the last example, plus calculating MD5 and SHA256 hashes, putting the results inside sdb.md5 and
350
+ sdb.sha256. It is very useful for forensics works because the hashes will be processed in real time,
351
+ avoiding a waste of time to make something as 'dd + md5 + sha256'. Considering that I/O disk is very
352
+ slow and RAM is very fast, the hashes will be calculated, bit per bit in memory, when the next portion
353
+ of the disk is read. When all disk was read, all hashes are now ready.
354
+ .PP
355
+ .nf
356
+ .fam C
357
+ $ dcfldd if=/dev/sdb bs=4096 hash=md5,sha256 md5log=sdb.md5 sha256log=sdb.sha256 of=sdb.img
358
+
359
+ .fam T
360
+ .fi
361
+ To validate the image file against the original source:
362
+ .PP
363
+ .nf
364
+ .fam C
365
+ $ dcfldd if=/dev/sdb vf=sdb.img
366
+
367
+ .fam T
368
+ .fi
369
+ Splitting the image in 500 MiB slices, using the default bs value (32 KiB). Note that split= must be
370
+ put before of= to work:
371
+ .PP
372
+ .nf
373
+ .fam C
374
+ $ dcfldd if=/dev/sdb split=500M of=sdb.img
375
+
376
+ .fam T
377
+ .fi
378
+ At the last example, using from a0000 up to z9999 as suffix for each split file:
379
+ .PP
380
+ .nf
381
+ .fam C
382
+ $ dcfldd if=/dev/sdb split=500M splitformat=annnn of=sdb.img
383
+
384
+ .fam T
385
+ .fi
386
+ Now, \fB dcfldd \fP will work byte per byte (bs=1) and will hop 1056087439 bytes. After this, \fB dcfldd \fP will collect
387
+ 200000 bytes and write the results to a file called airplane.jpg.
388
+ .PP
389
+ .nf
390
+ .fam C
391
+ $ dcfldd if=/dev/sda3 bs=1 skip=1056087439 count=200000 of=airplane.jpg
392
+
393
+ .fam T
394
+ .fi
395
+ In the last example, the same result could be obtained using "limit" instead of "count". The main
396
+ difference is that count uses 200000*bs and limit uses 200000 bytes (regardless of the value declared in
397
+ bs option):
398
+ .PP
399
+ .nf
400
+ .fam C
401
+ $ dcfldd if=/dev/sda3 bs=1 skip=1056087439 limit=200000 of=airplane.jpg
402
+
403
+ .fam T
404
+ .fi
405
+ To write something inside a file, you can use seek. Suppose you want to write a message from a file called
406
+ message.txt inside a file called target.iso, hopping 200000 bytes from start of file:
407
+ .PP
408
+ .nf
409
+ .fam C
410
+ $ dcfldd if=message.txt bs=1 seek=200000 of=target.iso
411
+
412
+ .fam T
413
+ .fi
414
+ \fB dcfldd \fP also can send a result to be processed by an external command:
415
+ .PP
416
+ .nf
417
+ .fam C
418
+ $ dcfldd if=text.txt of:="cat | sort -u"
419
+
420
+ .fam T
421
+ .fi
422
+ To convert a file from ASCII to EBCDIC:
423
+ .PP
424
+ .nf
425
+ .fam C
426
+ $ dcfldd if=text.asc conv=ebcdic of=text.ebcdic
427
+
428
+ .fam T
429
+ .fi
430
+ To convert a file from EBCDIC to ASCII:
431
+ .PP
432
+ .nf
433
+ .fam C
434
+ $ dcfldd if=text.ebcdic conv=ascii of=text.asc
435
+
436
+ .fam T
437
+ .fi
317
438
.SH SEE ALSO
318
439
\fB dd \fP (1)
319
440
.SH REPORTING BUGS
0 commit comments