How does one make a Zip bomb?

前端 未结 14 1523
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 11:13

This question about zip bombs naturally led me to the Wikipedia page on the topic. The article mentions an example of a 45.1 kb zip file that decompresses to 1.3 exabytes.

14条回答
  •  死守一世寂寞
    2020-12-12 11:25

    Silicon Valley Season 3 Episode 7 brought me here. The steps to generate a zip bomb would be.

    1. Create a dummy file with zeros (or ones if you think they're skinny) of size (say 1 GB).
    2. Compress this file to a zip-file say 1.zip.
    3. Make n (say 10) copies of this file and add these 10 files to a compressed archive (say 2.zip).
    4. Repeat step 3 k number of times.
    5. You'll get a zip bomb.

    For a Python implementation, check this.

提交回复
热议问题