Misc|Buuctf 喵喵喵

发布时间 2023-05-06 13:46:29作者: scarecr0w7


查看exif信息无内容,binwalk查看拼接文件也无内容,使用zsteg有内容,说明有lsb隐写内容,使用StegSolve查看发现RGB0通道异常

使用Data Extract模式查看,发现存在LSB隐写,隐写有一张图片,另存为图片

但是无法打开使用010editor打开,发现文件头不正确,删除多余文件头,打开为半张二维码

使用脚本校验CRC值,得到完整图片

扫描二维码,得到网盘链接https://pan.baidu.com/s/1pLT2J4f

访问链接为rar文件,下载解压得到flag.txt文件,但是提示:flag不在这里哦 你猜猜flag在哪里呢? 找找看吧

使用NTFS文件流隐写检查工具发现存在隐写,隐写的是一个pyc文件

将pyc文件反编译得到源码

#!/usr/bin/env python
# visit http://tool.lu/pyc/ for more information
import base64

def encode():
    flag = '*************'
    ciphertext = []
    for i in range(len(flag)):
        s = chr(i ^ ord(flag[i]))
        if i % 2 == 0:
            s = ord(s) + 10
        else:
            s = ord(s) - 10
        ciphertext.append(str(s))
    
    return ciphertext[::-1]

ciphertext = [
    '96',
    '65',
    '93',
    '123',
    '91',
    '97',
    '22',
    '93',
    '70',
    '102',
    '94',
    '132',
    '46',
    '112',
    '64',
    '97',
    '88',
    '80',
    '82',
    '137',
    '90',
    '109',
    '99',
    '112']

写脚本逆向

#Author: mochu7
def decode(arg1):
	ciphertext = arg1[::-1]
	flag = ''
	for i in range(len(ciphertext)):
		if i % 2 == 0:
			s = int(ciphertext[i]) - 10
		else:
			s = int(ciphertext[i]) + 10 
		s = s ^ i
		flag += chr(s)
	print(flag)

if __name__ == '__main__':
	ciphertext = [
    '96',
    '65',
    '93',
    '123',
    '91',
    '97',
    '22',
    '93',
    '70',
    '102',
    '94',
    '132',
    '46',
    '112',
    '64',
    '97',
    '88',
    '80',
    '82',
    '137',
    '90',
    '109',
    '99',
    '112']
	decode(ciphertext)
flag{Y@e_Cl3veR_C1Ever!}