I used dd to create a sample empty file with 1MB, edited the sample file, created a MD5 hash of the file, started a listener on the examiner machine, piped the output off to nc and compared the hashes. Why does the hash value is modified if i transmited the same data from the same file to it?
dd if=/dev/zero of=/CaseStudies/sample.dd bs=1M count=1
hexedit sample.dd
ENTER
0x20000
68 65 72 65 20 49 20 61 6D 0A
Ctrl-X
dd if=/CaseStudies/sample.dd bs=4k | md5sum
output:
fc3ef9193baf3a1d3fc67da5aa4510ae
nc -lp 4444 > sample.dd
dd if=/CaseStudies/sample.dd bs=4k | nc -w3 127.0.0.1 4444
md5sum sample.dd
output:
d41d8cd98f00b204e9800998ecf8427e sample.dd
cmp sample.dd copy.dd
output:
cmp: EOF on sample.dd which is empty
For some reason the netcat isn't being able of sending the data through the connection. Could someone help me figuring out why?
/CaseStudies/
? See Bending a pipeline back into its origin. Does this answer your question? – Kamil Maciorowski Jul 20 '23 at 05:03