2023年磐石行动第二十二周

文章讲述了如何从Run_it_36_times.pyc文件中提取隐藏的信息,通过uncompyle6反编译并发现secret变量中的pyc隐写技术。接着介绍了使用PLTE方法从图片中提取隐藏信息的过程,通过010edit工具解析00和FF编码转换为ASCII字符。
摘要由CSDN通过智能技术生成

第二十二周 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值