Get the latest tech news

TCP Client Self-Connect (2013)


This is so cool and unexpected, but then nothing out of spec, that I had to reblog it. Namely, if you run the following snippet of the Bour...

:) A bit longer explanation follows...Let's start with a fact that when a client (in this case it is a telnet application) creates socket and tries to connect to server, kernel assigns it a random source port number. Since no process usually listens on ephemeral ports RST response is sent back and telnet client gives error message Connection refused. # tcpdump -nni lo port 5000021:31:02.326447 IP 127.0.0.1.49999 > 127.0.0.1.50000: Flags [S], seq 1951433652, win 43690, options [mss 65495,sackOK,TS val 41197286 ecr 0,nop,wscale 7], length 021:31:02.326455 IP 127.0.0.1.50000 > 127.0.0.1.49999: Flags [R.], seq 0, ack 387395547, win 0, length 0 It is interesting to note that Linux chooses ephemeral ports sequentially, not randomly.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of connect

connect

Photo of TCP

TCP

Related news:

News photo

TCP-in-UDP Solution (eBPF)

News photo

Implementing fast TCP fingerprinting with eBPF

News photo

tcpulse: A TCP/UDP load generator that provides fine-grained, flow-level control