Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2012-1823---PHP-CGI---RCE — Python-based exploit for CVE-2012-1823 enabling remote code execution on vulnerable PHP-CGI servers by injecting command-line arguments via the query string. | Kitploit
Tools/GitHubGitHub/tryj/cve-2012-1823---php-cgi---rce
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRemote Access Tool
GitHubtryj/cve-2012-1823---php-cgi---rce

CVE-2012-1823---PHP-CGI---RCE

Python-based exploit for CVE-2012-1823 enabling remote code execution on vulnerable PHP-CGI servers by injecting command-line arguments via the query string.

View Repository
15 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2012-1823 | PHP-CGI Remote Code Execution (RCE) Exploit

Python Security License

A Python-based exploit for CVE-2012-1823. This vulnerability allows an attacker to execute arbitrary code on a server running a vulnerable version of PHP-CGI by injecting command-line arguments via the query string.


📝 Vulnerability Overview

The flaw exists when PHP is used in a CGI configuration. The HTTP query string is incorrectly parsed as command-line arguments for the PHP binary. By passing the -d argument, we can override PHP configuration settings (directives).

Key Directives used in this exploit:

  • allow_url_include=1: Enables the inclusion of data streams.
  • auto_prepend_file=php://input: Forces PHP to execute the contents of the HTTP Request Body.

🚀 Getting Started

1. Requirements

Ensure you have Python 3 and the requests library installed.

root@kitploit:~
pip install requests

How to install

root@kitploit:~
git clone https://github.com/tryj/CVE-2012-1823---PHP-CGI---RCE.git
cd CVE-2012-1823---PHP-CGI---RCE

How to use

root@kitploit:~
python exploit.py -u <TARGET_URL> -c <COMMAND>
python exploit.py -u http://127.0.0.1 -c "id"
Download Tool