title: Use netcat and write to stdin for remote shell
body: <p>I am exploiting a buffer overflow vulnerability (for university) on a running server and I am able to redirect the process to exec a shell. 
  My exploit looks like this: </p>
  
  <pre><code>perl -e 'print "\xaa\xaa\..."' | nc -q0 machineAtUni 1234
  </code></pre>
  
  <p>So the server reads from the socket, eip will be overwritten and a shell executed. The problem is that I see some message from the shell but I can't insert anything. I think that the shell itself reads from stdin till EOF but how can I achieve that I can send commands to it (that the connection stays open and I am able to write to stdin)?</p>