当前位置:网站首页>[MRCTF2020]千层套路
[MRCTF2020]千层套路
2022-06-24 06:43:00 【[mzq]】
[MRCTF2020]千层套路
题目地址 : https://buuoj.cn/challenges#[MRCTF2020]%E5%8D%83%E5%B1%82%E5%A5%97%E8%B7%AF
解压压缩包,发现是密码竟然是压缩包名称,再根据题目,tnnd又是套娃题

import zipfile
file_path = input('path : ')#压缩包路径
path = "/Users/mzq/Desktop/ctf/buuctf/misc/[MRCTF2020]千层套路/"
# path = file_path[0:len(file_path)-len(file_path.split('//')[-1])]
print(path)
n = 0
s2 = ""
def extract():
i = file_path.split('\\')[-1]#递归解压压缩包名称
print(i)
str1 = ''
for x in range(1000):
ss = i[:i.find(".")]
print(ss)
zpf = zipfile.ZipFile( path+ss + ".zip")
list = zpf.namelist()
#print(list)
print(x + 1)
for f in list:
#print(f)
passwd = ss
#passwd = f.split('.')[0]#压缩包密码
#print(passwd)
zpf.extract(f, path, bytes(passwd.encode('utf-8')))
if 'zip' in f:
print(path, passwd)
i = str(f)
extract()

最后解出来了一个qr.zip
qr.zip解压后得到qr.txt ,里面都是一些像素值,或者是坐标值

使用脚本拼图
from PIL import Image
file=open('qr.txt')
MAX=200
picture=Image.new("RGB",(MAX,MAX))
for y in range(MAX):
for x in range(MAX):
string =file.readline()
picture.putpixel([x,y],eval(string)) #直接使用eval()可以转为元组
picture.show()

MRCTF{ta01uyout1nreet1n0usandtimes}
边栏推荐
- Are internal consultants and external consultants in SAP implementation projects difficult or successful? [English version]
- Canal安装配置
- 0 foundation a literature club low code development member management applet (6)
- 2、 What is the principle of layer 3 and 4 switching technology? Recommended collection!
- Why use lock [readonly] object? Why not lock (this)?
- Clickhouse source code note 6: exploring the sorting of columnar storage systems
- System design: partition or data partition
- 在js中正则表达式验证小时分钟,将输入的字符串转换为对应的小时和分钟
- 基因检测,如何帮助患者对抗疾病?
- PCL 计算多边形的面积
猜你喜欢
随机推荐
在js中正则表达式验证小时分钟,将输入的字符串转换为对应的小时和分钟
Decryption of the original divine square stone mechanism
利用微搭低代码实现级联选择
华为云图引擎服务
Graduation season advance technology
You have a chance, here is a stage
Arduino raised $32million to enter the enterprise market
. Net7 miniapi (special part):preview5 optimizes JWT verification (Part 1)
C: use of mutex
【WordPress建站】6. 文章内容防复制
取模软件 模拟显示验证取模数据正确性 逆向 把点阵数组bin文件转显示
A case study of apiserver avalanche caused by serviceaccount
Win11怎么设置让CPU性能全开?Win11CPU怎么设置高性能模式?
JVM debugging tool -jps
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
Why use lock [readonly] object? Why not lock (this)?
Audio knowledge (V) -- data processing
【图像融合】基于伪 Wigner 分布 (PWD) 实现图像融合附matlab代码
【图像融合】基于方向离散余弦变换和主成分分析的图像融合附matlab代码
System design: partition or data partition








