Developer creates a 100% valid ZIP file that doubles as a BIOS-bootable operating system
Hacking stories these days mostly involve someone using an army of AI agents to find vulnerabilities in networks and software that were carefully hidden in plain sight. Today, for a change, we have a story about hacking in its original meaning — twisting computing artifacts into purposes not in their design spec. David Oberhollenzer, aka Goliath, a greybeard in spirit if not in shade, crafted a 100% valid ZIP file that's simultaneously an archive, BIOS-bootable, and a Multiboot-compatible OS image.
You can unpack the ZIP file just like any other, boot it using Linux's GRUB, QEMU, or any other Multiboot-compatible loader (even if imaged to different media), or alternatively, perform the finest party trick: image-write it to a floppy and boot from it directly from BIOS on any compatible PC, without modification.
Much like me, that sequence of words may be triggering a head-tilt reminiscent of a confused puppy, so we'll explain. The first thing you need to know is that unlike most file types, the metadata (in this case, file directory) of a ZIP is actually at the end of the archive. Up to that point, the data is comprised of every compressed file in sequence.
The file packs all have a predictable structure: "PK" followed by bytes 03 04, metadata (including name), some extra/comment fields, and then the file's contents. Notably, any file can be stored uncompressed , and Goliath made use of that for the very first file, called ZIPHEAD.COM — remember, this is the start of the ZIP archive.
Goliath said that it was "easy" to make the ZIP file a valid Multiboot system image. A valid image only needs to contain bytes 0x1BADB002 in the first 8 KiB, followed by some flags and a checksum. It was trivial to place that datum in ZIPHEAD's data, along with the location of where the bootloader lies.
Grub or QEMU don't care about anything else in the image, as once they have the initialization information, from that point it's the bootloader's problem. The actual bootloader, predictab




Comments
No comments yet. Be the first to share your thoughts.