BUUCTF:[安洵杯 2019]easy misc

题目来源:https://buuoj.cn/challenges#[%E5%AE%89%E6%B4%B5%E6%9D%AF%202019]easy%20misc

很早很早之前就写过这题,一直没做出来,我爷爷看到估计得高兴死

foremost分离+掩码+盲水印+词频统计

题给了三个文件

read文件夹

全是txt文件,里面是英文文章

文件夹末尾有一个hint

应该是词频统计,取出现频率最高的前十六个字符

可不知道看哪一个txt文件

再看压缩包,加密,但注释有提示

前面的算式解出来是7

七个数字+字符串掩码

得到密码2019456NNULLULL,

一张替换表

最后是那张png

foremost分离出两张一样的png,盲水印

盲水印github地址GitHub - chishaxie/BlindWaterMark: 盲水印 by python

有py2和py3两种

我用的python3的那个脚本

python bwmforpy3.py decode hui.png hui_with_wm.png wm_from_hui.png

命令中原图放后面有水印的图放前面,不过顺序对得到的图片影响不大,只是颜色亮暗一点,可以都试一下

需要安装库

pip install opencv-python
pip install matplotlib==2.1.1

假如如下报错

在图示代码间加入import sys(就是选中的那行

成功导出

然后图片长这样

交换一下两张图片顺序

然后尝试在命令后面加--oldseed

有了,选11.txt

词频统计

import re

file = open('D:/edge/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

替换

etaonrhisdluygw
-->QW8obWdIWT9pMkFSQWtRQjVfXiE/WSFTajBtcw=

base64(网上有说少个等号,不过用CyberChef的话好像没关系CyberChef (chinabaiker.com)

base85CTF在线工具-在线base85编码|在线base85解码|base85编码|base85解码 (hiencode.com)

flag{have_a_good_day1}

参考:https://blog.csdn.net/qq_24033605/article/details/117304045
https://blog.csdn.net/brightendavid/article/details/116749624
https://blog.csdn.net/qq_50898079/article/details/112060543
posted @ 2022-06-28 20:23  B0mbax  阅读(553)  评论(0编辑  收藏  举报