PHP < 5.3.12 / < 5.4.2 - CGI Argument Injection

PHP

nmap -sV -sC -p 80 10.2.20.205
80/tcp open  http    Apache httpd 2.2.8 ((Ubuntu) DAV/2)
|_http-title: Metasploitable2 - Linux
|_http-server-header: Apache/2.2.8 (Ubuntu) DAV/2
  • Try to browse

    • http://10.2.20.205/phpinfo.php

PHP Version 5.2.4-2ubuntu5.10

Manual/Script Exploitation

  • Find an exploit

  • Modify pwn_code variable and insert PHP reverse shell code

Unprivileged access with "www-data" user

  • Automatic MSF exploit/multi/http/php_cgi_arg_injection module can be used too.

exploit/multi/http/php_cgi_arg_injection

Last updated