1
0
Fork 0

README.md: refactor and update

This commit is contained in:
Intel A80486DX2-66 2023-11-12 13:52:41 +03:00
parent af8360ebfd
commit 79ac9b94d6
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B
1 changed files with 16 additions and 14 deletions

View File

@ -1,25 +1,27 @@
# ZipBomb
This is for the people who watch Silicon Valley. In Season 3 Episode 7, Gilfoyle sends a sort of recursive program to Gavin Belsons laptop and cellphone which forces him to shut down the power at Hooli. Watch [here](https://www.youtube.com/watch?v=UdAqU4GRR9Y). Such a program is called a *zip bomb*.
This is for the people who watch Silicon Valley. In Season 3 Episode 7, Gilfoyle sends a sort of recursive program to Gavin Belsons 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).
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 of mine generates a compressed file of size **30.58 KB** which when decompressed is actually **10000000000 GB**. This is done to drain out a computers memory until it shuts down. Read More on [Wikipedia](https://en.wikipedia.org/wiki/Zip_bomb#Details_and_use).
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 10000000000 GiB. This is done to drain out a computers memory until a crash happens. Read more about zip bombs on [Wikipedia](https://en.wikipedia.org/wiki/Zip_bomb#Details_and_use).
This is a small script written in Python which generates such a zip bomb.
`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
```bash
python zipbomb.py 10 out.zip
```
### Output
```
Compressed File Size: 30.58 KB
Size After Decompression: 10000000000 GB
Generation Time: 10.40s
```sh
zipbomb.py <n_levels> <out_zip_file>
```
### Sample run
```sh
zipbomb.py 10 ./out.zip
```
### Sample output
```
Compressed file size: 31314 bytes
Decompressed file size: 10737418240000000000 bytes
Generation time performance: 0.02222222222222
```