第二十二周 20230912
1、Run_it_36_times
题目下载之后就是Run_it_36_times.pyc
然后直接uncompyle6反编译,得到py脚本
# uncompyle6 version 3.9.0
# Python bytecode version base 3.6 (3379)
# Decompiled from: Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
# Embedded file name: ./1\111.py
# Compiled at: 2021-09-27 14:35:46
# Size of source mod 2**32: 491 bytes
secret = 'You don鈥檛 need to restore me to know that the test site is the steganography of pyc.'
def encode(data, encoding='utf-8'):
if isinstance(data, str):
data = data.encode(encoding)
out = [240, 159, 0, 0] * len(data)
for i, b in enumerate(data):
out[4 * i + 2] = (b + 55) // 64 + 143
out[4 * i + 3] = (b + 55) % 64 + 128
return bytes(out)
f = open('hint', 'wb')
f.write(encode(secret))
f.close()
print('See ./hint !')
# okay decompiling .\Run_it_36_times.pyc
看到secret发现提示pyc隐写,那么直接stegosaurus.py
提取隐写隐写,如果报错的话,尝试换不同版本的python
2、PLTE
通过010edit打开图片发现00和FF组成的内容,然后提取变为01发现不对,后来大神提示将000000转为0,fffffff转为1
直接写脚本如下:
with open('./plte.png','rb') as f:
datas = f.read()
begin = 0x29
end = 0x329
find = datas[begin:end]
num_0 = b'\x00\x00\x00'
num_1 = b'\xff\xff\xff'
flag_bin = ''
for i in range(0,len(find),3):
if num_0 == find[i:i+3]:
flag_bin += '0'
elif num_1 == find[i:i+3]:
flag_bin += '1'
for i in range(0,len(flag_bin),8):
print(chr(int(flag_bin[i:i+8],2)),end='')
#81d2909e85b71a1a610a8d1b5f14e0b4