0

Im doing a challenge (CTF style) and everyting we got is an IP.

Scanning that IP only one port is open.

If I connect to that IP and port using netcat, I got a kind of "dance" doing in CMD, with a message at the end that says "Check socket 12345".

I need to understand again what truly a socket is because im not getting anywhere trying to connect to that socket.

Its possible to connect to a socket from a specific port? or I only can make a connection from a open port and there the web servers redirect my connection automatically to a socket?

Underd0g
  • 57
  • 1
  • 4
  • This may be a variation on [port knocking](https://en.wikipedia.org/wiki/Port_knocking), and "Socket 12345" may simply be a poorly named reference to TCP (or perhaps UDP) port 12345. To use your example, if you try to connect to TCP port 12345 first the connection will fail. But if you connect to the magical always-open port and it says "Check socket 12345" it will then start a service listening for connections on TCP port 12345, perhaps for only the next 20 seconds. If no connections are received in those 20 seconds then the service will stop listening on that port. This is just my guess. – President James K. Polk Nov 08 '21 at 23:23
  • Tried with not luck. Thats the CTF IP just in case someone want to try: 172.104.226.52:1025. I see some numbers when I analyze the packets with Wireshark: 1000... 2020... 4400... I tried connect with a websocket and pass those numbers as input but i got no response neither. – Underd0g Nov 09 '21 at 22:17
  • This may simply be a prank (called a "Rick-roll") someone has pulled on you and not part of the CTF. Or it may be a light-hearted but real part of the of CTF. – President James K. Polk Nov 09 '21 at 23:09

1 Answers1

-1

You can use netcat nc and its -p option to set the source port.

Netcat man page say: -p port local port number (port numbers can be individual or ranges: lo-hi [inclusive])

Try "nc -p 12345 dest_IP dest_port"

Adp
  • 3
  • 1
Adp
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 09 '21 at 14:06