Live data from Hacker News

HTML over DNS: Serving Blog Content over DNS

jacobkiers.net

41–50 of 77 posts

Re: HTML over DNS: Serving Blog Content over DNS

#41

Earlier quoted context omitted.

I don't know how to do this without JS. Also, since this was mostly a DNS-focused proof of concept, I don't particularly care about that. Not in this case, at least.

You don’t have to “do this without JS” but you could have a fallback to tell JS-less users about it. As is they get a blank page and no idea what’s happening.

Fair enough. I have added a fallback.

Re: HTML over DNS: Serving Blog Content over DNS

#42

Corollary is, spyware can use DNS to exfiltrate data [0]. Or, send out client-side metrics with cleverly drafted DNS requests [1], or use it as a 3p-cookie replacement [2]. [0] https://unit42.paloaltonetworks.com/dns-tunneling-how-dns-ca... [1] https://github.com/Jigsaw-Code/choir (disclosure: I co-develop hard-forks of two other related Jigsaw-Code projects) [2] http://dnscookie.com/

Fun story about this. I know one of the former guys at Xobni back in the day when it was still a thing. They had made an enterprise version that was sold to companies like Apple, Intel, etc. But even though the enterprise software no longer made external API calls, the company still wanted usage metrics so they could monitor feature usage. Knowing how locked down the networks were at companies like this, they exfiltrated the usage data via infrequent DNS requests to their DNS server. Everything was going fine until one day a dozen or so users at Intel stopped reporting. Hours later all of Intel stopped reported. Within the next day other companies started coming offline. Apple first, then some other large tech company and then a whole slew of them.

Turns out when you spy on your users word gets around.

Re: HTML over DNS: Serving Blog Content over DNS

#43
post #28

Corollary is, spyware can use DNS to exfiltrate data [0]. Or, send out client-side metrics with cleverly drafted DNS requests [1], or use it as a 3p-cookie replacement [2]. [0] https://unit42.paloaltonetworks.com/dns-tunneling-how-dns-ca... [1] https://github.com/Jigsaw-Code/choir (disclosure: I co-develop hard-forks of two other related Jigsaw-Code projects) [2] http://dnscookie.com/

Packet size is a really good detection for this. DNS packets should only be so big ;)

So I split my packets up into smaller chunks. Now you need to rate limit DNS. But you still need to allow regular DNS traffic somehow, or you break the internet.

Re: HTML over DNS: Serving Blog Content over DNS

#44
post #40
post #26

Well the content is stored in a DNS Zone file but it is requested using JavaScript to an external HTTP API. I wouldn't really call that HTML over DNS but rather "DNS Zone as blog database". Anyway, this made me think of iodine [1], an IP over DNS solution, which I still run on my main server even though it has a lot less use now than it had until a few years ago when there were a lot of open wifi with captive portals…

the site is down? - https://code.kyro.se/iodine/

Sorry I was on my smartphone and mistyped the url (it's kryo not kyro): https://code.kryo.se/iodine/

Thanks for pointing it out.

EDIT: As an aside, I still hate how mobile browsers have the bad habits of reloading tabs (and most of the time loosing content) that you get back to with no reason. If not for this crappy behavior, I would have copy-pasted the URL.

Re: HTML over DNS: Serving Blog Content over DNS

#45
The RR format can be made more efficient. TXT records can contain multiple character strings of up to 255 bytes, and despite their name can contain arbitrary octets. A step further from there would be to use a private use type (65280-65534) so your payload doesn't need to be cut into length byte prefixed chunks.

Re: HTML over DNS: Serving Blog Content over DNS

#46
post #13

This looks like it was a fun project! For anyone who wants to research the subject, the class of security vulnerabilities are called DNS tunneling.

Yes. I recently wrote a Lua-scriptable DNS server called redns[1] (which seems to be a pretty popular name for hobbyist DNS servers, BTW) only to test some of those attacks.

[1] https://github.com/luismedel/redns

Re: HTML over DNS: Serving Blog Content over DNS

#47
All sites on the .tel domain used to be rendered from DNS. It seems to have changed in 2017 but Wikipedia still says[1]:

"In contrast to other top-level domains, .tel information is stored directly within the Domain Name System (DNS) [...] as opposed to the DNS simply returning details (such as IP addresses)"

[1] https://en.wikipedia.org/wiki/.tel

Re: HTML over DNS: Serving Blog Content over DNS

#48
post #26

Well the content is stored in a DNS Zone file but it is requested using JavaScript to an external HTTP API. I wouldn't really call that HTML over DNS but rather "DNS Zone as blog database". Anyway, this made me think of iodine [1], an IP over DNS solution, which I still run on my main server even though it has a lot less use now than it had until a few years ago when there were a lot of open wifi with captive portals…

Or just call it HTML over CloudFlare? That CloudFlare uses DNS on the backend doesn't validate DNS being in the title IMHO

Re: HTML over DNS: Serving Blog Content over DNS

#49
post #16

Wondering why I can't query the DNS directly. $ dig posts-2021-08-17-serving-blog-content-over-dns-md.hod.experiments.jacobkiers.net TXT ; > DiG 9.8.3-P1 > posts-2021-08-17-serving-blog-content-over-dns-md.hod.experiments.jacobkiers.net TXT ;; global options: +cmd ;; Got answer: ;; ->>HEADER

You can look at this line.

> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

That says that the DNS server didn't answer - for whatever reason - despite the address of that server being determined. It could have been a form of HN's "hug of death" where the website temporarily goes down when many people start to view it in a short period of time.

Re: HTML over DNS: Serving Blog Content over DNS

#50

Looks more like HTML via HTTP, specifically DoH. const dohServer = "https://cloudflare-dns.com/dns-query?ct=application/dns-json&type=TXT&name="; const baseDomain = "hod.experiments.jacobkiers.net"; About 12 years ago I experimented with HTML over UDP DNS by modifying dnstxt from djbdns to output a MIME header. I could store tiny web pages, i.e., hyperlinks, in a zone file and serve them with tinydns. (This was befor…

Actually JSON via HTTP. Then using Javascript to create HTML from the JSON.
Post reply on HN