CVE-2024-4577 – PHP-CGI RCE Exploitation in Windows Servers
A newly identified cyber campaign has been actively targeting organizations across multiple sectors in Japan since January 2025. Threat actors of unknown origin have been exploiting CVE-2024-4577, a critical remote code execution (RCE) vulnerability in the PHP-CGI implementation of PHP on Windows, to gain unauthorized access to victim systems. This campaign has primarily impacted Japan’s technology, telecommunications, and e-commerce industries.
This blog explores the details of the vulnerability, its exploitation techniques, and the mitigation strategies organizations should adopt immediately.
CVE-2024-4577 – Risk Analysis
Severity:?Critical CVSSv3.0?:?Base Score: 9.8 Critical Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Exploit available in public: Yes Exploit complexity: Low
First identified in early June 2024, this flaw has been actively exploited by threat actors, affecting PHP installations on Windows systems running in CGI mode. CVE-2024-4577 arises from improper handling of character encoding conversions when PHP operates in CGI mode on Windows systems. The issue is linked to Best Fit Mapping, a Windows feature that incorrectly translates certain Unicode characters.
Root Cause
This bug is a regression of CVE-2012-1823, an argument injection flaw patched over a decade ago.
Affected Systems
Key Risk Factors
How is CVE-2024-4577 Being Exploited?
Initial Access and Attack Execution
Attackers are leveraging this vulnerability to execute malicious PowerShell scripts, enabling the deployment of a Cobalt Strike reverse HTTP shellcode payload. This payload grants persistent remote access to compromised endpoints, setting the stage for further exploitation.
Following initial access, the attackers engage in reconnaissance, privilege escalation, and lateral movement using a variety of tools, including:
To maintain persistence, the attackers modify the Windows Registry, set up scheduled tasks, and deploy custom services via plugins of the Cobalt Strike kit, notably the ‘TaoWu’ framework.
Evading Detection and Credential Theft
In an effort to remain undetected, the attackers erase event logs using wevtutil commands, effectively wiping traces from Windows security, system, and application logs. Ultimately, they execute Mimikatz commands to extract and exfiltrate passwords and NTLM hashes from the victim’s memory, securing access to further sensitive information.
Command-and-Control (C2) Infrastructure
A deeper investigation into the attackers’ C2 servers, which are linked to the Cobalt Strike tool, uncovered misconfigurations that left directory listings exposed on the internet. This led to the discovery of several adversarial tools and frameworks hosted on Alibaba Cloud servers. Some of the notable tools include:
Mitigation Strategies
AppTrana WAAP Coverage for CVE-2024-4577
Organizations using AppTrana WAAP are automatically protected against exploitation attempts targeting CVE-2024-4577. The platform provides proactive security by enforcing real-time threat detection and mitigation measures, ensuring customers remain protected from such attacks from Day 0.
Beyond relying solely on software patches, the Indusface managed security team has developed specialized rules to detect and block injection vulnerabilities in PHP. These tailored security measures help prevent remote code execution attempts, blocking attackers before they can establish persistence or escalate privileges.
During proof-of-concept (PoC) simulations, AppTrana WAAP effectively blocked exploitation attempts targeting CVE-2024-4577, as demonstrated in the screenshot.
Stay tuned for more relevant and interesting security articles. Follow Indusface on?Facebook,?Twitter, and?LinkedIn.
Originally published at https://www.indusface.com on March 18, 2025.