Lucene search

K
pentestitBlackPENTESTIT:37744BAB82BC3A7B208CCD4945FA50F7
HistorySep 07, 2017 - 5:33 a.m.

S2-052: Apache Struts2 REST Plugin Payloads (CVE-2017-9805)

2017-09-0705:33:35
Black
pentestit.com
2165

0.975 High

EPSS

Percentile

100.0%

PenTestIT RSS Feed

There is a saying making rounds now that “Apache Struts is like the WebGoat of all frameworks” and the current exploit which is being tracked under CVE-2017-9805 and the Apache Struts bulletin - S2-052 prooves just that. If you remember, I had covered another vulnerability a couple of months ago - which is tracked under S2-048 & CVE-2017-9791.

CVE-2017-9805

What is the Apache Struts2 CVE-2017-9805 vulnerability about?

The original advisory here mentions the vulnerability briefly. However, the Apache Foundation description was enough for people to create a PoC even before the discoverer could make these details public. Interestingly, the original advisory has been updated to mention this - "Updated on 6 September: added a warning regarding multiple working exploits having been published by third parties." The vendor advisory states this - “The REST Plugin is using a XStreamHandler with an instance of XStream for deserialization without any type filtering and this can lead to Remote Code Execution when de-serializing XML payloads.

I will not go into the details about how do you exploit this vulnerability, as I tweeted about the PoC availability yesterday itself:

> CVE-2017-9805, <https://t.co/doP89huIGN&gt; (S2-052) POC - <https://t.co/ZwTMWmTY1A&gt;
>
> – Pentestit (@pentestit) September 5, 2017

The PoC there works good and kudos to the author! This post tries to list down a few more payloads that I could think will be interesting to use. Without further ado, we begin with the different payloads:

CVE-2017-9805 payload for a reverse connection via MSTSC (Terminal Server Connection):

CVE-2017-9805-Windows-Connect-Back

This has a high success rate on Windows systems which can “connect back” to you.

CVE-2017-9805 payload for file download no execution (figure that part out):
CVE-2017-9805-Windows-Download
Should work on almost all Microsoft Windows systems as long as Tomcat has the right privileges set.
CVE-2017-9805 payload for file download on a Linux machine:
CVE-2017-9805-Linux
This should also work on a good amount of systems that has cURL.

Fix CVE-2017-9805:

As the Apache Foundation suggests, the first option is to upgrade to Struts 2.5.13 or Struts 2.3.34. Secondly, you can upgrade the plugin by uploading all the required plugin JARs and it’s dependencies.

The post S2-052: Apache Struts2 REST Plugin Payloads (CVE-2017-9805) appeared first on PenTestIT.