0

I have learned how to use Docker containers, and I'd like to set up a container which contains a binary so that:

  • If I ssh to the Docker container, I am prompted as though I had just executed the binary locally
  • If I hit a condition that causes the binary to exit, it will restart and prompt me from the beginning again

I get how to expose ports in my containers and I get the gist of Docker networking, but I don't get how to proxy my binary over TCP as described above, the way I often see CTF challenges set up. Any specifics are much appreciated.

Edit: I'll also add that I know how to copy the binary into the container during the image creation. I'm just trying to figure out the service part.

growling_egg
  • 307
  • 1
  • 9

1 Answers1

0

I was looking for netcat and its -e option, to redirect stdin and stdout to a port. Putting a while loop around the netcat call gave me what I'm looking for.

growling_egg
  • 307
  • 1
  • 9