2

Hi i need to send udp packet with netcat without waiting for answer i tried with -w0 but something it bug and don't work

if you need this is my command :

echo 413055 | perl -ne 's/([0-9a-f]{2})/print chr hex $1/gie' | nc -4u -w0 192.168.111.247 8899

2 Answers2

2

the wait option is -q (seconds):

echo 'test' | netcat -q 1 -u 192.168.111.247 8899

As is it wait a second and then quit. But it does not work with -q 0.

You could also try something like :

echo 'test' > /dev/udp/192.168.111.247/8899
Pico12
  • 1,229
  • 12
  • 18
0

The arguments needed to exit immediately depend on which nc you have.

For GNU nc:

xxd -r -p <<<413055 | nc -uc 192.168.111.247 8899

For BSD or traditional nc, -q 0 does work:

xxd -r -p <<<413055 | nc -uq0 192.168.111.247 8899

See this related answer with more detail.

Kenny
  • 125
  • 6