Microsoft Details Cookie-Controlled PHP Web Shells Persisting via Cron on Linux Servers

Foto: The Hacker News
More than 90% of organizations believe that traditional VPN solutions pose a real threat to their infrastructure, and the latest Zscaler ThreatLabz report confirms that these concerns are fully justified. Cybercriminals are utilizing artificial intelligence to rapidly scan for vulnerabilities, drastically shortening the time required to carry out an attack. Microsoft has detailed a new persistence method on Linux servers, where attackers install PHP Web Shells controlled via Cookies. The malicious scripts are hidden within the Cron task scheduler, allowing them to be automatically restored even after removal attempts by administrators. For users and companies worldwide, this signifies a necessity to abandon trust in static network security. Remote access attacks have become the fastest path to data breaches, bypassing classic firewalls by manipulating standard HTTP protocols. The practical implication is clear: monitoring traffic alone is not enough. It is essential to implement a Zero Trust architecture and conduct rigorous inspections of Cookies and system tasks, as modern malware can silently renew its server access in a time loop. Effective defense today requires a reaction speed dictated by algorithms, rather than manual IT procedures.
Traditional threat detection methods in server environments are increasingly failing against sophisticated activity masking techniques. The latest report from the Microsoft Defender Security Research Team sheds light on a disturbing trend: the use of HTTP cookies as a discrete control channel for PHP web shell scripts on Linux servers. This shift from overt URL parameters toward hidden HTTP protocol headers is radically changing the rules of the game in digital defense.
Instead of relying on easy-to-identify POST requests or GET query parameters, attackers are implementing mechanisms that activate malicious code only when a specific cookie value appears in the request. This strategy allows web shells to remain dormant for long periods, evading IDS/IPS class systems and web server log analysis, which often do not record the full content of Cookie headers in standard configurations.
Cookies as Gateways for Remote Code Execution
A key innovation in the described attacks is the way threat actors transmit instructions to the infected system. Microsoft's research team detailed that malicious PHP scripts do not expose command execution functions directly. Instead, they rely on values provided by the attacker in cookie fields, which serve as "keys" or "gates" (gate execution) conditioning the launch of the Remote Code Execution (RCE) payload.
Read also
This mechanism works extremely effectively in high-traffic environments. In the thicket of thousands of legitimate user sessions, a request containing a modified cookie looks almost identical to standard browser traffic. For an administrator monitoring the server, the PHP script may appear to be an integral part of the application until it is analyzed for HTTP header processing logic. This approach makes traditional signatures based on URL patterns completely useless.

Persistence via Cron and Infection Automation
Simply delivering a web shell is only half the battle for an attacker. Maintaining access after service restarts or system cleanup attempts is equally important. Microsoft indicates that criminal groups are increasingly using the Cron system task scheduler on Linux to ensure a permanent presence. These scripts are regularly checked and restored if necessary by automated tasks, creating a self-healing attack infrastructure.
- Hidden C2 Channels: Using HTTP cookies to transmit encrypted control instructions.
- Gate Execution Mechanism: Executing PHP code only after verifying a unique identifier in the header.
- Cron Utilization: Automatically restoring malicious files in the Linux file system.
- RCE Evolution: Transitioning from simple scripts to multi-layered persistence tools.
The use of Cron to maintain a web shell shows how deeply attackers infiltrate the operating system structure. Even if a security team locates and removes a malicious .php file, a properly configured task scheduler entry can download it again from an external server or recreate it from a hidden backup in another system location. This forces IT departments to adopt a holistic approach, including not only scanning web files but also auditing system configurations.
Artificial Intelligence and the Collapse of the Response Window
In the context of these threats, data from the Zscaler ThreatLabz 2026 VPN Risk Report, developed in collaboration with Cybersecurity Insiders, is extremely relevant. According to researchers, the development of AI has drastically shortened the time in which humans are able to react to an incident (collapsed human response window). Automation on the attacker side allows for lightning-fast vulnerability scanning and deployment of the aforementioned cookie-controlled web shells on a massive scale.
The Zscaler report also emphasizes that remote access has become the fastest path to breach. In a world where corporate network boundaries have blurred, vulnerabilities in web applications hosted on Linux represent an ideal entry point. The use of AI by threat actors allows for the generation of unique, polymorphic variants of PHP scripts that use different cookie names and different activation algorithms every time, making them nearly invisible to static defense systems.

Technical Challenges of Detection in the HTTP Layer
Technical analysis conducted by the Microsoft Defender Security Research Team shows that attackers often use code obfuscation techniques within the PHP scripts themselves. Functions such as eval(), base64_decode(), or gzinflate() are standard, but the novelty is making their parameters dependent on input data coming directly from the $_COOKIE superglobal array.
"Rather than exposing command execution through URL parameters or request bodies, these web shells rely on cookie values provided by the threat actor to control code execution."
For monitoring systems, this means a necessary transition to deep packet inspection (DPI) or the use of web server modules (e.g., ModSecurity) that are capable of analyzing and logging Cookie header content. Unfortunately, in large-scale environments, logging every cookie involves a massive increase in data and potential privacy issues, which attackers deliberately exploit, counting on gaps in infrastructure visibility.
A New Paradigm for Linux Server Protection
Effective defense against cookie-controlled web shells requires moving away from reactive remediation toward proactive system integrity monitoring. It becomes crucial to monitor not only changes in files but, above all, anomalies in PHP process behavior. If a script that usually serves to generate a page view suddenly initiates a network connection or modifies files in system directories, it must be immediately caught by Endpoint Detection and Response (EDR) systems.
The threat described by Microsoft shows that Linux, despite its robust security architecture, remains the number one target due to its dominance in cloud and server infrastructure. Integrating AI mechanisms into defensive processes is becoming a necessity to keep pace with attackers who are already using artificial intelligence to optimize their campaigns and shorten the time needed to take full control of a server.
In the face of the shortened response window mentioned by Zscaler, organizations must focus on automating Incident Response procedures. Systems that can independently isolate infected containers or block suspicious sessions based on real-time HTTP header analysis are becoming the only effective barrier against modern web shells. The era of simple PHP scripts uploaded via FTP has ended – the era of discrete, cookie-controlled implants that can survive even the most rigorous system purges has arrived.
More from Security
Related Articles

Hackers Exploit CVE-2025-55182 to Breach 766 Next.js Hosts, Steal Credentials
Apr 2
Cisco Patches 9.8 CVSS IMC and SSM Flaws Allowing Remote System Compromise
Apr 2
ThreatsDay Bulletin: Pre-Auth Chains, Android Rootkits, CloudTrail Evasion & 10 More Stories
Apr 2





