The goal which I am attempting to achieve is for a client to send the following command to a server:
echo "Hello" | nc IP Port
Upon receiving the "Hello" keyword, the server which is listening using:
nc -nlp port
should then send a response "Holla" back to the client. I have tried the following, none of which work in my instance:
- run a command conditionally with netcat and grep
- Is a conditional response possible with netcat
- How to respond conditionally based on the request when using netcat
So the issue which I am currently facing is that upon receiving the "Hello" from the client side, the server side is unable to send a "Holla" response back to the client. Is there a way to do this with netcat? If so what am I missing?
Any help would be greatly appreciated.