这是上一年打的因为今年也要开始了,也想着写一写,最近太忙了所以这篇更新比较慢
签到
01.网络安全知识竞赛(预赛)
枚举法直接做就行了

02.签到题(预赛)
Base92 -> Ascii85 -> Base64 -> Base62 -> Base58 -> Base45 -> Base32
最后结果为DASCTF{welcome_to_zjctf_2024}
Misc
01.RealSignin(预赛)
文件尾存在字符
dEFfc1dGq1pxMgMWnihrMx9mewNgdvIWMvctrc

0通道发现base码表
<font style="color:rgb(44, 62, 80);">ABCDEFGHIJKLMNabcdefghijklmnopqrstuvwxyzOPQRSTUVWXYZ0123456789+/</font>

用CyberChef进行解码得到flagDASCTF{We1C0me_2_ZJCTF2024!}

02.机密文档(预赛)
加密文件,尝试爆破最后确认为明文爆破
echo -n "the_secret_you_never_ever_know_hahahaha" > plain.out
# 创建明文文件
./bkcrack -C jmwd.zip -c the_secret_you_never_ever_know_hahahaha.zip -p plain.out
# 使用bkcrack破解加密密钥 b8edf1ff c1f93a7e f93d08e0
./bkcrack -C jmwd.zip -k b8edf1ff c1f93a7e f93d08e0 -U 1.zip 123
# 使用加密密钥破解写到新文件 密码为最后123
存在一个禁宏文档

利用olevba对文档的vba代码提取
也可以直接在线解http://tools.bugscaner.com/office/word-parser-vba.html
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Attribute VB_Name = "NewMacros"
Sub key()
Dim decValues As Variant
Dim str As String
Dim result As String
Dim i As Integer
Dim xorValue As Integer
decValues = Array(26, 25, 28, 0, 16, 1, 74, 75, 45, 29, 19, 49, 61, 60, 3)
str = "outguess"
result = ""
For i = LBound(decValues) To UBound(decValues)
xorValue = decValues(i) Xor Asc(Mid(str, (i Mod Len(str)) + 1, 1))
result = result & Chr(xorValue)
Next i
End Sub
脚本大意:
使用"outguess"作为密钥
对数组中的每个数值与密钥对应字符的ASCII值进行XOR运算
将结果转换为字符并拼接成字符串
所以只要转换回去即可
from pwn import xor
dec_values = bytes([26, 25, 28, 0, 16, 1, 74, 75, 45, 29, 19, 49, 61, 60, 3])
key_str = b"outguess"
result = xor(dec_values, key_str).decode()
print(result)
# ulhged98BhgVHYp根据密钥outguess可以猜测加密方式,结合docm中的图片可以直接用outguess解密密钥为ulhged98BhgVHYp
这里有个重点后缀得改jpeg,不然识别不了
outguess -K "ulhged98BhgVHYp" -r '/root/桌面/image1.jpg' -t 1.txt

获得flag:DASCTF{B1g_S3CR3t_F0R_Y0u}
FinalSign(决赛)

snow隐写查看出现xorkey


DASCTF{F1nal_Sign1n_D0ne}
天命人(决赛)






看前面的很明显是压缩包编码,通过脚本提取压缩包,里面包含两个压缩包

很明显根器得要crc碰撞

通过工具爆破出密码

解压后有两个文件一个金箍棒.png一个紧箍咒,看png可以发现存在等距像素点隐写

通过脚本处理后发现为veracrypt加密的磁盘文件,这里利用工具将图片为密钥以及处理结果的密码来读取
import os
import re
import cv2
import argparse
import itertools
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('-f', type=str, default=None, required=True,
help='输入文件名称')
parser.add_argument('-p', type=str, default=None, required=True,
help='输入左上顶点和右下顶点坐标(如:-p 220x344+3520x2150)')
parser.add_argument('-n', type=str, default=None, required=True,
help='输入宽度间隔和高度间隔(如:-n 44x86)')
parser.add_argument('-size', type=str, default='1x1', required=False,
help='输入截取图像的大小(如:-size 7x7)')
parser.add_argument('-resize', type=int, default=1, required=False,
help='输入截取图像放大倍数(如:-resize 1)')
args = parser.parse_args()
if __name__ == "__main__":
if re.search(r"^\d{1,}x\d{1,}\+\d{1,}x\d{1,}$", args.p) and re.search(r"^\d{1,}x\d{1,}$", args.n) and re.search(r"^\d{1,}x\d{1,}$", args.size):
x1, y1 = map(lambda x: int(x), args.p.split("+")[0].split("x"))
x2, y2 = map(lambda x: int(x), args.p.split("+")[1].split("x"))
width, height = map(lambda x: int(x), args.n.split("x"))
width_size, height_size = map(lambda x: int(x), args.size.split("x"))
img_path = os.path.abspath(args.f)
file_name = img_path.split("\\")[-1]
img = cv2.imread(img_path, cv2.IMREAD_COLOR)
row, col = img.shape[:2]
r, c = len(range(y1, y2 + 1, height)), len(range(x1, x2 + 1, width))
new_img = np.zeros(shape=(r * height_size * args.resize, c * width_size * args.resize, 3))
for y, x in itertools.product(range(r), range(c)):
for y_size in range(height_size):
for x_size in range(width_size):
# new_img[y * height_size + y_size, x * width_size + x_size] = img[y1 + y * height + y_size, x1 + x * width + x_size]
pt1 = ((x * width_size + x_size) * args.resize, (y * height_size + y_size) * args.resize)
pt2 = ((x * width_size + x_size + 1) * args.resize, (y * height_size + y_size + 1) * args.resize)
color = img[y1 + y * height + y_size, x1 + x * width + x_size].tolist()
cv2.rectangle(new_img, pt1=pt1, pt2=pt2, color=color, thickness=-1)
# cv2.imshow(new_img)
cv2.imwrite(f"_{file_name}", new_img)
print("已保存到运行目录中..")
else:
print("参数-p或参数-n或参数-size输入错误!")


DASCTF{T1m3_t0_F4Ce_De5t1nY}
非黑即白(决赛)
逆序得到gif文件,对他分帧处理,一共1536个图片


因为无法开根and图片属性几乎没区别,可以放弃考虑转换为二维码or图片隐写,这里可以尝试方向黑白01,摩斯电码等
通过脚本提取二进制数据

数据还原得到压缩包文件提取后存在加密

通过观察gif发现开始的帧间隔不一样,提取后解码得到压缩包密码
identify -format "%s %T \n" flag.gif > 1.txt


DASCTF{H3r3_1s_C0L0rful_W0rld}
评论已关闭