Adam Rice Proves Doom Really Can Run Anywhere — By Porting It to DNS
The shareware version of the game, minus audio, is distributed to clients as nearly 2,000 DNS TXT records — because why not?
Security engineer Adam Rice has taken on an interesting twist in the classic challenge of "can it run Doom:" having Id Software's seminal 1993 game "running" via Domain Name Service (DNS) queries.
"If you’ve ever poked at one of my CTF [Capture The Flag] challenges, you’ve probably noticed a pattern — I love hiding payloads in TXT DNS records," Rice explains. "I’ve always suspected the technique could go further than staging shellcode. TXT records are just arbitrary text fields with no validation. If you can store a payload, you can store a file. If you can store a file, you can store a program. And if you can store a program… well, it can probably run Doom."
Released in 1993 to critical acclaim, the hellish first-person shooter Doom was a smash hit for Id Software — and the company's decision to open-source its older game engines as it moves onto bigger and better things coupled with its by-modern-standards minimal resource requirements has made it a go-to target for porting to a range of unexpected platforms, from GPS units and coffee makers to low-cost microcontrollers.
Rice's take on the "can it run Doom" challenge, though, runs the game on a modern computer; it's how it gets there that's the interesting part: loaded over Domain Name Service (DNS) queries, more traditionally used to find out the IP address assigned to a given domain name. "The idea is to fetch the entire game engine and its assets from DNS TXT records, load everything into memory, and run it," Rice explains. "No downloads, no installers, and no files written to disk. My goal is to load the game into memory entirely through public DNS queries.
"With compression, Doom fits comfortably in a single CloudFlare Pro DNS zone. The WAD file drops from 4MB to 1.7MB, the DLL bundle goes from 4.4MB to 1.2MB. In total, it required about 1,966 TXT records on a single DNS zone," Rice explains. "And it works. Doom is stored, launched, and running from DNS records. I described this project to my mother as such: it's like taking a phone book and playing the 1986 academy award winning action film Top Gun starring Tom Cruise as a flip-book animation out of the phone numbers on every page."
The project is detailed on Rice's blog, with source code available on GitHub under the same GNU General Public License 2 as the upstream Managed Doom project.