News for hackers. Stuff that matters.
Re:DNS Toys by Waterluvian on Saturday June 11, 2022 @11:42AM (#31705319)
“Why? For fun.”

I love this. It doesn’t need a reason to exist. It’s interesting on its own.

That being said, can anyone think of additional interesting reasons for why this would be useful rather than the same toys over HTTP?

Re:DNS Toys by QuadrupleA on Saturday June 11, 2022 @12:06PM (#31705537)
Simplicity / latency / efficiency - DNS typically just fires off one UDP packet (generally one IP packet & ethernet frame too) and then gets one back (hopefully) and it's done. HTTP requires the TCP 3-way connection handshake, then the out & back roundtrip for request/response, then the 4-way teardown handshake. If it's HTTPS you also need the 4-way TLS <= 1.2 handshake and close notification alert. Although QUIC or TLS 1.3 improves that a bit.

Anyway if you're using a 14.4 modem in a rusty bunker at the bottom of the sea you'll notice a substantial improvement :)

Re:DNS Toys by brian_cunnie on Saturday June 11, 2022 @04:22PM (#31707978)
This.

I measured the difference using `tcpdump`, and this was my conclusion:

> A big advantage of using DNS queries instead of HTTP queries is bandwidth: querying ns-aws.sslip.io requires a mere 592 bytes spread over 2 packets; Querying https://icanhazip.com/ requires 8692 bytes spread out over 34 packets—over 14 times as much! Admittedly bandwidth usage is a bigger concern for the one hosting the service than the one using the service.

(I had set up a service to determine your IP address via DNS, i.e. `dig @ns.sslip.io txt ip.sslip.io +short`, and measured why it was (marginally) better than using HTTP)

Re:DNS Toys by aq9 on Saturday June 11, 2022 @07:41PM (#31709591)
To be fair in the comparison; you can also query (via curl) icanhazip.com via HTTP instead of HTTPS, and it is only 5 packets and 385 bytes.
Re:DNS Toys by brian_cunnie on Sunday June 12, 2022 @08:09PM (#31719478)
Good catch!
Re:DNS Toys by lazide on Saturday June 11, 2022 @02:01PM (#31706566)
A couple decades ago I did SSH over DNS at the request of a client. It was pretty fun, worked surprisingly well. At the time, exactly zero firewalls stopped it.
Re:DNS Toys by hug on Sunday June 12, 2022 @12:31AM (#31711467)
I used to use iodine, a tunneling server which uses DNS as the transport, which would work even through captive portals at the time.

https://github.com/yarrick/iodine

Re:DNS Toys by dicknuckle on Saturday June 11, 2022 @10:11PM (#31710606)
ooh, MOSH over DNS. Theres all kinds of features to compensate for UDP lossiness built in.
Re:DNS Toys by carlhjerpe on Saturday June 11, 2022 @10:56PM (#31710868)
Most tunnel protocols are UDP these days, vxlan, geneve, wireguard etc... Just because it doesn't guarantee delivery, meaning you don't get the retransmit amplification you'd get with TCP over TCP.
Re:DNS Toys by solardev on Saturday June 11, 2022 @04:17PM (#31707929)
Why do you need to know the time in Paris while you're relaxing in a bunker at the bottom of the ocean? I know remote work is a thing now, but sheesh, some people just don't know how to disconnect ;)
Re:DNS Toys by SahAssar on Saturday June 11, 2022 @12:14PM (#31705595)
> Although QUIC or TLS 1.3 improves that a bit.

On a TLS1.3 QUIC connection with a session supporting 0-rtt would DNS still require less round trips?

Re:DNS Toys by carlhjerpe on Saturday June 11, 2022 @10:59PM (#31710885)
But you generally don't wanna keep a "connection" open to everyone in every scenario, like the one in the post.
Re:DNS Toys by SahAssar on Sunday June 12, 2022 @02:42AM (#31712131)
You don't need a connection, you just need to have a session cached that you can resume. That's how 0-RTT works.
Re:DNS Toys by Dylan16807 on Saturday June 11, 2022 @02:57PM (#31707131)
Well it depends very strongly on what you're doing. Looking at these packet sizes, on a 14.4 modem I'd expect the extra traffic to take about a second. But also you're waiting 10-20 seconds for HN to load or minutes for your average web page to load.
Re:DNS Toys by pinato on Saturday June 11, 2022 @11:57AM (#31705454)
I came across "open" WiFis that required another form of login inside that filtered all HTTP traffic but let through DNS. But no, it's not really useful outside of special circumstances.
Re:DNS Toys by midasuni on Saturday June 11, 2022 @04:55PM (#31708299)
I have WireGuard endpoints of UDP 53, 443 and a high random port - at least one of them tends to work (although not always — one hotel recently only allowed tcp/80 and tcp/443
Re:DNS Toys by selcuka on Sunday June 12, 2022 @10:05AM (#31714585)
> one hotel recently only allowed tcp/80 and tcp/443

How did DNS resolution work? Do they force you to use their proxy server?

Re:DNS Toys by Arnie97 on Wednesday June 15, 2022 @12:12AM (#31749034)
They could set up a recursive dnsmasq on the router, and block udp/53 traffic to the outside world.
Re:DNS Toys by Diesel555 on Saturday June 11, 2022 @05:53PM (#31708813)
This may work on pay to use Wi-Fi. There was a previous interesting post here about tunneling through DNS on airplane or other pay to use Wi-Fi.

https://news.ycombinator.com/item?id=511908

Re:DNS Toys by swznd on Saturday June 11, 2022 @06:57PM (#31709296)
I have used this trick when I in high school grade.

Just setup openvpn with port 53 UDP with cheap vps, then connect it, and get unlimited internet access

Internet connection in my country is very limited and expensive in that day

Re:DNS Toys by vineyardmike on Sunday June 12, 2022 @03:11AM (#31712284)
You have no idea how badly I was looking for a way to tunnel via airplane wifi. Even going as far as trying to use the "free tier" fb messenger access to move packets. Now the ToS have a very low bandwidth limit on the free tier (eg. 100mb), so I'm not sure if it'd work for any real application.

I never thought to use DNS as a tunnel, but I have seen some pretty interesting loopholes that I was trying to find. Some airline's captive portal used to rely on some google service (captcha probs), and for a period of time didn't block any google-owned IP address that wasn't a consumer website (eg search, yt) so GCP and developer docs would load if you had the URL. I couldn't reliably get to user-generated content through it though.

Re:DNS Toys by ignoramous on Sunday June 12, 2022 @06:06AM (#31713345)
> I never thought to use DNS as a tunnel

Most firewalls drop or hijack packets on port 53.

Re:DNS Toys by 1vuio0pswjnm7 on Sunday June 12, 2022 @08:34AM (#31714011)
I have experienced this, i.e., hijacking, but I would respectfullly contest the term "most". But perhaps the statement was only referring to airports. I could be wrong but I like to think it is a minority of networks that hijack or block DNS. For example, a minority of consumer ISPs, other networks controlled by third parties (airports, hotels, etc.) or countries that conduct extremely aggressive internet censorship.
Re:DNS Toys by martinmunk on Saturday June 11, 2022 @12:42PM (#31705860)
I can see the IP echo command be useful to verify if DNS traffic is routed differently than other traffic on a corporate network. Assuming outbound port 53 is not blocked completely on the network that is.
Re:DNS Toys by inopinatus on Saturday June 11, 2022 @06:20PM (#31709029)
My default is the other way around, I'll question why something that is not a web page uses HTTP as an application-layer protocol when better fitted alternatives usually exist.

Add a bonus withering stare for assuming JSON is the only data serialization/interchange format.

Re:DNS Toys by gpmcadam on Saturday June 11, 2022 @11:58AM (#31705461)
maybe on a wifi network before authentication when it may allow DNS resolution but not HTTP requests?
Re:DNS Toys by haliskerbas on Saturday June 11, 2022 @12:30PM (#31705740)
Could you shuttle more data through this method to have a browser that works on unauthenticated captive portal wifi networks?
Re:DNS Toys by sneak on Saturday June 11, 2022 @12:48PM (#31705903)
It's called dns tunnelling.

https://github.com/yarrick/iodine

Re:DNS Toys by slt2021 on Saturday June 11, 2022 @04:38PM (#31708133)
looks like this can be used to get free wifi on airplane
Re:DNS Toys by 323 on Saturday June 11, 2022 @04:47PM (#31708219)
> During the last decade, several types of software and malware used the DNS protocol for data exchange.

https://resources.infosecinstitute.com/topic/bypassing-secur...

Re:DNS Toys by mbreese on Saturday June 11, 2022 @05:00PM (#31708346)
That doesn’t mean the protocol isn’t useful for other purposes. Part of why it’s useful for the malware writers is that it’s highly available and often ignored by firewall rules.

That availability can also be used for good.

Re:DNS Toys by bityard on Sunday June 12, 2022 @10:40AM (#31714849)
I can see using this on an isolated network of iot-like devices that don't quite have the guts or spare bandwidth for HTTPS. MQTT over DNS?
Re:DNS Toys by woevdbz on Saturday June 11, 2022 @12:47PM (#31705902)
Maybe less likely to be blocked by some firewall policy?