Using eBPF for malware analysis
Cybercrime is a major financial problem for organizations worldwide. In 2021, the damage caused by cybercrime was estimated at nearly 6 trillion dollars. Cybercriminals use malware to steal sensitive data, hold data hostage, and cause other damage. Much of this malware is highly targeted at specific victims. Anyone who wants to protect themselves against it must understand how malware works.
Malware analysis involves determining the purpose and functionality of a piece of malware. In static analysis, you examine the sample without executing it. However, malware is often obfuscated, which makes static analysis difficult. Researchers then turn to dynamic malware analysis: they execute the sample to determine its purpose and functionality. This is done in a sandbox, so that the malware cannot cause any real damage. Cybercriminals have adapted their malware accordingly: it detects analysis attempts and tries to evade them.
Advanced Tracing and Monitoring with eBPF
eBPF is a feature of the Linux kernel that allows you to extensively trace and monitor events within the kernel. It is considered a better way to make the kernel programmable than kernel modules. A kernel module can cause the kernel to crash; eBPF programs offer better safeguards. Before they are allowed to run, a verifier checks whether they are safe and will not damage the system or consume too many resources. eBPF can hook into predefined tracepoints in the kernel and in userspace, as well as into certain system calls. Using the Express Data Path (XDP), eBPF can also install programs for packet processing, enabling advanced network monitoring.
Research Approach and Proof of Concept
This study examined how effective eBPF’s observability features are for analyzing malware that attacks Linux systems. First, the study examined how Linux malware typically behaves. Next, programs were developed, each of which simulates one aspect of Linux malware. Finally, a proof-of-concept suite of eBPF programs was built and tested to determine how well it classifies the behavior of each emulated program.