Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check) - Nessus

Critical   Plugin ID: 144365

This page contains detailed information about the Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 144365
Name: Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check)
Filename: struts_cve_2020_17530.nbin
Vulnerability Published: 2020-12-08
This Plugin Published: 2020-12-17
Last Modification Time: 2022-04-11
Plugin Version: 1.20
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: http_version.nasl
Excluded KB Items [?]: Settings/disable_cgi_scanning

Vulnerability Information


Severity: Critical
Vulnerability Published: 2020-12-08
Patch Published: 2020-12-06
CVE [?]: CVE-2020-17530
CPE [?]: cpe:/a:apache:struts

Synopsis

Apache Struts installed on the remote host is affected by a remote code execution vulnerability.

Description

The version of Apache Struts installed on the remote host is 2.x prior to 2.5.26. It is, therefore, affected by a a remote code execution vulnerability in its OGNL evaluation functionality due to insufficient validation of user input. An unauthenticated, remote attacker can exploit this to execute arbitrary commands on an affected host.

Solution

Upgrade to Apache Struts version 2.5.26 or later. Alternatively, apply the workarounds as referenced in the vendor security bulletins.

Public Exploits


Target Network Port(s): 8080
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check) vulnerability:

  1. Metasploit: exploit/multi/http/struts2_multi_eval_ognl
    [Apache Struts 2 Forced Multi OGNL Evaluation]
  2. GitHub: https://github.com/0day666/Vulnerability-verification
    [CVE-2020-17530]
  3. GitHub: https://github.com/CyborgSecurity/CVE-2020-17530
    [CVE-2020-17530]
  4. GitHub: https://github.com/EdgeSecurityTeam/Vulnerability
    [CVE-2020-17530]
  5. GitHub: https://github.com/EvilPulsar/S2-061
    [CVE-2020-17530]
  6. GitHub: https://github.com/Mr-xn/Penetration_Testing_POC
    [CVE-2020-17530]
  7. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2020-17530]
  8. GitHub: https://github.com/alexfrancow/CVE-Search
    [CVE-2020-17530]
  9. GitHub: https://github.com/ciakim/CVE-2020-17530
    [CVE-2020-17530]
  10. GitHub: https://github.com/jeansgit/Pentest
    [CVE-2020-17530]
  11. GitHub: https://github.com/ka1n4t/CVE-2020-17530
    [CVE-2020-17530]
  12. GitHub: https://github.com/killmonday/CVE-2020-17530-s2-061
    [CVE-2020-17530]
  13. GitHub: https://github.com/lovechinacoco/https-github.com-mai-lang-chai-Middleware-Vulnerability-detection
    [CVE-2020-17530]
  14. GitHub: https://github.com/ludy-dev/freemarker_RCE_struts2_s2-061
    [CVE-2020-17530: (cve-2020-17530) struts2_s2-061 freemarker_RCE testscript]
  15. GitHub: https://github.com/uzzzval/CVE-2020-17530
    [CVE-2020-17530]
  16. GitHub: https://github.com/woods-sega/woodswiki
    [CVE-2020-17530]
  17. GitHub: https://github.com/154802388/CVE-2020-17531
    [CVE-2020-17530: Apache Struts2框架是一个用于开发Java ...]
  18. GitHub: https://github.com/Al1ex/CVE-2020-17530
    [CVE-2020-17530: S2-061 CVE-2020-17530]
  19. GitHub: https://github.com/fengziHK/CVE-2020-17530-strust2-061
    [CVE-2020-17530: CVE-2020-17530-strust2-061]
  20. GitHub: https://github.com/pangyu360es/CVE-2020-17530
    [CVE-2020-17530: Apache Struts2框架是一个用于开发Java ...]
  21. GitHub: https://github.com/phil-fly/CVE-2020-17530
    [CVE-2020-17530: hack,poc]
  22. GitHub: https://github.com/wuzuowei/CVE-2020-17530
    [CVE-2020-17530: S2-061 的payload,以及对应简单的PoC/Exp]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS Score Source [?]: CVE-2020-17530
CVSS V2 Vector: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:H/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.5 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.5 (Medium)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.4 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.4 (Critical)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


The struts_cve_2020_17530.nbin Nessus plugin is distributed in a propriatory binary format and its source code is protected. This script is Copyright (C) 2020-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/struts_cve_2020_17530.nbin
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\struts_cve_2020_17530.nbin
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/struts_cve_2020_17530.nbin

Go back to menu.

How to Run


Here is how to run the Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select CGI abuses plugin family.
  6. On the right side table select Apache Struts 2.x < 2.5.26 RCE (S2-061) (direct check) plugin ID 144365.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl struts_cve_2020_17530.nbin -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a struts_cve_2020_17530.nbin -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - struts_cve_2020_17530.nbin -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state struts_cve_2020_17530.nbin -t <IP/HOST>

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2020-A-0565
See also: Similar and related Nessus plugins:
  • 148986 - Oracle MySQL Enterprise Monitor Multiple Vulnerabilities (Apr 2021 CPU)
  • 143599 - Apache Struts 2.x < 2.5.26 RCE (S2-061)
  • 151425 - Apache Struts 2.0.0 < 2.5.26 Possible Remote Code Execution vulnerability (S2-061)
  • 66935 - Apache Struts 2 Crafted Parameter Arbitrary OGNL Expression Remote Command Execution
  • 66931 - Apache Struts 2 OGNL Expression Handling Double Evaluation Error Remote Command Execution
  • 68981 - Apache Struts 2 'action:' Parameter Arbitrary Remote Command Execution
  • 70168 - Apache Struts 2 'action:' Parameter Prefix Security Constraint Bypass
  • 73203 - Apache Struts 2 'class' Parameter ClassLoader Manipulation
  • 119728 - Apache Struts 2 'method:' Prefix Arbitrary Remote Command Execution
  • 90152 - Apache Struts 2 Tag Attribute Double OGNL Evaluation RCE
  • 91811 - Apache Struts 2 REST Plugin OGNL Expression Handling RCE
  • 102918 - Apache Struts 2.3.x Struts 1 plugin RCE (remote)
  • 97610 - Apache Struts 2.3.5 - 2.3.31 / 2.5.x < 2.5.10.1 Jakarta Multipart Parser RCE (remote)
  • 102977 - Apache Struts 2 REST Plugin XStream XML Request Deserialization RCE
  • 112064 - Apache Struts CVE-2018-11776 Results With No Namespace Remote Code Execution (S2-057) (remote)
  • 69240 - Apache Struts 2 ExceptionDelegator Arbitrary Remote Command Execution
  • 57691 - Apache Struts 2 Multiple Remote Code Execution and File Overwrite Vulnerabilities (safe check) (deprecated)
  • 57850 - Apache Struts 2 ParameterInterceptor Class OGNL Expression Parsing Remote Command Execution
  • 47900 - Apache Struts 2 / XWork Remote Code Execution (safe check)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file struts_cve_2020_17530.nbin version 1.20. For more plugins, visit the Nessus Plugin Library.

Go back to menu.