How to use NetCat for Windows to send a binary file to a TCP connection? How to use NetCat for Windows to send a binary file to a TCP connection? windows windows

How to use NetCat for Windows to send a binary file to a TCP connection?


I found the solution. Its

nc 127.0.0.1 1200 < binary.bin

In addition, if the response needs to be saved then

nc 127.0.0.1 1200 < binary.bin > response.bin


If you want to send it from a linux distribution to anybody, including windows PCs you can do something like this:

{ echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat path/to/your/file/binary.bin ; } | nc -l 1200

The receiving end then just needs to browse to your IP Address in his web browser and gets a prompt to download.Needless to say port 1200 needs to be forwarded if you're behind a router.