太强了,感谢楼主分享!
一个一个的调用 openssl 解密太麻烦了,写了个 python 脚本,放在目录里执行自动解密
[Python] 纯文本查看 复制代码 import os
from base64 import b64decode
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding
def dec(filename):
with open(filename, 'rb') as file:
fileb = b64decode(file.read())
iv = fileb[:16]
key = bytes.fromhex('4EE1B382949A024B802F52B4B4FE57F1BEF40853109256E2C20DECA3DD8DD56D')
cipher = Cipher(algorithms.AES(key), modes.CBC(iv))
decryptor = cipher.decryptor()
filed = decryptor.update(fileb[16:]) + decryptor.finalize()
dest = open(filename+'-dec.js', 'wb')
unpadder = padding.PKCS7(128).unpadder()
data = unpadder.update(filed) + unpadder.finalize()
dest.write(data)
dest.close()
point = os.walk('.')
for pwd, dirl, filel in point:
for filename in filel:
if filename.endswith('js'):
dec(filename)
|