xhell6解密脚本

xhell6解密脚本

import hashlib
import base64

string = "nt authority\system S-1-5-18"


# ######## sha256 ########

sha256 = hashlib.sha256()
sha256.update(string.encode('utf-8'))
res = sha256.hexdigest()
print("sha256加密结果:",res)

# ######## hash ########   密钥
str_hash = hash(res)
print("hash结果:",str_hash)




from Crypto.Cipher import ARC4
from Crypto.Hash import SHA
from Crypto.Random import get_random_bytes

# 要加密的内容
data = b"YF1MbSdsnlnu1KPih3W0zczq/a6cI4844zJzmHbRilTw+7P1INIcxfw="
# 流加密密码长度是可变的,RC4为40到2048位
# 一般上使用一个字符串作为初始密钥,然后再用sha1等生成真正的密钥
# 我们这是直接点,随机生成16字节(即128位)作为密钥
# key = get_random_bytes(16)
key = base64(str_hash)
# 实例化加密套件
cipher = ARC4.new(key)
# 加密内容
encrypted_data = cipher.encrypt(data)

# 注意在即便加解密像这里一样在同一文件里,解密时一定要重新实例化不然解密不正确
cipher = ARC4.new(key)
# 解密,如无意外data为前边加密的b"123456"
data = cipher.decrypt(encrypted_data)

print(data)
posted @ 2022-11-20 21:14  是谁走漏了消息  阅读(25)  评论(0编辑  收藏  举报