1
0
Fork 0
ZipBomb/README.md

1.1 KiB

ZipBomb

This is for the people who watch Silicon Valley. In Season 3 Episode 7, Gilfoyle sends a sort of recursive program to Gavin Belson's laptop and cellphone which forces him to shut down the power at Hooli. Watch here. Such an attack is called a logic bomb.

What it is basically is a huge file with dummy data compressed to many levels to generate a very small compressed file. For example in a test run, this script generates a compressed file of size approximately 30.58 KiB which when decompressed is 10^10 GiB. This is done to drain out a computer's memory until a crash happens. Read more about zip bombs on Wikipedia.

zipbomb.py is a script written in Python 3 which generates such a zip bomb.

Usage

zipbomb.py <n_levels> <out_zip_file>

Sample run

zipbomb.py 10 ./out.zip

Sample output

Compressed file size: 31314 bytes
Decompressed file size: 10737418240000000000 bytes
Generation time performance: 0.02222222222222