题目地址:

https://race.hscsec.cn/challenges

这个网址里面还有其他靶场,有机会可以看看。

EASYPHY

文件上传题

mime检测,得图片前缀绕过

首个页面有文件包含功能。

/?acti0n=../../../etc/passwd

?acti0n=upload/4869953b4070fbd1d6823d6ee6561985/wen.png

存在文件包含。这里可以将png解析为PHP执行,所以可以GIF89a<?php show_source("flag.php"); ?>,不是很懂(坑),不过做的时候发现可以GIF89a<?php phpinfo(); ?>,这里也是一个启发吧,发现disable_function也过滤了很多。

另外一种是phar,读取源码可以发现有file_exist(),删除的时候会触发到。

这题学到主要是网页的各个页面都是有用的,一开始做题时候漏掉了首页。发现不了文件包含。读取源码base64被ban了,可以大小写绕过(baSe64),或者rot13

str_rot13(x),使用一次函数加密,两次返回原值。

伪协议绕过:(124条消息) PHP Filter伪协议Trick总结_swtre33的博客-CSDN博客

然后就是直接show_source(‘flag.php’)。而不用写马那些操作(那些也被ban了很多)

文件上传大概目的就上传文件,还有解析文件。

easyflask

from flask import Flask,request,render_template_string
app = Flask(__name__)

@app.route("/")
def index():
return 'GET /view?filename=app.py'

@app.route("/view")
def viewFile():
filename = request.args.get('filename')
if("flag" in filename):
return "WAF"
if("cgroup" in filename):
return "WAF"
if("self" in filename):
return "WAF"
try:
with open(filename, 'r') as f:
templates='''
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文件存在</title>
</head>
<h1>
{}
</h1>
</html>
'''.format(f.read())
return render_template_string(templates)
except Exception as e:
templates='''
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文件不存在</title>
</head>
<h1>
文件不存在
</h1>
</html>
'''
return render_template_string(templates)

if __name__ == "__main__":
app.run(host="0.0.0.0", port=80, debug=True)

这道学到了,文件读取+debug大概就是要算Pin(因为算Pin要读取很多值才能算),算pin脚本网上很多了。

https://blog.csdn.net/qq_35782055/article/details/129126825

这道题做的时候也大概猜要这样了,不过嫌麻烦没去写(摸鱼)

ezcms

找不到后台地址,留个眼(坑)。佬们说弱密码登录后台(题目有字典,会被限制,用随机xff头),然后搜存在的cms。

http://max666.fun/416.html

https://www.cnblogs.com/vconlln/p/17116081.html

https://www.cnblogs.com/V3g3t4ble/p/17114004.html#ezsyflask

https://lazzzaro.github.io/2023/02/12/match-HSCSEC-CTF-2023/index.html

http://blog.shenghuo2.top/hscsec-ctf-2023-wp/#misc

社工

这次都是图片,做题仔细看,放大看。百度识图,谷歌识图,地图,

后记

这次就做了ezssti还有几道社工和一道misc,没怎么打,不过也确实实力不够,再加油。