关联漏洞
标题:
PHP 操作系统命令注入漏洞
(CVE-2024-4577)
描述:PHP是一种在服务器端执行的脚本语言。 PHP存在操作系统命令注入漏洞,该漏洞源于在特定条件下,Windows系统使用“Best-Fit”行为替换命令行中的字符,这可能导致PHP CGI模块错误地将这些字符解释为PHP选项,从而泄露脚本的源代码,在服务器上运行任意PHP代码等。以下版本受到影响:8.1至8.1.29之前版本,8.3至8.3.8之前版本,8.2至8.2.20之前版本。
介绍
# PHP CGI argument injection to RCE (CVE-2024-4577) - exploit code
The CVE-2024-4577 vulnerability in PHP CGI has emerged as a critical security flaw, allowing remote code execution through argument injection. Discovered in multiple PHP versions, this vulnerability primarily affects servers running in specific locales (Traditional Chinese, Simplified Chinese, Japanese) on Windows.
The flaw exploits the PHP CGI mode, bypassing previous security measures and enabling unauthenticated attackers to execute arbitrary code.
## Usage
Exploit script:
```
usage: python exploit.py -t http://127.0.0.1 -c calc
options:
-h, --help show this help message and exit
--target TARGET, -t TARGET
Target URL
--code CODE, -c CODE OS command to execute
--php PHP, -p PHP PHP command to execute
```
Example:
```
python3 exploit.py 192.168.130.100 80 calc
python .\CVE-2024-4577.py -t http://127.0.0.1 -p "<?php system('calc') ?>"
```

## Disclaimer
This exploit script has been created solely for research and the development of effective defensive techniques. It is not intended to be used for any malicious or unauthorized activities. The script's author and owner disclaim any responsibility or liability for any misuse or damage caused by this software. Just so you know, users are urged to use this software responsibly and only by applicable laws and regulations. Use responsibly.
文件快照
[4.0K] /data/pocs/dd89e69ef3866f0084854971383c5aff2234fa22
├── [ 923] exploit.py
├── [1.0K] LICENSE
└── [1.5K] README.md
0 directories, 3 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。