当前位置:网站首页>[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}
边栏推荐
- 20个不容错过的ES6技巧
- .NET7之MiniAPI(特别篇) :Preview5优化了JWT验证(上)
- JVM调试工具-jstack
- 0 foundation a literature club low code development member management applet (III)
- OMX initialization process
- 机器人迷雾之算力与智能
- FreeRTOS MPU makes the system more robust!
- JVM debugging tool -jmap
- Accelerate large-scale data analysis based on Apache iceberg through data organization optimization
- MFC多线程 信号量CSemaphore 临界区与互斥 事件
猜你喜欢
随机推荐
【图像融合】基于像素显着性结合小波变换实现多焦点和多光谱图像融合附matlab代码
An example of MySQL accidental deletion recovery - using Myflash
Win11分磁盘怎么分?Win11系统怎么分磁盘?
Spark parameter tuning practice
超宽带脉冲定位方案,UWB精准定位技术,无线室内定位应用
Spark累加器和广播变量
[problem solving] virtual machine configuration static IP
JVM调试工具-jmap
One year since joining Tencent
Vmware tools still exist after normal uninstallation for many times. How to solve it
Unexpected token u in JSON at position 0
PCL 计算多边形的面积
Go operation SQLite code error
【pointNet】基于pointNet的三维点云目标分类识别matlab仿真
華為雲數據庫進階學習
Outils de débogage JVM - Arthas
On update current in MySQL_ TIMESTAMP
JVM debugging tool -arthas
Introduction to game design and development - layered quaternion - dynamic layer
2、 What is the principle of layer 3 and 4 switching technology? Recommended collection!







