Search code examples
linuxwindowsdockernetcat

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


If I want to transfer a binary file "binary.bin" (located in the same directory as NetCat) to IP address 127.0.0.1 port 1200 using TCP, how do I specify this using NetCat for windows?


Solution

  • 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