Threat IntelHIGH

PHP Webshells - Cookie-Controlled Tactics in Linux Hosting

Featured image for PHP Webshells - Cookie-Controlled Tactics in Linux Hosting
MSMicrosoft Security Blog·Reporting by Microsoft Defender Security Research Team
Summary by CyberPings Editorial·AI-assisted·Reviewed by Rohit Rana
Updated:
🎯

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

Also covered by

THThe Hacker News

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

Read Article

Related Pings

MEDIUMThreat Intel

Researchers Roast Cybercriminals to Diminish Their Glamour

Researchers are roasting cybercriminals to diminish their glamor. This humorous approach aims to expose their failures and fracture trust within criminal networks. It's a fresh take on cybersecurity, focusing on education and awareness.

The Register Security·
HIGHThreat Intel

Node.js Maintainers Targeted - Sophisticated Social Engineering Scheme

A coordinated social engineering scheme is targeting Node.js developers, risking the integrity of widely used software packages. This alarming trend highlights the need for vigilance in the open-source community.

Cyber Security News·
HIGHThreat Intel

Transparent Tribe Targets India's Startup Ecosystem - New Threat

Acronis reveals that Transparent Tribe is now targeting India's startup sector, especially cybersecurity firms. This shift raises concerns about espionage and data security risks. Startups must bolster their defenses against these sophisticated attacks.

CyberWire Daily·
HIGHThreat Intel

Gaming Industry - High-Stakes Cybersecurity Threats Explained

Cybercriminals are increasingly targeting the gaming industry, driven by financial transactions and sensitive data. As casinos go digital, understanding these threats is vital for operators to safeguard their assets.

Cyber Security News·
HIGHThreat Intel

China-Linked TA416 Targets European Governments with Phishing

TA416, a China-aligned threat actor, is targeting European governments with sophisticated phishing campaigns using PlugX malware. This poses significant risks to diplomatic security. Stay informed to safeguard your organization.

The Hacker News·
HIGHThreat Intel

Spear-Phishing Campaign Neutralizes MFA for Executives

A new spear-phishing campaign is targeting senior executives, neutralizing MFA protections. This poses serious risks to corporate security. Organizations must enhance their defenses against such sophisticated threats.

SC Media·