-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauto obf.py
35 lines (29 loc) · 1.16 KB
/
auto obf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import subprocess
import os
#input the storm obf.py file with the mal.py as a malware before you execute
def obfuscate(input_file, iterations=6):
current_input = input_file
for i in range(1, iterations + 1):
output_file = f"mal{i+1}.py"
print(f"Obfuscating {current_input} -> {output_file}")
result = subprocess.run(
["python", "obf_py.py", "-i", current_input, "-o", output_file, "-r", "2", "--include-imports"],
shell=True
)
if result.returncode != 0:
print(f"Error during obfuscation at iteration {i}. Exiting.")
break
current_input = output_file
if os.path.exists(current_input) and i > 1:
os.remove(f"mal{i}.py")
def entry():
try:
times = int(input("Enter the number of obfuscation iterations (10-30): "))
if 10 <= times <= 30:
obfuscate("mal.py", iterations=times)
else:
print("Invalid input. Please enter a number between 10 and 30.")
except ValueError:
print("Invalid input. Please enter a valid number.")
if __name__ == "__main__":
entry()