Вопрос

I would like to use nc as an extended echo server to echo an hexadecimal buffer (saved in file /tmp/data.hex). When I say "extended" I mean that the server will not echo this buffer immediately after client connects but only after client sends some information. The reason I want to do it is because I want to emulate a login request (sent by me) and response (sent by a remote server). The protocol that the remote server uses is very strict so I need this emulation in order debug my system.

To conclude

1) Start the server emulation (What is the command?)

2) My client sends login request to the server

3) After client got connected to the server, upon any client request, the server will send the buffer in the file /tmp/data.hex (this is the login response)

What will be the nc command (or any other program) to achieve the desired result? I'm running of fedora 17 machine and I'm using netcat-openbsd version so it doesn't have the -c option.

Это было полезно?

Решение

Silly question, simply install nmap using yum, the ncat program will be installed and it has the -c option, then you can use this and that.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top