TCP Client Self-Connect (2013)

(sgros.blogspot.com)

40 points | by Bogdanp 10 hours ago ago

5 comments

  • Retr0id 4 hours ago

    Can confirm that it still works in 2025, and also via netcat.

    I wonder if it's also theoretically possible for a pair of clients to connect to each other like this?

    • LeoPanthera 4 hours ago

      The tailscale client does this trick to force its way through NAT-to-NAT connections.

      "How NAT traversal works" - https://tailscale.com/blog/how-nat-traversal-works > "The benefits of birthdays"

    • bmenrigh 4 hours ago

      Yeah a pair of clients can via “tcp simultaneous open” but you’ll need to arrange for each client to know about the source port of the other. So bypass the usual ephemeral port choice made by the OS. And it’s still highly sensitive to timing.

  • millipede 4 hours ago

    Intuitively it doesn't sound like it would work. The program doesn't call listen() or accept() on the socket.

    • j16sdiz an hour ago

      The comment section on it answered that: it's TCP simultaneous open.