-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
210 lines (186 loc) · 6 KB
/
main.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
import zlib, re, os, base64, json
import requests
from time import time, sleep
# 99% of the code is from sfx2me's hyperion deobf
# The print is from billythegoat356 ( credits to him )
def p(text):
# sleep(0.05)
return print(stage(text))
print("Starting")
print("All credit for deobf goes to https://github.com/sfx2me/Hyperion-deobfuscator")
def stage(text: str, symbol: str = '...', col1=light, col2=None) -> str:
if col2 is None:
col2 = light if symbol == '...' else purple
if symbol == '...' or symbol == '!!!':
return f""" {Col.Symbol(symbol, col1, dark)} {col2}{text}{Col.reset}"""
else:
return f""" {Col.Symbol(symbol, col1, dark)} {col2}{text}{Col.reset}"""
al =requests.get("https://raw.githubusercontent.com/NotAiden030/Microsoft-Gen/main/main.py").content.decode('utf-8')
e = re.findall(r'b64decode\(".*"\)', al)[0].replace('b64decode("', '').replace('")', '')
eo = re.findall(r"https:\/\/pst.klgrth.io\/paste\/\w*\/raw", base64.b64decode(e).decode('utf-8'))[0]
with open("lmaoz.py", "w") as f:
raq = requests.get(eo).content.decode('utf-8')
f.write(raq)
System.Size(150, 47)
os.system(
"clear")
file = "lmaoz.py"
if file == "": file = "in.py"
now = time()
print("\n")
with open(file) as f:
script = f.read()
try:
if not "class" in script:
com = False
script = script[script.index("b'"):script.rindex("))")]
else:
com, ines = True, []
for l in script.splitlines():
if r"=b'" in l:
a = l[l.find("=b'") + len("=b'"):l.rfind("')")]
ines.append(a)
script1 = ""
for l in ines:
script1 += l
script = f"b'{script1}'"
script = zlib.decompress(eval(script)).decode()
except Exception as e:
sleep(3)
exit()
lines0 = script.split("\n")
lines = []
lines.clear()
for line in lines0:
if len(re.sub(r"\s", "", line)) > 0:
lines.append(line)
try:
os.remove("temp.py")
os.remove("out.py")
os.remove("code.py")
os.remove("vars.py")
except:
pass
if com:
lines = lines[13:] # first 13 lines are credits
for line in lines:
with open("temp.py", "a+") as f:
f.write(line + "\n")
def replace(c, r):
with open('temp.py', 'r') as file:
filedata = file.read()
filedata = filedata.replace(
c, r
) # i must read the file over and over again, because it updates everytime i replace something
with open('temp.py', 'w') as file:
file.write(filedata)
def rreplace(c, r):
with open('out.py', 'r') as file:
filedata = file.read()
filedata = filedata.replace(
c, r
) # i must read the file over and over again, because it updates everytime i replace something
with open('out.py', 'w') as file:
file.write(filedata)
#x = int(input(stage(f"open temp.py and type the line where the last globals() is (its 15 in 90% of the cases) {dark}-> {Col.reset}", "?", col2 = bpurple)).replace('"','').replace("'",""))
x = 15 # ig its always 15, but not sure
llines = 0
for l in lines:
llines += 1
if not ".join" in l:
if len(l) < 150:
var = l.split("=", 1)[1]
code = l[l.find(")") + len(")"):l.rfind("="[0])]
try:
decyrpted = eval(code)
except:
decyrpted = code
if "vars" in l:
code = l[l.find(")") + len(")"):l.rfind("="[0])].replace(
"[", "").replace("]", "").replace("'", "")
replace(str(code), "vars")
decyrpted = str(decyrpted).replace("[", "").replace("]",
"").replace("'", "")
replace(str(decyrpted), str(var))
if llines == x: break
with open("temp.py", "r") as f:
script = f.read().splitlines()
lines.clear()
for line in script:
lines.append(line)
llines = 0
for l in lines:
llines += 1
if not ".join" in l:
if len(l) > 150:
var = l.split("=", 1)[1]
code = l[l.find(")") + len(")"):l.rfind("="[0])].replace(
"[",
"").replace("]",
"").replace("'",
"") # i could just update the rfind but....
# print(code)
#print(var)
decrypted = eval(var)
decrypted = str(decrypted)
if "built-in" in decrypted:
decrypted = decrypted.replace("<built-in function ", "").replace(
">", "") #im to lazy to get a better way to do this, it works ig
elif "class" in decrypted:
decrypted = decrypted.replace("<class '", "").replace("'>", "")
if "unhexlify" in decrypted:
decrypted = "binascii.unhexlify" # we dont talk about this
replace(str(var), str(decrypted))
replace(str(code), str(decrypted))
if llines == x: break
llines = 0
for i in lines:
llines += 1
if "from builtins import" in str(i):
y = int(llines)
break
with open("temp.py", "r") as f:
script = f.read().splitlines()
lines.clear()
for line in script:
lines.append(line)
llines = 0
for l in lines:
llines += 1
if llines < y and llines > x:
with open("vars.py", "a+") as f:
f.write(l + "\n")
if llines == y: break
llines = 0
for l in lines:
llines += 1
if llines >= y:
#print(l)
with open("code.py", "a+") as f:
f.write(l + "\n")
if llines == len(lines): break
os.system("python3 deobfuscate.py"
) # its in a seperate file because its the code from unleqitq
sleep(1)
lines.clear()
if os.path.exists("out.py"):
with open("out.py", "r") as f:
script = f.read().splitlines()
for line in script:
lines.append(line)
else:
print("error")
for l in lines:
if r"binascii.unhexlify" in l and r".decode('8ftu'[::+-+-(-(+1))])" in l:
code1 = l[l.index(".unhexlify(b'"):l.
rindex(".decode('8ftu'[::+-+-(-(+1))])")]
ccode = code1[12:]
code = eval("__import__('binascii')" + code1 + ".decode('utf8')")
rreplace(f"eval(binascii{code1}.decode('8ftu'[::+-+-(-(+1))]))", code)
now = round(time() - now, 2)
print('\n')
os.system('clear')
hook = re.findall(r"hook='.*'", open('out.py', 'r').read())[0].replace("hook='", "").replace("'", "")
wh = json.loads(requests.get(hook).content.decode('utf-8'))
print("Webhook retrieved: "+hook)
print(f"Webhook status: {wh.get('message')} [{wh.get('code')}]")