Blog Post

Microsoft Defender for Cloud Blog
3 MIN READ

Fileless Attack Detection for Linux Preview is Expanding

Ben Nick's avatar
Ben Nick
Icon for Microsoft rankMicrosoft
Jul 28, 2020

This blog post was co-authored by Aditya Joshi, Senior Software Engineer, Enterprise Protection and Detection.

 

The Security Center team is excited to share that the Fileless Attack Detection for Linux Preview, which we announced earlier this year, is expanding to include all Azure VMs and non-Azure machines enrolled in Azure Security Center Standard and Standard Trial pricing tiers.  This solution periodically scans your machine and extracts insights directly from the memory of processes.  Automated memory forensic techniques identify fileless attack toolkits, techniques, and behaviors.  This detection capability identifies attacker payloads that persist within the memory of compromised processes and perform malicious activities.

 

See below for an example fileless attack from our preview program, a description of detection capabilities, and an overview of the onboarding process.

 

Real-world attack pattern from our preview program

We continue to see the exploitation of vulnerabilities and multi-staged attack payloads with shellcode and dynamic code visible only in memory.  In this example, a customer’s VM is running shellcode-based malware and a cryptominer as root within a compromised docker container.  

Here are the steps of the attack:

  • The attacker uses an unauthenticated network facing service running inside a docker container to achieve code execution as root inside the container.
  • The attacker downloads and executes a file and deletes the file to deter disk-based detection, leaving only the in-memory payload.
  • The attacker achieves persistence by adding a crontab task to run a bash shell script to download a 2nd stage payload.  The 2nd stage payload is a packed file containing the XMRIG cryptocurrency miner. 
  • The attacker unpacks and runs XMRIG within the container. XMRIG persists in memory and connects to a miner pool to start crypto mining.
  • The attacker deletes the on-disk packed file so that the crypto mining activity is only observable in-memory.

 

Detecting the attack

In the attack above, fileless attack detection, running on the docker host, uncovers the compromise via in-memory analysis.  It starts by identifying dynamically allocated code segments, then scanning each code segment for specific behaviors and indicators.

The first payload’s code segment contains shellcode with references to syscalls used for creating new tasks, getting process information and process control. Subset of detected syscalls include: fork, getpid, gettid and  rt_sigaction.

The second payload’s code segment contains an injected executable consisting of a well-known crypto mining toolkit: XMRIG.  Additionally, fileless attack detection identifies the active network connection to the crypto mining pool.  

 

Fileless attack detection preview capabilities

For the preview program, fileless attack detection scans the memory of all processes for shellcode, malicious injected ELF executables, and well-known toolkits.  Toolkits include crypto mining software such as the one mentioned above.

At the start of the preview program, we will emit alerts for well-known toolkits: 

 

The alerts contain information to assist with triaging and correlation activities, which include process metadata:

Alert details also include the toolkit name, capabilities of the detected payload, and network endpoints.

 

We plan to add and refine alert capabilities over time. Additional alert types will be documented here.

Process memory scanning is non-invasive and does not affect the other processes on the system. Most scans run in less than five seconds. The privacy of your data is protected throughout this procedure as all memory analysis is performed on the host itself. Scan results contain only security-relevant metadata and details of suspicious payloads.

 

Onboarding details

We will be onboarding customer machines in phases to ensure the smoothest possible customer experience.  Deployment begins on July 28th and completes by September 3rd.  This capability is automatically deployed to your Linux machines as an extension to the Log Analytics Agent for Linux (also known as the OMS Agent). This agent supports the Linux OS distributions described in this document. Azure VMs and non-Azure machines must be enrolled in Standard or Standard Trial pricing tier to benefit from this detection capability.

 

To learn more about Azure Security Center, visit the Azure Security Center page.

Updated Nov 30, 2021
Version 2.0
No CommentsBe the first to comment