1

I'm on Windows 7 Powershell and have ncat from http://nmap.org/ncat/

I'm trying to send "foo" to some network device

PS> ncat -u 192.168.1.255 6061
foo

but it sends "foo\n" (66 6f 6f 0a) and the line-feed makes the device not recognize the command.

there's a -C option to add a carriage return, but that's no help.

I made a text file containing "foo" and did

PS> cat .\test.txt | ncat -u 192.168.1.255 6061

but that also adds CRLF

jamieb
  • 3,427
  • 4
  • 25
  • 36
tladuke
  • 311
  • 1
  • 3
  • 11

2 Answers2

1

What happens if you just pipe "foo" | ncat ...

Failing that, you might want to look at this: http://powershell.codeplex.com/releases/view/59029

Which seems to allow you to send messages over TCP.

Chris N
  • 707
  • 3
  • 8
1

in case someone comes along this question and is not working on Windows but rather on Linux, you might want to try this:

  • Use the "eof" key, Ctrl+D

Source: superuser.com

Phi
  • 171
  • 8