羊城杯初赛部分misc

发布时间 2023-09-26 21:25:48作者: Mar10

羊城杯初赛部分misc

Ez_misc

i春秋刚考过的CVE,win11截图漏洞CVE-2023-21036(acropalypse)

https://github.com/frankthetank-music/Acropalypse-Multi-Tool

看见这个文件结构就可以尝试一下

做完才知道文件尾的zip是有用的..

把zip头的 04 03 改回 03 04 ,根据txt文件名和key是数字猜到是Gronsfeld加密 Gronsfeld Cipher (online tool) | Boxentriq

解出后得到的hint是 截图工具

ai和nia的交响曲

wireshark打开,一键导出HTTP对象

其中flag2.zip是伪加密

0宽隐写,emmm那就先去处理flag1

image-20230907131217248

upload.php上传了名为flag1.png的图片,把它拿出来

黑白杂色图,有点像二维码但扫不出来,读取一下像素点

from PIL import Image	
pic=Image.open('1.png')
weith,height=pic.size
#print(weith,height)
# 400*400
str=''
print(pic.getpixel((0,0)))
for i in range(weith):
    for j in range(height):
        print(pic.getpixel((i,j)))

发现有22种但半黑半白(还是b神的工具看着清楚)

转01

from PIL import Image	
pic=Image.open('1.png')
weith,height=pic.size
#print(weith,height)
# 400*400
str=''
#print(pic.getpixel((0,0)))
for i in range(height):
    for j in range(weith):
        r,g,b = pic.getpixel((i,j))
        if r > 200:
            str+='1'
        else:
            str+='0'
#print(str)
out_file=open('out.txt','w').write(str)

得到HINT:BV1wW4y1R7Jv&&FLAG1:@i_n1a_l0v3S_

一看就是b站的bv号,访问一下

image-20230907130801383

那刚才flag2.txt可以用上了,时间就是视频中的秒数所对应的字符,根据后续上的hint 每行时间+1,得到 CAOCAOGAIFAN

拼接得到最终flag:@i_n1a_l0v3S_CAOCAOGAIFAN

Matryoshka

直接foremost能得到两张猫咪图,一眼盲水印,是py2的bwm

出题人该死,那么大个W结果是小写,watermark_is_fun (即密码)

还有个文件是encrypt ,那么就是veracrypt挂载咯(用passware也能检测出来)

挂载后得到的文本依旧有0宽
‌‌‌‌‍‬‬‌‌‌‌‍‬‌‍image-20230907133121094

密钥有了,base32 + 维吉尼亚

image-20230907133307663

程序猿Quby

图片是夏多密码,参考犯罪大师本周解密 夏多密码解析_游戏攻略 (bilibili.com)

解得HAVEANICEDAY

图片尾分离出一个rar,cloacked-pixel拿到rar密码:we1c0met0ycbCTF!!!

python2 lsb.py extract QUBY.png flag.txt HAVEANICEDAY

image-20230907134947284

表格有隐藏行

image-20230907141113778

展开后全选更改颜色,发现隐藏数据,猜测是转黑白色,即excel转图片

image-20230907141149627

两图拼接,翻转

from PIL import Image
import pandas
s=55
s1=60
e=1023
e1=1028
r=63

img1=Image.new("1",(1050,140))

x1=pandas.read_excel("奇怪的账单1.xlsx")
x1values=x1.values
for i in range(s-2,e-2):
    for j in range(0,r):
        if x1values[i][j]>=5:
            img1.putpixel((i,j),255)
        else:
            img1.putpixel((i,j),0)

x2=pandas.read_excel("奇怪的账单2.xlsx")
x2values=x2.values
for i in range(s1-2,e1-2):
    for j in range(0,r):
        if x2values[i][j]>=5:
            img1.putpixel((i-5,j+63),255)
        else:
            img1.putpixel((i-5,j+63),0)
img1=img1.transpose(Image.FLIP_LEFT_RIGHT)
img1.save('img.png')

得到密码w0wyoudo4goodj0b

尝试DeepSound,解密得到flag.txtfl4g.txt

fl4g.txt中的字符串先base85在base32,得到sQ+3ja02RchXLUFmNSZoYPlr8e/HVqxwfWtd7pnTADK15Evi9kGOMgbuIzyB64CJ

观察发现恰好是64位,从a-z,A-Z,0-9,+,/ 猜测是base换表,flag.txt中的值作为密文

Easy_VMDK

zip有备注,且压缩算法为zipcrypto,直接打一手明文攻击

小明这次使用了32Bytes的随机密码,这次总不会被爆破出来了吧!!
小明压缩了好了题目后,他发现压缩后大小比压缩前还大啊,这不就没有压缩啊,这是为什么啊!

vmdk的文件头都是一样的,伪造12字节的文件头

image-20230907143558511

image-20230907143314203

从vmdk中可以导出key.txtflag.zip,分离一下,可以得到flag.txtpng2txt.py

显然py告诉我们的是key.txt的转换过程,写个还原脚本

import cv2
import base64
import numpy as np

# 读取 key.txt 文件内容
with open("key.txt", "r") as f:
    lines = f.readlines()

# 创建空白图像
img = np.zeros((137, 2494), dtype=np.uint8)

# 还原图像像素值
for y in range(137):
    for x in range(2494):
        # 解码 base64 数据
        encoded_data = lines[y * 2494 + x].strip()
        decoded_data = base64.b85decode(encoded_data.encode())

        # 获取像素值
        pixel_value = int.from_bytes(decoded_data, byteorder='big') % 256

        # 设置图像像素
        img[y, x] = pixel_value

# 保存还原后的图像
cv2.imwrite("restored_key.png", img)

restored_key

解压得到flag