HCTF 2018
Web
admin
首先通过注册账号进行信息收集,可以在 /change 页面发现提示
<!-- https://github.com/woadsl1234/hctf_flask/ -->通过关键词 flask 可以明白这题需要 SSTI 模板注入,接下来就是找注入口,但由于这个 Github 链接无法访问,通过在 Github 搜索可以发现别人的 Fork 。
其中可以在 routes.py 文件中的可以发现以下函数
def strlower(username):
username = nodeprep.prepare(username)
return username该函数在注册时候调用,其中的nodeprep.prepare() 的作用则是将在 register() 函数中将 Unicode字符 ᴬ 转换成 A ,而 A 在 change() 函数中调用 nodeprep.prepare() 函数会把 A 转换成 a 。
因此我们使用 ᴬdmin 注册并登录后修改密码后退出登录后用修改后的密码登录 admin 即可得到 flag
Last updated