BUUCTF easy misc

[安洵杯 2019]easy misc

在这里插入图片描述有一个带密码的压缩包,一张图片和一个目录,翻翻看吧。

在这里插入图片描述先从压缩包入手吧,看看有什么
在这里插入图片描述
发现有提示,根据提示算出答案为7。”7+NNULLULL,"是什么意思呢?试着解压也不对,暂时放一边。

再用binwalk分析小姐姐.png,没有发现什么东西,改用foremost得到两张png图片:

foremost 小姐姐.png

在这里插入图片描述
用Stegsolve查看也没有看出所以然来。再看看read目录,有多个txt文档:
在这里插入图片描述
打开hint.txt,提示:hint:取前16个字符。搞不懂什么意思,这时候陷入了僵局。再回头分析”7+NNULLULL,",会不会是提示密码为7个字符和“NNULLULL”的组合,试着用ARCHPR 4.54的掩码解密:
在这里插入图片描述果真解出密码:2019456NNULLULL,
在这里插入图片描述解压decode.zip,打开decode.txt:
在这里插入图片描述 这又是什么?借鉴借鉴别人的经验吧。根据大佬提示,用盲水印分析得到的两张png图片,使用工具BlindWaterMark。我的python是3.9版本,使用“bwmforpy3.py”

python bwmforpy3.py decode 00000000.png 00000232.png result.png

但是解出来好像不对:

在这里插入图片描述工具里有个说明:注意程序python2和python3版本的加解密结果会有所不同,主要原因是python2和python3 random的算法不同,如果要让python3兼容python2的random算法请加 --oldseed参数。
因此,加上“–oldseed”:

python bwmforpy3.py decode 00000000.png 00000232.png result.png --oldseed

得到图片:
在这里插入图片描述
在11.txt里有文章。根据大佬提示,进行字频统计,再取字频最高的前16个字符,用decode.txt里的内容替换。上代码:

这里引用别人的代码,在此表示感谢:
import re

file = open('C:/Users/LENOVO/Downloads/attachment/read/11.txt')	#根据路径自行调整
line = file.readlines()
file.seek(0,0)
file.close()

result = {
    
    }
for i in range(97,123):
	count = 0
	for j in line:
		find_line = re.findall(chr(i),j)
		count += len(find_line)
	result[chr(i)] = count
res = sorted(result.items(),key=lambda item:item[1],reverse=True)

num = 1
for x in res:
		print('频数第{0}: '.format(num),x)
		num += 1

运行结果:
在这里插入图片描述替换结果:

QW8obWdIWT9pMkFSQWtRQjVfXiE/WSFTajBtcw==

用BASE64解码:

Ao(mgHY?i2ARAkQB5_^!?Y!Sj0ms

再用BASE85解码:
在这里插入图片描述

flag{
    
    have_a_good_day1}

到此全部结束,非常曲折。祝您今天过得愉快 !

猜你喜欢

转载自blog.csdn.net/wangjin7356/article/details/122143952