“Dynamic Shellcode Protection” is Designed to Expose Fileless Malware, Ransomware and Remote Access Agents

OXFORD, U.K.  — mars 4, 2021 —

Sophos, a global leader in next-generation cybersecurity, today revealed a new defense against adversaries trying to evade detection by loading fileless malware, ransomware and remote access agents into the temporary memory of compromised computers. In a new blog post, “Covert Code Faces a Heap of Trouble in Memory,” Sophos researchers detail how they discovered that covert attack code is injected directly into the dynamic “Heap” region of computer memory and then tries to obtain additional “Heap” memory with code execution rights, a behavior not seen in ordinary software. The researchers developed a new protection that is triggered whenever such “Heap-Heap” memory allocation behavior is detected.

The defense, called Dynamic Shellcode Protection, will make it significantly harder for adversaries to use memory as part of their arsenal of defense evasion techniques.

As Sophos recently reported in a series of articles on the realities of Conti ransomware, the memory of compromised computers is a popular hiding place for adversaries looking to conceal their presence from defenders while they load and execute the remote access agents that will serve as enablers for the rest of the attack. In the case of Conti, the remote access agent used was Cobalt Strike.

“Preventing attackers from taking hold in a compromised network is the goal of defenders everywhere,” said Mark Loman, director of engineering, Sophos. “This goal is critical because once a remote access agent has been installed, it can facilitate most of the active adversary tactics that take place during the attack. These include execution, credential access, privilege escalation, discovery, lateral movement, collection, exfiltration, and the release of the ransomware.

“Code intended for malicious use evades detection by being heavily obfuscated and packed and loaded directly into memory. Computer memory is not routinely scanned by security tools so that even when the code is de-obfuscated and unpacked in order to run, its presence is often not detected. Sophos has identified a characteristic – ‘Heap-Heap’ memory allocation – that is typical across multi-stage remote access agents and other attack code being loaded into memory and has built protection against it.”

Dynamic Shellcode Protection is based on the fact that code such as applications are stored in memory regions that have “execution” rights. This enables the apps to run. However, the apps generally need some additional, temporary, in-memory workspace, for example to unpack or store data. This variable workspace is commonly called “Heap” memory. Apps can request their Heap memory allocation to come with execution rights.

In most cyberattacks, however, the loader for a remote access agent is injected directly into Heap memory. It then needs to obtain further executable memory from the Heap in order to accommodate the needs of the inbound remote access agent. This is referred to as “Heap-Heap” memory allocation behavior.

Sophos researchers realized that such behaviour was a clear indicator of potentially suspicious activity and designed a practical protection that blocks the allocation of execution permissions from one Heap memory to another. In doing so, the protection can intercept many cyberattacks involving remote access agents, fileless malware and ransomware, while being compatible with normal applications.

“When a process, regardless of whether it is malicious or benign, violates the Heap memory allocation barrier, the Dynamic Shellcode Protection will block it and notify defenders. Security professionals can then take a closer look at what is going on,” said Loman. “The new protection is not meant as a silver bullet for all attacks, but it does mean that adversaries face a new obstacle that blocks a fundamental behavior of their stealthy code. We hope this will make attackers’ jobs harder and more complicated. The Dynamic Shellcode Protection does not rely on the cloud or machine learning. As such it represents a paradigm shift in the ongoing battle against many obfuscated malware and memory-delivered post-exploitation agents, including Cobalt Strike Beacon.”

Dynamic Shellcode Protection is integrated into Sophos Intercept X.

General Advice for Defending Against Ransomware

  • Shut down internet-facing remote desktop protocol (RDP) to deny cybercriminals access to networks
  • If you need access to RDP, put it behind a VPN connection
  • Use layered security to prevent, protect and detect cyberattacks, including endpoint detection and response (EDR) capabilities and managed response teams who watch networks 24/7
  • Be aware of the five early indicators an attacker is present to stop ransomware attacks
  • Have an effective incident response plan in place and update it as needed. If you don’t feel confident you have the skills or resources in place to do this, to monitor threats or to respond to emergency incidents, consider turning to external experts for help

À propos de Sophos

Sophos est un leader mondial innovant dans le domaine des solutions de sécurité avancées qui neutralisent les cyberattaques. La Société a fait l’acquisition de Secureworks en février 2025, réunissant ainsi deux pionniers qui ont redéfini l’industrie de la cybersécurité grâce à leurs services, technologies et produits innovants, optimisés par l’intelligence artificielle native. 
Sophos est désormais le plus grand fournisseur spécialisé de services de détection et réponse managées (MDR) protégeant plus de 28,000 organisations à travers et d’autres services, son portefeuille complet comprend les solutions de sécurité de pointe pour les endpoints, les réseaux, les emails et le cloud, qui interagissent et s’adaptent dynamiquement pour assurer une défense efficace via la plateforme Sophos Central.  
Secureworks apporte à cette alliance ses technologies innovantes et leaders sur le marché, notamment Taegis XDR/MDR, la détection et réponse aux menaces sur l’identité (ITDR), des capacités SIEM nouvelle génération, la gestion des risques ainsi qu’un ensemble complet de services de conseil en cybersécurité.  
Sophos commercialise l’ensemble de ces solutions à travers un réseau mondial de revendeurs, de fournisseurs de services managés (MSP) et de fournisseurs de services de sécurité managés (MSSP), protégeant plus de 600 000 entreprises contre le phishing, les ransomwares, le vol de données et d’autres cybermenaces, qu’elles soient quotidiennes ou menées par des Etats-nations.  
Toutes les solutions sont alimentées par des renseignements sur les menaces en temps réel et historiques issus de Sophos X-Ops et de la Counter Threat Unit (CTU) récemment intégrée.  
Le siège social de Sophos est situé à Oxford, au Royaume-Uni. Pour plus d’informations, consultez le site sophos.fr.