Threat IntelHIGH

PHP Webshells - Cookie-Controlled Tactics in Linux Hosting

Featured image for PHP Webshells - Cookie-Controlled Tactics in Linux Hosting
MSMicrosoft Security Blog
PHP webshellsLinux hostingHTTP cookiesMicrosoft Defenderremote code execution
🎯

Basically, hackers use cookies to secretly control malicious scripts on Linux servers.

Quick Summary

Hackers are using HTTP cookies to control PHP webshells in Linux hosting environments. This stealthy tactic reduces detection risks, posing significant threats to users. Enhanced security measures are crucial to combat this evolving threat.

What Happened

Threat actors are increasingly using HTTP cookies as a control channel for PHP-based webshells on Linux servers. Instead of exposing command execution through visible parameters, these webshells rely on cookie values to gate execution and pass instructions. This method allows malicious code to remain dormant during normal application behavior, activating only under specific conditions.

Who's Affected

This technique primarily targets users and administrators of Linux hosting environments, particularly those utilizing PHP applications. Shared hosting scenarios are especially vulnerable, as they often allow sufficient permissions for attackers to deploy and maintain webshells without raising alarms.

How It Works

The core of this attack involves the use of cookies to trigger malicious execution. When specific cookie values are present, the webshell logic activates, executing threat actor-controlled behavior. This method reduces visibility, as the malicious activity blends into normal web traffic. The PHP environment allows immediate access to cookie data, making it easy for attackers to utilize this input without complex parsing.

Observed Variants

Several implementations of cookie-controlled PHP webshells have been noted:

  • Loader with Execution Gating: This variant evaluates request context and reconstructs PHP functions dynamically, complicating detection.
  • Direct Cookie-Driven Payload Stager: This simpler variant uses cookie data to directly control file handling and execution.
  • Cookie-Gated Interactive Webshell: Here, a single cookie acts as an execution key, enabling direct execution of commands.

Persistence Through Scheduled Tasks

A notable tactic involves using cron jobs for persistence. After gaining access, attackers register scheduled tasks that recreate malicious PHP loaders in web-accessible locations. This method allows them to maintain a foothold in the environment, even after cleanup attempts, as the cron job continuously restores the webshell.

Common Delivery Methods

Attackers often leverage legitimate execution paths, such as php-fpm or control panel components, to stage and preserve malicious code. They use base64 encoding to reconstruct PHP files, allowing the code to blend into normal operations while remaining ready for activation.

Why Persistence Matters

Persistence is key for long-term remote code execution (RCE). By combining scheduled tasks with obfuscated PHP loaders, attackers can execute commands and deploy additional payloads without needing to re-trigger initial exploits. This approach minimizes operational noise and reduces the risk of detection.

Mitigation and Protection Guidance

To combat these threats, organizations should enforce multi-factor authentication for hosting control panels and monitor for unusual login patterns. Regular audits of hosted environments can help identify and mitigate potential webshell activity. Additionally, implementing robust logging and monitoring solutions can enhance visibility into web traffic and detect anomalies related to cookie usage.

🔒 Pro insight: The use of cookies for command execution reflects a shift in webshell tactics, necessitating advanced monitoring solutions to detect such stealthy behaviors.

Original article from

MSMicrosoft Security Blog· Microsoft Defender Security Research Team
Read Full Article

Related Pings

HIGHThreat Intel

US-Iran War - Risks of Attacking Nuclear Sites Explained

The US-Iran conflict escalates with airstrikes on nuclear sites. While no radiation leaks are reported, the risk of safety system failures could lead to catastrophic contamination across the Gulf. Experts warn of the potential environmental and public health impacts if critical systems are compromised.

Wired Security·
HIGHThreat Intel

AI Cyberattacks - Threat Actor Abuse Accelerates Rapidly

AI is transforming cyberattacks, with threat actors achieving a 450% increase in phishing effectiveness. Organizations must adapt to this evolving landscape to safeguard their data. Microsoft is actively disrupting these operations to protect users.

Microsoft Security Blog·
HIGHThreat Intel

BPFDoor Variants Discovered - Rapid7 Research Unveils Threats

New research from Rapid7 reveals seven stealthy BPFDoor variants. These variants enhance operational security for APTs and pose significant risks to telecom infrastructures. Organizations must adapt their defenses to counter these evolving threats.

Rapid7 Blog·
HIGHThreat Intel

Residential Proxies - Evaded IP Reputation Checks in 78% of Sessions

A new study reveals that residential proxies evade IP reputation checks in 78% of cases, complicating cybersecurity efforts. This issue affects many organizations, making them vulnerable to attacks. Experts recommend focusing on behavioral patterns for better defense strategies.

BleepingComputer·
HIGHThreat Intel

Software Supply Chain Hacks - Wave of Data Theft Unleashed

A series of software supply chain attacks linked to North Korean hackers has triggered significant data theft. Organizations worldwide are affected, raising concerns about future intrusions and ransomware threats. Immediate action is needed to safeguard sensitive information.

Help Net Security·
HIGHThreat Intel

NCSC Issues Security Alert Over WhatsApp and Signal Hacks

The NCSC has alerted the public about rising attacks on WhatsApp and Signal accounts, primarily targeting high-risk individuals. Russian hackers are linked to these incidents, raising significant security concerns. It's crucial to stay informed and adopt protective measures to safeguard sensitive information.

Infosecurity Magazine·