2021XCTF回顾

第一次打CTF打到凌晨1点,记录一下

2022.1.8更新

SCTF2021的项目仓库与文档
https://syclover.feishu.cn/docs/doccnmKCtL4ABewkf89aAJXIdmg
https://github.com/SycloverTeam/SCTF2021

This is a tree

看一下每个文件夹下面的文件内容都是4个字符,猜到应该是Base64编码

一开始没准备做,但在学弟的热情下,还是干了

python的OS模块之前没用过,写脚本花了很长时间

1
2
3
4
5
6
7
8
9
10
11
import os
i=[]
for root,dirs,files in os.walk(r"D:\Secruity\2021_12_25XCTF\This_is_a tree"):
for file in files:
#获取文件所属目录
# print(root)
#获取文件路径
with open(os.path.join(root,file),encoding='utf-8') as txt:
print(txt.readline())
i.append(txt.readline())
print(i)

把结果Base64化,推荐这个网站

1
https://base64.us/

image.png

题目好像有说要按特定顺序,但当时没注意,直接跑python的base64模块会出现编码问题,也可能是哪里不会配置的缘故

1
Chinese traditional culture is broad and profound! So I Want Give You My Flag But You Need Decode It.Enjoy The Flag!!:师 兑 复 损 巽 震 晋 姤 大过 讼 噬嗑 震 恒 节 豫 

这里上百度搜索,没有任何提示,知道用bing以后才发现,八卦密码已经被国内的CTF玩出花来了

https://github.com/BjdsecCA/BJDCTF2020_January

参照那个脚本(0x08 伏羲六十四卦)写出解密脚本就Ok

把八卦转二进制,然后解码

1
2
3
4
5
ss="010000110110100000110001011011100100000101011111011110010111100101100100011100110010000100"
enc=''
for i in range(0,len(ss),8):
enc+=chr(eval('0b'+ss[i:i+8]))
print(enc)

flag:

1
Ch1nA_yyds!

5TXD185H7~XR6KMASFFICX7.jpg

login_me

Go语言的网络框架,Gin的SSTI(这个真不懂)

我还以为是爆破,写了个爆破脚本

1
2
3
4
5
6
7
8
9
10
11
import requests
url="http://124.71.166.197:18001/admin/index"
headers={"X-Real-Ip":"127.0.0.1"}

with open("aa1.txt", 'w') as tf:
for i in range(49,100):
params={"id":"0","age":str(i)}
r=requests.get(url=url,params=params,headers=headers)
print(r.status_code)
print(r.text)
tf.write(r.text)

然而并没有用,详细题解看看雪大佬的

[2021SCTF]web-Loginme wp

921448_7RHJUQCW5S3MR9V.png

拉了,该去学点web知识

看到看雪的版主要附件,我上传了一份到天翼网盘

https://cloud.189.cn/web/share?code=VvuUfuU3mA3a(访问码:l6r9)