1
0
Fork 0
ZipBomb/README.md

28 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2016-06-09 10:27:56 +02:00
# ZipBomb
2016-06-09 10:44:57 +02:00
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](https://www.youtube.com/watch?v=UdAqU4GRR9Y). Such an attack is called a [logic bomb](https://en.wikipedia.org/wiki/Logic_bomb).
2016-06-09 10:49:24 +02:00
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](https://en.wikipedia.org/wiki/Zip_bomb#Details_and_use).
2016-06-09 10:44:57 +02:00
2023-11-12 11:52:41 +01:00
`zipbomb.py` is a script written in Python 3 which generates such a zip bomb.
2016-06-09 10:44:57 +02:00
2017-03-27 10:40:47 +02:00
## Usage
2016-06-09 10:44:57 +02:00
2023-11-12 11:52:41 +01:00
```sh
zipbomb.py <n_levels> <out_zip_file>
2016-06-09 10:44:57 +02:00
```
2023-11-12 11:52:41 +01:00
### Sample run
2016-06-09 10:44:57 +02:00
2023-11-12 11:52:41 +01:00
```sh
zipbomb.py 10 ./out.zip
```
2016-06-09 10:44:57 +02:00
2023-11-12 11:52:41 +01:00
### Sample output
```
Compressed file size: 31314 bytes
Decompressed file size: 10737418240000000000 bytes
Generation time performance: 0.02222222222222
```