Back to search

PHP CGI Argument Injection

When run as a CGI, PHP up to version 5.3.12 and 5.4.2 is vulnerable to an argument injection vulnerability. This module takes advantage of the -d flag to set php.ini directives to achieve code execution. From the advisory: "if there is NO unescaped '=' in the query string, the string is split on '+' (encoded space) characters, urldecoded, passed to a function that escapes shell metacharacters (the "encoded in a system-defined manner" from the RFC) and then passes them to the CGI binary." This module can also be used to exploit the plesk 0day disclosed by kingcope and exploited in the wild on June 2013.

Free Metasploit Download

Get your copy of the world's leading penetration testing tool

 Download Now

Module Name

exploit/multi/http/php_cgi_arg_injection

Authors

  • egypt <egypt [at] metasploit.com>
  • hdm <x [at] hdm.io>
  • jjarmoc
  • kingcope
  • juan vazquez <juan.vazquez [at] metasploit.com>

References

Targets

  • Automatic

Platforms

  • php

Architectures

  • php

Reliability

Development

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

Related Vulnerabilities