BUUCTF:https://buuoj.cn/challenges
题目描述:
得到的 flag 请包上 flag{} 提交。
密文:
下载附件,得到一个.png图片。
解题思路:
1、使用QR research扫一下,得到“swpuctf{flag_is_not_here}”的提示。
2、放到010 Editor中看一下,没找到什么明显的特征。使用Kali中的binwalk工具进行检测,发现四个rar压缩包。
使用binwalk加上“-e”参数,直接分离rar压缩包。
binwalk -e BitcoinPay.png
#如果出现报错,可以尝试在命令后加上“--run-as=root”参数
binwalk -e BitcoinPay.png --run-as=root
解压三个没有密码的压缩包,得到encode.txt、flag.doc、flag.jpg还有一个rar压缩包。有两个压缩包提示需要密码,暂时无法解压。
3、先看encode.txt文件,打开发现是经过Base64加密的密文,使用在线工具解密,得到明文。
BASE64加密解密
YXNkZmdoamtsMTIzNDU2Nzg5MA==
asdfghjkl1234567890
4、再看flag.doc文件,打开发现也是Base家族,不过这个要循环解密很多次。我是使用工具不断复制粘贴解出明文的,后面找到一个Python脚本可以更快的完成这个任务。
Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVmpBeFYySkVUbGhoTVVwVVZtcEJlRll5U2tWVWJHaG9UVlZ3VlZadGNFSmxSbGw1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFjVkZ0UmxSTmJFcEpWbTEwYTFkSFNrZGpSVGxhVmpOU1IxcFZXbUZrUjA1R1UyMTRVMkpIZHpGV1ZFb3dWakZhV0ZOcmFHaFNlbXhXVm1wT1QwMHhjRlpYYlVaclVqQTFSMWRyV25kV01ERkZVbFJHVjFaRmIzZFdha1poVjBaT2NtRkhhRk5sYlhoWFZtMXdUMVF3TUhoalJscFlZbFZhY1ZadGRHRk5SbFowWlVaT1ZXSlZXVEpWYkZKSFZqRmFSbUl6WkZkaGExcG9WakJhVDJOdFJraGhSazVzWWxob1dGWnRNWGRVTVZGM1RVaG9hbEpzY0ZsWmJGWmhZMnhXY1ZGVVJsTk5XRUpIVmpKNFQxWlhTa2RqUmxwWF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hNVnBNVmtSR1YyUkhWa2xVYXpsVFlrZDNNVlpIZUZaT1YwWklVMnRhYWxKdGVHRldiRnAzWkd4YWNWTnJaR3BoZWxaWVZsZDRhMVV4V25WUmFscFhZbGhvYUZWcVJtdFhSa3B5V2taV2FWSXhTblpXUmxKRFUyc3hjMWR1VW10U00xSlFWVzB4TkZkR1duTmhTRTVYVWpCV05Ga3dXbk5XTURGSVlVVlNWMDFHY0doWmVrWnJaRlp3UjFSck5WZGhNV3QzVm0xd1MwMUdVWGhYYmxKVVlURndWVmxyV25kV2JGcHpWMnRrVGsxV1draFZiRkp6VlZaV1ZVMUVhejA9
Python脚本如下:
import re
from base64 import b64decodedef process_data(data):try:# 删除包含'flag'或汉字字符的部分data = re.sub(r'flag|[一-龥]', '', data)# 进行Base64解码decoded_data = b64decode(data)return decoded_data.decode(), Trueexcept:# 如果无法解码,返回原始数据和False表示无法继续解码return data, False# 读取文本文件内容
with open('flag.txt', 'r', encoding='utf-8') as file:data = file.read()iterations = 0# 循环处理数据,直到无法继续解码
while True:data, can_decode = process_data(data)iterations += 1
# 如果无法继续解码,输出结果并结束循环if not can_decode:print("最终结果:", data)print("循环次数:", iterations)break
comEON_YOuAreSOSoS0great
5、分别用解出的两个明文去解压两个需要密码的rar压缩包,得到两个文件夹。good文件夹内有一个.mp3文件,另一个文件夹内有一张出现过的图片flag.jpg。
先看good.mp3文件,得到一个音频,放到Audacity看看。
放大后看到一串音频,有很多分组,分组内由粗的音块和细的音块组成,类似莫尔斯电码的“-”和“.”。
举例如下图。按照这样的对应将音轨上的分组全部转译为莫尔斯电码,分组之间用空格填充,转换为“-- — .-. … . … … …- . .-. -.-- …- . .-. -.-- . .- … -.–”
-- --- .-. ... . .. ... ...- . .-. -.-- ...- . .-. -.-- . .- ... -.--
使用在线网站,将莫尔斯电码转换为明文字符,将得到的明文转换为小写,作为flag值提交。
在线摩斯密码翻译器
字母大小写转换工具
6、至于那两张重复的图片,似乎和开始的那个二维码一样,是烟雾弹。(这道题真是一堆东西,睡觉去了!@_@)
flag:
flag{morseisveryveryeasy}