Observed attack flow | Image: Microsoft
A technical analysis from the Microsoft Defender Security Research Team has revealed that threat actors are increasingly abandoning visible triggers like URL parameters, opting instead to hide their command-and-control logic inside HTTP cookies.
Traditionally, a PHP-based web shellβa malicious script that allows remote control of a serverβmight be activated by sending a specific request to a web page. However, these requests often leave clear “fingerprints” in server logs. By moving this logic into cookies, attackers can blend their malicious activity into the massive volume of legitimate web traffic.
As the Microsoft research team explains:
“This approach reduces visibility by allowing malicious code to remain dormant during normal application behavior and execute only when specific cookie conditions are met”.
Because cookies are a standard part of web browsing and often receive less scrutiny than the actual path of a request or the data within it, they provide a perfect “stealth channel” for attackers.
The analyzed web shells act like a high-security vault that only opens when a specific key is presented. The malicious logic remains completely inactive unless a request arrives with a cookie containing a very specific, threat-actor-supplied value.
Once this condition is met, the script “reconstructs and executes threat actor-controlled behavior,” effectively turning a benign-looking web server into a remotely controlled implant. This technique has been observed across various contexts, from direct web requests to background workers and even scheduled tasks.
The danger of this method lies in its durability. By combining these obfuscated PHP loaders with scheduled tasks, attackers can ensure they don’t lose access even if their original entry point is closed.
The report highlights the strategic value of this persistent access:
“By combining scheduled tasks with obfuscated PHP loaders, they preserved the ability to execute code even after the original entry point was remediated or access paths were disrupted”.
This “durable access” allows attackers to return to a compromised system at any time to steal data, move deeper into the network, or deploy more destructive payloads like ransomware, all while keeping their “noisy” intrusion attempts to a minimum.
Detecting these “cookie-gated” shells requires looking beyond simple URL patterns. Security teams must implement deep-level inspection of web traffic that can identify anomalous cookie values and correlate them with unusual server-side process execution.
As the Microsoft team concludes:
“In the attacks analyzed, persistence was deliberate, not incidental. Rather than depending on a single exploit or a short-lived foothold, the threat actor turned initial access into a repeatable mechanism for remote code execution (RCE)”.
Maintaining strict file integrity monitoring and auditing all scheduled tasks are essential steps to ensuring your web servers don’t harbor these silent, persistent guests.
Support Our Threat Intelligence
If you find our CVE report and cybersecurity news helpful, consider supporting our work.