How to send a Hex Byte array using NetCat (nc)

I want to send a byte array to a device in my network with IP addres via UDP to port 8888, how can i do that using NetCat?



  • You can use echo to pipe a string into netcat like this:

    echo -ne "\x2\x1\x65\xc9\x0\x2\x1\x6" | netcat -u -q 0 8888

    Make sure to remove trailing zeros by first replacing ,0 with \x and then replace all remaining , with \x using search and replace in notepad++