News for hackers. Stuff that matters.
Re:HTTP 418 I'm a Teapot by derefr on Tuesday July 31, 2018 @10:19AM (#17653325)
I still say 418 is a sensible error code to use to inform clients who try to spew HTTP at non-HTTP ports that they’re barking up the wrong tree.

I.e.: “I’m not a web server, bro. I’m a teapot.”

You could theoretically further provide a Protocol header in the response (like the one in the request for an HTTP upgrade) that says what protocol you should be speaking on that port.

Re:HTTP 418 I'm a Teapot by linker3000 on Tuesday July 31, 2018 @10:27AM (#17653398)
Helpful! That would sure narrow down the number of possible vulnerabilities that had to be tried and would help a script kiddie breeze through the probing much faster.
Re:HTTP 418 I'm a Teapot by derefr on Tuesday July 31, 2018 @10:38AM (#17653502)
I’m thinking in IPv6 terms here, where each separate “service” is exposed on a separate IP, and the only time you get multiple ports open on a single IP is when it’s one daemon that is holding multiple ports open in order to allow clients to speak one of several protocols to it (i.e. using TCP/UDP ports for their original purpose of layer-4 negotiation of the layer-{5,6} protocol stack you’ll be speaking the same layer-7 protocol over.)

In such cases, you can probably recognize the server just from the set of ports that are open (e.g. a Slack server instance: HTTPS, XMPP, IRC.) So the server pointing out that you’re speaking to the wrong one of its ports with your message, in the way a client can understand, won’t really impact your attack surface.

Of course, if the world really did adopt “the IPv6 port usage paradigm”, and did away with NATs and other things that map ports to other ports, there’d be little need for this: a destination port would be a 1:1 identifier for a protocol, and you could know you were speaking “the wrong protocol” to a port simply by looking at what port it is! Network client libraries could get away with simply not letting you specify both the port and the protocol, instead only leaving one configurable and deriving the other one from it.

But we’re a long way off from that, and I would think that for now, being able to “permanent fail” HTTP clients off of infinitely retrying some internal service port exposed on your k8s-mesh load balancer, would be useful.

Re:HTTP 418 I'm a Teapot by sirsuki on Tuesday July 31, 2018 @11:53AM (#17654272)
> I’m thinking in IPv6 terms here

You do realize that the utopian future you dream of will never happen!

There is too much money to be had hording and selling IPv4 addresses.

Re:HTTP 418 I'm a Teapot by petee on Tuesday July 31, 2018 @10:30AM (#17653429)
The protocol itself says what you should be speaking: "I'm a teapot. Talk to me in Teapot, not Coffee." -- anything other than a teapot responding with a 418 would be RFC non-compliant
Re:HTTP 418 I'm a Teapot by derefr on Tuesday July 31, 2018 @10:39AM (#17653511)
It does for now, yeah. A future version of HTTP could generalize the HTCPCP message into a (surprisingly useful!) HTTP message.