Rapid7 Vulnerability & Exploit Database

Apache Struts Remote Command Execution

Back to Search

Apache Struts Remote Command Execution



This module exploits a remote command execution vulnerability in Apache Struts versions < 2.2.0. This issue is caused by a failure to properly handle unicode characters in OGNL extensive expressions passed to the web server. By sending a specially crafted request to the Struts application it is possible to bypass the "#" restriction on ParameterInterceptors by using OGNL context variables. Bypassing this restriction allows for the execution of arbitrary Java code.


  • bannedit <bannedit@metasploit.com>
  • Meder Kydyraliev




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
msf exploit(struts_code_exec) > show targets
msf exploit(struts_code_exec) > set TARGET < target-id >
msf exploit(struts_code_exec) > show options
    ...show and set options...
msf exploit(struts_code_exec) > 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