注:以下题目均来源于ctf.show
misc50 题目链接ctf.show
拿到题目附件首先的操作就是丢进随波逐流里面查看一下文件的各种信息
binwalk发现里面有zip还嵌套了rar
把末尾的16进制提取出来并放到cyberchef里面转换出来一个压缩包,压缩包注释是一段base32编码,解码后是123456
输入密钥得到一个txt文件,里面是好多重复数字的文本,发现3078一直重复,3078经过base16解码后刚好是0x,把3078删除后转换成压缩包格式 用以下脚本处理后得到.7z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 import redef decode_ctf_file (): input_path = r"...\thienc.txt" output_path = "test.txt" try : with open (input_path, 'r' , encoding='utf-8' ) as fp: content = fp.read().strip() hex_pairs = re.findall(r'.{2}' , content) raw_chars = "" for h in hex_pairs: try : raw_chars += bytearray .fromhex(h).decode('latin-1' ) except : continue parts = raw_chars.split('0x' ) final_strings = "" for i in parts: if i == "" : continue if len (i) == 1 : final_strings += '0' + i else : final_strings += i with open (output_path, 'w' , encoding='utf-8' ) as f: f.write(final_strings) print (f"处理完成!请查看:{output_path} " ) except FileNotFoundError: print (f"错误:在路径 {input_path} 下找不到文件,请确认文件名是否正确。" ) except Exception as e: print (f"运行过程中出现错误: {e} " ) if __name__ == "__main__" : decode_ctf_file()
但是发现压缩包是加密的,尝试爆破密钥,但是失败了,于是我回去010里面找,还真让我找到了一段comment,混合解码后得到KEY{Lazy_Man}
打开一看又是一大堆编码,不想思考了,直接上脚本
脚本地址https://github.com/sm411m0use/base_decrypt(来自战队大佬的馈赠)
接下来依次进行ook跟Brainfuck解码即可得到flag
1 flag{Welc0me_tO_cTf_3how!}
stega1 题目链接ctf.show
一道图片隐写题,要用到一个新的工具jphswin,下载链接我放下面了
1 https://pan.quark.cn/s/91529e47a5f3
下载工具后提取隐写文本再打开就可以得到flag
1 flag{3c87fb959e5910b40a04e0491bf230fb}
misc40 题目链接ctf.show
拿到题目的压缩包发现里面有两个音频文件,一个.txt和一张.png
打开.txt发是一串二进制字符,文档也给我们提示了,依次进行进制转换得到202013 转换网址在线任意进制数转换/换算工具(2进制,3进制,4进制,8进制,10进制,16进制,24进制,32进制等进制转换)
至于这串字符,我尝试提取那个加密的.wav但是失败了
接着我发现图片末尾有一串编码
解码后再进行社会主义核心价值观解码,得到123456
用MP3Stego提取MP3文件里面隐写的文本,得到了.wav的解压密码abc123
提示是静默之言,我们想到SilentEye
SilentEye下载链接https://pan.quark.cn/s/1e41224d4600
下载之后对.wav进行decode可以拿到flag 注:用AES128+high quality 密钥就是我们第一步拿到的202013
红包题第一弹 题目链接ctf.show
拿到附件打开一看好多压缩包,而且每个压缩包里面都有一张.jpg,010打开jpg发现每张jpg末尾后面都有一串base64编码,于是就去找了一下脚本再稍加修改一下(这道题我好像有印象,不知道哪里做过)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 import osimport zipfileSOURCE_DIR = r"your_path" TARGET_DIR = os.path.join(SOURCE_DIR, "extracted_imgs" ) OUTPUT_FILE = os.path.join(SOURCE_DIR, "final_flag.txt" ) def unzip_files (): """解压 1.zip 到 86.zip""" if not os.path.exists(TARGET_DIR): os.makedirs(TARGET_DIR) print (f"开始从 {SOURCE_DIR} 解压文件..." ) for i in range (1 , 87 ): zip_name = f"{i} .zip" zip_path = os.path.join(SOURCE_DIR, zip_name) if os.path.exists(zip_path): try : with zipfile.ZipFile(zip_path, 'r' ) as zf: zf.extractall(TARGET_DIR) except Exception as e: print (f"无法解压 {zip_name} : {e} " ) else : print (f"跳过:找不到文件 {zip_name} " ) def extract_base64 (): """从解压后的图片中提取末尾 100 字节""" combined_data = "" print ("正在提取图片末尾数据..." ) for i in range (1 , 87 ): img_name = f"{i} .jpg" img_path = os.path.join(TARGET_DIR, img_name) if os.path.exists(img_path): file_size = os.path.getsize(img_path) with open (img_path, 'rb' ) as f: if file_size > 100 : f.seek(file_size - 100 ) raw_bytes = f.read(100 ) try : chunk = raw_bytes.decode('utf-8' , errors='ignore' ).strip('\x00' ).strip() combined_data += chunk except Exception as e: print (f"处理图片 {img_name} 时编码出错: {e} " ) else : print (f"警告:未发现图片 {img_path} " ) with open (OUTPUT_FILE, 'w' , encoding='utf-8' ) as f_out: f_out.write(combined_data) print ("-" * 30 ) print (f"任务完成!" ) print (f"提取的总长度: {len (combined_data)} " ) print (f"结果已保存至: {OUTPUT_FILE} " ) print (f"预览前 50 位: {combined_data[:50 ]} ..." ) if __name__ == "__main__" : unzip_files() extract_base64()
将运行脚本得到的编码放入cyberchef里面得到了一个二维码,扫描后得到flag
stega10 题目链接ctf.show
拿到压缩包发现是一张图片,用随波逐流没有扫出什么东西来,但是用010打开后我们看到一串字符,解码后得到网盘链接,下载下来是有好多加密压缩包的zip
没招了,上网找WP说是用crc爆破,然后我就去搞了一个脚本,爆破出来密码为447^*5#)7
1 2 3 4 5 6 7 8 9 10 import stringimport binasciis=string.printable c =[0xF3B61B38 ,0xF3B61B38 ,0X6ABF4A82 ,0X5ED1937E ,0X09b9265b ,0x84b12bae ,0x70659eff ,0x90b077e1 ,0x6abf4a82 ] password = '' for crc in c: for i in s: if crc==(binascii.crc32(i.encode())&0xffffffff ): password =password + i print (password)
打开n.zip后发现里面的png是打不开的,好奇怪🤔,用010打开发现里面的东西都是反过来的,用cyberchef重新倒序得到一张新的png
打开发现是一个二维码,扫描后得到flag
红包题第五弹 题目链接ctf.show
拿到题目的zip文件打开一看,是一个mp3文件,听一下发现没什么特别的,但是我把压缩包放进随波逐流后发现压缩包后面还有一张jpg,在kail用foremost把图片提取出来,接着用看看是不是steghide隐写,使用命令如下
1 steghide extract -sf '/home/kali/桌面/output/jpg/00017508.jpg'
密码则使用弱口令123456
提取出一个.txt打开后是一串base64编码,解码后下载得到另外一个.txt,将txt里面的内容用cyberchef转译,得到好多坐标,感觉像是二维码,那接着把数据整理一下,再生成图片
整理数据脚本如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 import reimport osinput_path = r"your_path" output_path = r"your_path" reg = re.compile (r'\d+,\s*\d+,\s*\d+' ) try : with open (input_path, 'r' , encoding='utf-8' ) as f_in, \ open (output_path, 'w' , encoding='utf-8' ) as f_out: data = f_in.read() results = reg.findall(data) if results: for item in results: print (f"匹配到: {item} " ) f_out.write(item + '\n' ) print (f"\n--- 提取完成,结果已保存至: {output_path} ---" ) else : print ("未在文件中找到符合格式的数据。" ) except FileNotFoundError: print (f"错误:找不到文件,请检查路径是否正确:{input_path} " ) except Exception as e: print (f"发生错误:{e} " )
画图脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 from PIL import Imagex = 72 y = 74 im = Image.new("RGB" , (x, y)) file = open (r"..." ) for i in range (0 , x): for j in range (0 , y): line = file.readline() if not line: break rgb = line.split(", " ) if (rgb[0 ]): im.putpixel((i, j), (int (rgb[0 ]), int (rgb[1 ]), int (rgb[2 ]))) im.save('flag.jpg' ) file.close() print ("图片生成完毕,已保存为 flag.jpg" )
生成的图片是分成俩截的二维码,将二维码重新拼回去
扫码得到flag
红包题第八弹 题目链接ctf.show
拿到附件发现一个MP4被加密了,另外一张图片上是密钥,搜索kobe code对照翻译一下,得到了密钥OAEBEYTKNRBANB
但是发现MP4文件是损坏的,用脚本将MP4文件每个字节的十六进制高低位进行交换,脚本如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 import osdef main (): input_path = r"..." output_path = r"..." if not os.path.exists(input_path): print (f"错误:找不到文件 {input_path} " ) return print ("正在处理中..." ) with open (input_path, "rb" ) as infile, open (output_path, "wb" ) as outfile: data = infile.read() processed_data = bytearray () for byte_value in data: hex_str = format (byte_value, '02x' ) swapped_hex = hex_str[1 ] + hex_str[0 ] processed_data.append(int (swapped_hex, 16 )) outfile.write(processed_data) print (f"处理完成!修复后的文件保存在: {output_path} " ) if __name__ == '__main__' : main()
在修复后的MP4文件的2:47看到了一个二维码扫描后得到flag
1 flag{I_l0v3_pl4ying_b4sk3tb4ll}
misc21 题目链接ctf.show
emm…这道题有点一言难尽,好长的逻辑链啊,做到后面都得去看别的师傅的WP,不然根本做不下去
outguess提取隐写文件 在kali里面用outguess命令提取出图片中隐写的文件,密钥默认为123456
1 outguess -k 123456 -r '/home/kali/桌面/尝尝我的套路吧.jpg' flag.txt
outguess下载教程见这篇文章https://sonh66.github.io/2026/04/03/OutGuess%20%E9%9A%90%E5%86%99%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/
打开.txt文件发现其实是一个压缩包,改后缀为.zip发现里面的内容加密了,看一下发现不是伪加密,而且暴力破解也没有找到密钥,没招了。后面去找了其他师傅的WPctfshow-misc详解(持续更新中) - 清纯少女小琪 - 博客园
发现压缩包尾部有很多09 0A 0D 20,感觉怪怪的,把这个十六进制导出然后进行Hex转码,将得到的内容放在vscode里面可以发现好多→/.这些符号
看大佬的博客是说如下转换
1 2 3 4 tab 替换 - 空格 替换 . tab 替换/ \n 替换/
转换后得到
1 -.-./-/..-./--./---/---/-..
进行摩斯密码解密得到
用密钥打开文件得到flag
1 flag{023032132-asdasdasd-ljklkz}