当前位置: 首页 > news >正文

202404_QQ_ZIP嵌套

Tags:ZIP,嵌套

0x00. 题目

附件路径:https://pan.baidu.com/s/1GyH7kitkMYywGC9YJeQLJA?pwd=Zmxh#list/path=/CTF附件

附件名称:202404_QQ_ZIP嵌套.zip

0x01. WP

  • 打开txt文件发现文件头为504b0304
  • 导入到010Editor另存为tmp.zip
  • 打开tmp.zip发现里面是另一个txt
  • 打开txt文件发现又是个文件头为504b0304,重复步骤1
  • 尝试编写脚本进行循环解码,最终得到flag

exp.py

import os
import zipfile# 计数器
iNum=1# 删除zip.txt,并将50.txt另存为zip.txt
if os.path.exists("zip.txt"):os.remove("zip.txt")with open("50.txt", "rb") as source_file:with open("zip.txt", "wb") as target_file:target_file.write(source_file.read())# 循环爆破
while True:with open('zip.txt', 'r') as file:content = file.read()print(iNum, content[0:50])iNum+=1if content[0:8]!="504b0304":break# 将zip.txt内容以十六进制方式写入tmp.zipbinary_data = bytes.fromhex(content)with open('tmp.zip', 'wb') as file:file.write(binary_data)# 删除zip.txtos.remove("zip.txt")# 读取tmp.zip文件with zipfile.ZipFile("tmp.zip", 'r') as zip_ref:for file_name in zip_ref.namelist():zip_ref.extract(file_name)# 解压缩文件,并将文件复制为tmp.txtwith open(file_name, "rb") as source_file:with open("zip.txt", "wb") as target_file:target_file.write(source_file.read())# 删除解压出的txt文件os.remove(file_name)# 删除tmp.zip文件os.remove("tmp.zip")
D:\=MAX230_Wiki=\题库\Archives\Misc\Archives\202404_QQ_zip嵌套>python exp.py
1 504b03041400000008001b7e2956caecbb54d78d0600e0830b
2 504b03041400000008001b7e2956fec1725d82c105002c1c0a
3 504b03041400000008001b7e295687ef0f25a80d05006ee008
4 504b03041400000008001b7e2956c968856ec96f0400eaca07
5 504b03041400000008001b7e2956a04270c907e503000ad806
... ...
46 504b03041400000008001a7e2956f74a15e9ae010000580300
47 504b03041400000008001a7e29567c1ade91400100008e0200
48 504b03041400000008001a7e29562c5e732ddb000000d00100
49 504b03041400000008001a7e295676ed28377c000000280100
50 504b0304140000000800c97a2956b55e178528000000260000
51 flag{97de6c664734b9bdf3eeb0fe265bd8df}
http://www.wxhsa.cn/company.asp?id=1303

相关文章:

  • 无重复字符的最长子串-leetcode
  • 两个常见的 计数问题 trick
  • 搜维尔科技:Xsens人形机器人拟人动作AI训练,提升机器人工作精度与效率
  • 202110_绿盟杯_隐藏的数据
  • 【初赛】图 - Slayer
  • 线上课
  • 弹窗、抽屉、当前页和新开页,到底怎么选? - 智慧园区
  • POJ 2566 Bound Found
  • 搜维尔科技:Haption触觉力反馈系统,沉浸式远程呈现、数字孪生、混合现实和移动远程机器人
  • 飞书免费企业邮箱推荐
  • CF1140F Extending Set of Points
  • Lark免费企业邮箱推荐
  • CMP 40HX在PVE9.0配置vGPU
  • 耶日奈曼:置信区间与假设检验的奠基者
  • 尚硅谷后台管理系统
  • Web语音聊天室中录音无声问题分析与解决方案
  • 25.9.11随笔联考总结
  • 20231314许城铭课上测试:Linux命令实践(AI)
  • 解决推理能力瓶颈,用因果推理提升LLM智能决策
  • sites(legal - Gon
  • vue3 使用 i18n-auto-extractor库 实现国际化
  • [题解]CF1404B Tree Tag
  • reLeetCode 热题 100-3 最长连续序列 - MKT
  • 123
  • pdf在纯html5移动端下不显示
  • 面试记录
  • GitHub Copilot 代码评审:用于自动评审的独立存储库规则
  • 树套树
  • 复制R包
  • 【Azure Developer】Java代码实现获取Azure 资源的指标数据却报错 invalid time interval input