/phpcms/modules/pay/respond.php 位置約16行
原來代碼
$payment = $this->get_by_code($_GET['code']);
替換為
$payment = $this->get_by_code(mysql_real_escape_string($_GET['code']));
2、phpcms注入漏洞
/phpcms/modules/poster/poster.php 位置約221行
if ($_GET['group']) {
之后加上
$_GET['group'] = preg_replace('#`#', '', $_GET['group']);
3、phpcms前臺注入導致任意文件讀取漏洞補丁
/phpcms/modules/content/down.php
(1)位置約17行
parse_str($a_k);
替換為
$a_k = safe_replace($a_k); parse_str($a_k);
(2)位置約89行
parse_str($a_k);
替換為
$a_k = safe_replace($a_k); parse_str($a_k);
(3)位置約120行
$filename = date('Ymd_his').random(3).'.'.$ext;
之后加上
$fileurl = str_replace(array('<','>'), '',$fileurl);
4、phpcms注入漏洞
/phpcms/modules/member/index.php 位置約615行
原來代碼:
$password = isset($_POST['password']) && trim($_POST['password']) ? trim($_POST['password']) : showmessage(L('password_empty'),HTTP_REFERER);
替換為:
$password = isset($_POST['password']) && trim($_POST['password']) ? addslashes(urldecode(trim($_POST['password']))) : showmessage(L('password_empty'), HTTP_REFERER);
5、phpcms某處邏輯問題導致getshell
1.根據漏洞描述,找到對應文件attachment.class.php
的對應位置(第144行附近),并添加補丁代碼。
添加后的代碼,截圖如下:
這樣,加入一個判斷,如果允許的文件格式是'gif','jpg','jpeg','bmp','png'這些,就繼續,不然就跳出,當然這里的格式可以根據需要增多幾個。
6、phpcms注入漏洞
/api/phpsso.php 位置約128行
原來代碼
替換為,二合一代碼
$phpssouid = intval($arr['uid']);
7、phpcms authkey生成算法問題導致authkey泄露
在/caches/configs/system.php
,增加第一個參數:
'alivulfix' => 'yes',
照著下面的函數重新生成一下key值,然后找caches/configs/system.php 里面把兩個參數替換一下就ok了