下载附件发现是一个无后缀文件,扔winhex发现是一个rar文件
解压后发现是数据流,扔wireshark,查找关键字,发现有个flag.rar
追踪流http流,然后查看原始数据,将这串数据放到winhex另存为zip文件
解压得到一个flag.txt文件,但是需要密码
重新追踪tcp流,发现一串东西
from Crypto import Random
from Crypto.Cipher import AES
import base64
IV = b'QWERTYUIOPASDFGH' # 必须是字节类型
def decrypt(encrypted):
aes = AES.new(IV, AES.MODE_CBC, IV)
decrypted = aes.decrypt(encrypted)
return decrypted.rstrip(b'\0') # 去掉填充的空字符
def encrypt(message):
length = 16
count = len(message)
padding = length - (count % length)
message = message + '\0' * padding
message = message.encode('utf-8') # 转换为字节类型
aes = AES.new(IV, AES.MODE_CBC, IV)
encrypted = aes.encrypt(message)
return encrypted
# 示例字符串
str_message = 'this is a test'
# 加密
example = encrypt(str_message)
print("Encrypted:", example)
# 解密
decrypted_message = decrypt(example)
print("Decrypted:", decrypted_message.decode('utf-8'))
# 示例 base64 解密
s = '19aaFYsQQKr+hVX6hl2smAUQ5a767TsULEUebWSajEo='
flag = base64.b64decode(s)
decrypted_flag = decrypt(flag)
print("Decrypted flag:", decrypted_flag.decode('utf-8'))
运行出来:passwd={No_One_Can_Decrypt_Me},解压flag.txt
得到flag:
WDCTF{Seclab_CTF_2017}