This article is contributed. See the original author and article here.

This blog post was co-authored by:


Aditya Joshi, Senior Software Engineer, Microsoft Defender for Endpoint


Tino Morenz, Senior Software Engineer, Enterprise Data Protection


 


The Azure Defender team is excited to share that the Fileless Attack Detection for Linux Preview, which we announced earlier this year, is now generally available for all Azure VMs and non-Azure machines enrolled in Azure Defender.


 


Fileless Attack Detection for Linux 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


In our continuous monitoring of fileless attacks we often encounter malware components, exhibiting in-memory ELF and shellcode payloads that are in the initial stages of being weaponized by attackers.


 


In this example, a customer’s VM is infected with malware that is attempting to blend in as standard system security components.



  • The first component of the malware is the binary /usr/bin/.securetty/.esd-644/auditd, running from the user’s bin location under hidden folders. On disk, the file has been packed with UPX and contains no section headers.

  • The malware filename is auditd, which is the userspace component of the Linux Auditing System. In addition, the commandline for the malware is “/usr/sbin/abrtd”. This path is associated with the Automatic Bug Reporting Tool, a daemon that watches for application crashes.

  • Accompanying the masquerading auditd is another payload impersonating anacron, a system utility used to execute commands periodically.

  • The second payload runs with the commandline “/usr/sbin/anacron -s” and runs as the file name devkit-power-daemon to impersonate the DeviceKit-power daemon. The malware also maintains a persistent outgoing TCP connection to port 53, which is typically associated with DNS queries.


 


Detecting the attack



  • Fileless Attack Detection begins by identifying dynamically allocated code segments that are not backed by the filesystem. In this case, this scan identifies a 32-bit ELF in an anonymous executable region of memory.

  • Next our detector scans these segments for specific behaviors and indicators. Packed malware, such as in this case, obfuscates its contents on disk, but often exhibits malicious indicators in-memory.

  • The in-memory ELF analysis identifies numerous syscalls to perform system operations for process control, dynamic memory allocation, signal handling and changing thread context. Some of the syscalls identified include clone, epoll_create, getpid, gettid, kill, mmap, munmap, rt_sigaction, rt_sigprocmask, set_thread_area, sigaltstack, and tgkill.


 


Fileless attack detection capabilities


Fileless Attack Detection for Linux scans the memory of all processes for shellcode, malicious injected ELF executables, and well-known toolkits.  Toolkits include crypto mining software.


 


Here is an example alert:


 

PI for Linux Alert Summary.png


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


 

PI for Linux Alert Metadata.png


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


This capability is automatically deployed to your Linux machines as an extension to the Log Analytics Agent for Linux, which is 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 Azure Defender to benefit from this detection capability.


 


To learn more about Azure Defender, visit the Azure Defender Page.

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.