I have a telnet server that when provided with ip and port sends a message to the destination.. how do i make it send it to my server program if it runs locally? is there maybe a way that I can recieve the message in another way? (its a ctf)
I tried looking for a site that can recieve the message for me and than "forward" it to me but couldnt find one..
Install Ngrok, do nc -lvp 1234
in a terminal. Open up another terminal, do ngrok tcp 1234
. It'll give you an output that includes something like tcp://5.tcp.eu.ngrok.io:31415 -> localhost:1234
.
Now on the "telnet server", put 5.tcp.eu.ngrok.io
as the IP address, and 31415
as the port number. You'll receive the message on the nc listener.
Please elaborate more on your question. However, even though I'm not an expert in PWN CTF category, I think the traffic could be received from the server to your machine via nc and Ngrok. Here is a quick tutorial on how to use nc along with Ngrok, but I'll do my little explanation here.
What I understood from your question is that you give that "telnet server" the IP and port to your machine (client) and it'd send a message. You can setup a simple nc listener on your machine via this command:
nc -lvp 1234
This will make your machine receive messages through this port. However, to get to your machine from that "server", it'd need an IP address. And I assume that the "server" is not in your local network, which is why you have to use Ngrok. After installing ngrok on your machine, do the following command on a new terminal:
ngrok tcp 1234
This will give you like a public IP address (mostly a domain, not a numeric IP) and a random port. Ngrok will forward all the traffic from the public IP address and port to your local listener (on port 1234 that you've setup).
The output from ngrok will have something like this:
tcp://5.tcp.eu.ngrok.io:31415 -> localhost:1234
On the "server" that you mentioned, put 5.tcp.eu.ngrok.io
as the IP address and 31415
as the port. You should receive the message on that nc listener.
I hope I correctly guessed what you want and this would answer your question. You should ask better questions next time, though!