当前位置:网站首页>第14届全国大学生信息安全竞赛-创新实践能力赛

第14届全国大学生信息安全竞赛-创新实践能力赛

2022-08-10 20:30:00 MssnHarvey

前言

CTF高考好耶!

第一卷-Web

easy_source

来源于:https://r0yanx.com/2020/10/28/fslh-writeup/

php反射,使用ReflectionMethod内置类的getDocComment方法 , 然后爆破一下rb的值得知函数名q,进而得到flag:CISCN{1yVxf-Nt5Gc-ITZhp-6rqwI-2sE6S-} payload:

http://114.116.229.178:25042/?rc=ReflectionMethod&ra=User&rb=q&rd=getDocComment

easy_sql

报错注入 + 无列名注入 卷不动了~

第一卷-Misc

tiny_traffic

首先在流量包中提取出test与secret两个br文件 接着我们找到脚本解码得到对应的proto3文件test1、secret1 附上下载地址(提取码:ddql)

python brotlipython.py test test1
python brotlipython.py secret secret1

最后在用protoc解密,整理得到flag:CISCN{e66a22e23457889b0fb1146d172a38dc}

protoc --decode=PBResponse test1 < secret1

附上安装protoc命令(Linux-kali)

PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP

running_pixel

首先分解gif(得分解为png或者bmp的,要是jpg最后整出来可能会导致像素信息损失)

convert running_pixel.gif ./out/out.png

接着把每一帧的rgb是233 233 233的像素放到一张图上,跑下脚本得到画好的382张图 关键就在于通过对比每十帧里的相同的图片,进而找到(233,233,233)这个点 最后解出来了出题人还要恶心你一下,一帧一帧按顺序去看就能得到flag:CISCN{12504d0f-9de1-4b00-87a5-a5fdd0986a00}(PS:382张图,字还特小)

放个flag的gif演示图

附上脚本

from PIL import Image
import matplotlib.pyplot as plt

IMG = Image.new("RGB", (400,400), (0,0,0))
res = []
for m in range(382):
    img = Image.open('./out/out-'+str(m)+'.png').convert('RGB')
    t = ''
    for i in range(400):
        for j in range(400):
            p1 = img.getpixel((i,j))
            if p1==(233,233,233):
                IMG.putpixel((j,i),(255,255,255))
    IMG.save('./gif/'+str(m)+'.png')
print(len(res))
plt.imshow(IMG)
plt.show()
IMG.save('flag.png')

第一卷-Reverse

glass

反编译发现在so层加密,解包打开IDA,分析函数得知是rc4加密,跑下脚本得到flag:CISCN{6654d84617f627c88846c172e0f4d46c}

附上脚本

from Crypto.Cipher import ARC4

res = [0xA3, 0x1A, 0xE3, 0x69, 0x2F, 0xBB, 0x1A, 0x84, 0x65, 0xC2, 0xAD, 0xAD, 0x9E, 0x96, 0x05, 0x02, 0x1F, 0x8E, 0x36, 0x4F, 0xE1, 0xEB, 0xAF, 0xF0, 0xEA, 0xC4, 0xA8, 0x2D, 0x42, 0xC7, 0x6E, 0x3F, 0xB0, 0xD3, 0xCC, 0x78, 0xF9, 0x98, 0x3F]
key = b"12345678"
rc4 = ARC4.new(key)
key = list(key)
for i in range(39):
    res[i] ^= key[i % 8]
for i in range(0, 39, 3):
    tmp0 = res[i]
    tmp1 = res[i+1]
    tmp2 = res[i+2]
    res[i] = tmp1 ^ tmp2
    res[i+2] = tmp0 ^ res[i]
    res[i+1] = res[i+2] ^ tmp2
print(rc4.decrypt(bytes(res)))

第二卷-Web

middle_source

session文件包含 扫描web文件得到了.listing,.listing文件内容有个php文件you_can_seeeeeeee_me.php 访问you_can_seeeeeeee_me.php是个phpinfo(),有开PHP_SESSION_UPLOAD_PROGRESS,并且拿到了session的路径: /var/lib/php/sessions/jehaahfcad/ 这样我们可以通过上传文件,然后使用文件包含执行这个/var/lib/php/sessions/jehaahfcad/sess_xxxxxxxxxx文件 phpinfo有ban了函数 , 不能执行命令,所以用scandir去读取目录

第二卷-Misc

隔空传话

首先我们拿到了一堆加密的通话数据,得知是短信编码中的PDU(但是给的数据过多,懒狗肯定想办法整个批量的 附上批量脚本

import requests
import time
import re
f = open('data.txt')
url = 'https://www.smspdu.be/'
data = {'action': 'ppdu',
        'pdu': '',
        'submit': 'Decode'}
rep = re.compile(r'<TD>(.*?)</TD>')
ff = open('out.txt','a',encoding='utf-8')
rr = f.readlines()
for i in range(len(rr)):
    c = rr[i]
    data['pdu'] = c.strip()
    r = requests.post(url,data).text
    res = re.findall(rep,str(r))
    print(c)
    print(res[20])
    ff.write(res[20]+'\n')
    time.sleep(0.5)

接着根据pdu信息里本身包含的时间信息排序,排起来就是一张png(指的是后面的16进制数据

附上排序脚本

f = open('data.txt').readlines()
f1 = open('out.txt').readlines()
res = {}
d = {}
for i in range(4,len(f)):
    l = f[i][42:44][::-1]+f[i][44:46][::-1]
    res[int(l)] = f1[i-4].strip()
    print(l)
f2 = open('final.txt','a')
for i in range(3924,4938):
    try:
        f2.write(res[i])
    except:
        pass

最后crc爆破宽度会发现前面解码给的w465意思就是宽度是465,进而整理得到flag:CISCN{15030442_b586_4c9e_b436_26def12293e4}(手动滑稽~

第三卷-Misc

robot

把TCP的第一个流导出来,然后所有的坐标都在里面,提取一下就能得到flag:CISCN{easy_robo_xx}

附上脚本

import re
from PIL import Image
import matplotlib.pyplot as plt

f = open('tmp').read()
reg = re.compile(r'tgPos.*?]')
res = re.findall(reg,f)
print(res)
print(len(res))
img = Image.new('RGB',(500,500),(255,255,255))
for i in res[:-1]:
    tmp = eval(i.split('.')[2])
    img.putpixel((tmp[0],tmp[1]),(0,0,0))
img.save('flag.png')
原网站

版权声明
本文为[MssnHarvey]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/2070015