Binary executed automatically when connecting to a server using netcat

37 Views Asked by At

These days I am doing CTFs in pwnable.kr, and was curious about how they implemented this.

Basically some CTFs in that site require me to SSH into the server, and run the binary manually from there. Others require me to use netcat (probably because they binary has info that'll make the challenge too easy), in the following way:

nc pwnable.kr <port>

for example,

nc pwnable.kr 9004

I was wondering how they implemented this thing - of "connecting" the file execution to the connection. So whenever someone connects through netcat on that specific port, a specific file is executed and redirects it's stdin, stdout and stderr to the connection.

0

There are 0 best solutions below