How can I make sure the result of the following command:
nc eth0 &> capture.txt
would capture the data + errors transmitted via eth0?
nc, and the syntax would be
tcpdump -i eth0
netcat is only for basic TCP/IP testing.
tcpdump utilizes the
libpcap library which allows for lowlevel interactions with packets and the likes
You should use
tcpdump with the
tcpdump -i INTERFACE -w FILENAME
Replace INTERFACE with the interface you want to listen and FILENAME with the location of the file to which you need to capture the output.