Rapid7 Vulnerability & Exploit Database

Apache Struts ClassLoader Manipulation Remote Code Execution

Back to Search

Apache Struts ClassLoader Manipulation Remote Code Execution

Disclosed
03/06/2014
Created
05/30/2018

Description

This module exploits a remote command execution vulnerability in Apache Struts versions 1.x (<= 1.3.10) and 2.x (< 2.3.16.2). In Struts 1.x the problem is related with the ActionForm bean population mechanism while in case of Struts 2.x the vulnerability is due to the ParametersInterceptor. Both allow access to 'class' parameter that is directly mapped to getClass() method and allows ClassLoader manipulation. As a result, this can allow remote attackers to execute arbitrary Java code via crafted parameters.

Author(s)

  • Mark Thomas
  • Przemyslaw Celej
  • Redsadic <julian.vilas@gmail.com>
  • Matthew Hall <hallm@sec-1.com>

Platform

Linux,Windows

Development

References

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/http/struts_code_exec_classloader
msf exploit(struts_code_exec_classloader) > show targets
    ...targets...
msf exploit(struts_code_exec_classloader) > set TARGET < target-id >
msf exploit(struts_code_exec_classloader) > show options
    ...show and set options...
msf exploit(struts_code_exec_classloader) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;