Ecshop漏洞及修復

2021-09-22 08:21:59 字數 2934 閱讀 9785

路徑:/api/client/includes/lib_api.php

參照以下修改:

function api_userlogin($post)

else

/* end */

$post['username'] = isset($post['userid']) ? trim($post['userid']) : '';

路徑: /admin/shopinfo.php(修改53-71-105-123行)

源**:

admin_priv('shopinfo_manage');

修改為:

admin_priv('shopinfo_manage');

$_request['id'] = intval($_request['id']);

路徑: /admin/shopinfo.php(修改31-51行)

源**:

$logdb = get_affiliate_ck();

修改為:

$_get['auid'] = intval($_get['auid']);

$logdb = get_affiliate_ck();

參照以下修改:

$filter['sort_by']      = empty($_request['sort_by']) ? 'add_time' : trim(htmlspecialchars($_request['sort_by']));

$filter['sort_order']   = empty($_request['sort_order']) ? 'desc' : trim(htmlspecialchars($_request['sort_order']));

路徑:/admin/integrate.php

參照以下修改(大概109行):

$code = empty($_get['code']) ? '' : trim(addslashes($_get['code']));

參照以下修改(大概601行):

源**:

@file_put_contents(root_path . 'data/repeat_user.php', $json->encode($repeat_user));

修改為:

@file_put_contents(root_path.'data/repeat_user.php','<?php die();?>'.$json->encode($repeat_user));

路徑:/admin/edit_languages.php(大概120行)

$dst_items[$i] = $_post['item_id'][$i] .' = '. '"' .$_post['item_content'][$i]. '";';

修改為:

$dst_items[$i] = $_post['item_id'][$i] .' = '. '\'' .$_post['item_content'][$i]. '\';';

有$arr['num'] 、$arr['id']、$arr['type']這些引數的,在函式開頭加上:

大概289行加上:

$arr['num'] = intval($arr['num']);

$arr['id'] = intval($arr['id']);

大概454行加上:

$arr['id'] = intval($arr['id']);

$arr['type'] = addslashes($arr['type']);

大概495行加上:

$arr['id'] = intval($arr['id']);

路徑:/admin/lib_main.php(找到create_html_editor函式)

源**:

$editor = new fckeditor($input_name);

$editor->basepath   = '../includes/fckeditor/';

$editor->*******set = 'normal';

$editor->width      = '100%';

$editor->height     = '320';

$editor->value      = $input_value;

$fckeditor = $editor->createhtml();

//$smarty->assign('fckeditor', $fckeditor);

$kindeditor="";

修改為:

$kindeditor="";

/admin/*.php 檔案(*代表所有)

搜尋此內容全部去掉:

require_once(root_path . "includes/fckeditor/fckeditor.php");

搜尋以下內容:

源**:

include_once(root_path."includes/fckeditor/fckeditor.php");

/* 編輯器 */

$editor = new fckeditor('fckeditor1');

$editor->basepath   = "../includes/fckeditor/";

$editor->*******set = "normal";

$editor->width      = "95%";

$editor->height     = "500";

$editor->value      = $file_content;

$fckeditor = $editor->createhtml();

$smarty->assign('fckeditor', $fckeditor);

修改為:

$smarty->assign('fckeditor', create_html_editor('fckeditor1', $file_content));

關於ECSHOP中sql注入漏洞修復

公司部署了乙個ecshop 用於做網上 使用,部署在阿里雲伺服器上,第二天收到阿里雲控制台發來的告警資訊,發現ecshop 目錄下檔案sql注入漏洞以及程式漏洞 如下圖 與技術溝通未果的情況下,網上查了點資料,對其檔案進行修復,如下修改 1,admin shopinfo.php修復方法 大概在第53...

mysql 漏洞修復 mysql漏洞修復

lnmp目錄執行 upgrade.sh mysql 需要輸入mysql root密碼進行驗證,驗證不通過將無法進行公升級,驗證通過後可以到 獲取mysql的版本號,輸入後回車確認,如要啟用innodb,輸入y,回車確認,再次回車確認即可開始公升級。會在 root 目錄下生成mysql upgrade...

ecshop常見漏洞

1.測試版本 v2.7.3 release 20121106 最新 v2.7.3 release 20120411 2.漏洞 條件需登入到後台 3.漏洞 利用1 登陸到台後,選擇模板 1 即生成乙個joychou.php檔案,內容為 1 2 3 4 5 assert post x 3 訪問user....