Linux users today run everything from lightweight desktops like Xubuntu and Lubuntu to professional creative tools such as Pinta and office suites like ONLYOFFICE 9.3. At the same time, everyday command-line utilities like the pwd command remain essential for navigation, while developers often rely on tools such as Notepad++ on Linux alternatives for editing code.
Behind these everyday workflows lies a complex operating system kernelโand when security incidents happen, understanding what is happening inside memory becomes critical. This is where mquire, a new open-source Linux memory forensics tool, enters the scene.
Unlike traditional forensic tools that depend heavily on external debugging symbols tied to specific kernel versions, mquire takes a different approach. It extracts the information it needs directly from the memory dump itself. For incident responders, security researchers, and digital forensics analysts, this dramatically simplifies the process of analyzing compromised Linux systems.
In this article, we explore what mquire is, how it works, why it matters for Linux security investigations, and how you can start using it in your forensic workflow.
Understanding Linux Memory Forensics
Memory forensics is the process of analyzing volatile memory (RAM) to discover information about a systemโs state at a specific moment in time. This can reveal critical artifacts such as:
- Running processes
- Open files
- Active network connections
- Loaded kernel modules
- Hidden or malicious processes
- In-memory malware
Unlike disk analysis, memory forensics captures information that may never be written to storage. Many modern attacks intentionally avoid leaving traces on disk, operating purely in memory.
Historically, Linux memory analysis has been more difficult than Windows analysis due to differences in kernel configurations and the lack of standardized debugging data. Tools often require exactly matching kernel profiles or debug symbols. If the symbols are unavailable for a specific kernel build, analysis can become extremely difficult or even impossible.
This limitation is precisely the problem that mquire was designed to solve.
What Is mquire?
mquire is an open-source Linux memory forensics tool designed to analyze kernel memory dumps without requiring external debug symbols or kernel profiles.
The project was released by the security research firm Trail of Bits and aims to simplify the investigation of compromised Linux systems.
The core idea behind mquire is straightforward: instead of relying on external metadata about the kernel, it extracts the required information directly from the memory dump. This makes it possible to analyze:
- Unknown kernels
- Custom kernel builds
- Systems without available debug symbols
- Production environments where debug packages were never installed
For forensic analysts and incident responders, this removes one of the most frustrating barriers in Linux memory investigations.
The Problem with Traditional Memory Analysis Tools
Many existing forensic frameworks require matching kernel debugging information.
In practice, this creates several challenges:
- Debug symbols are rarely installed on production systems
- Repositories containing symbols may be outdated
- Custom kernels may not have symbols available
- Kernel updates often invalidate existing profiles
If investigators cannot obtain the correct symbols for the exact kernel version used on the compromised system, the analysis process may stall completely.
mquire eliminates this dependency by extracting kernel structure information directly from the memory snapshot itself.
How mquire Works
mquire relies on two key sources of information embedded inside modern Linux kernels:
1. BTF (BPF Type Format)
BTF is a compact format used by modern Linux kernels to store information about data structures. It was originally designed for eBPF programs so they could interact with kernel structures reliably across different kernel versions.
The BTF data provides:
- Kernel structure definitions
- Field offsets
- Type relationships
- Size and layout of structures
This information allows mquire to understand how kernel objects are structured inside memory.
2. Kallsyms
Kallsyms contains the addresses of kernel symbols. On a running system, this information is accessible through:
/proc/kallsyms
mquire scans the memory dump to locate this symbol information and combine it with BTF data.
By combining these two data sources, the tool can locate and interpret important kernel structures such as:
- Process lists
- File descriptors
- Memory mappings
- Network structures
This method enables memory analysis without any external symbol files.
SQL-Based Memory Exploration
One of the most interesting design choices in mquire is its SQL-based interface.
Instead of forcing analysts to rely on dozens of specialized plugins, mquire exposes system information as queryable tables. This approach is inspired by the system instrumentation tool osquery, which allows users to query operating system information using SQL syntax.
For example, investigators can query running processes using a command like:
mquire query snapshot.lime 'SELECT pid, command_line FROM tasks LIMIT 10;'
Because the interface is relational, analysts can join different tables to reconstruct system behavior.
For example, you could correlate processes with open files:
mquire query snapshot.lime 'SELECT tasks.pid, task_open_files.path FROM task_open_files JOIN tasks ON tasks.tgid = task_open_files.tgid LIMIT 5;'
This relational approach allows investigators to build complex queries quickly without needing specialized plugins for each forensic artifact.
What You Can Investigate with mquire
mquire exposes multiple tables representing system information extracted from the memory dump.
Some of the most useful include:
System information
- OS version
- Kernel details
- Boot time
Processes
- Running tasks
- Process IDs
- Command lines
- Binary paths
File activity
- Open file descriptors
- File paths
- Cached files in memory
Networking
- Active network connections
- Network interfaces
Kernel components
- Loaded kernel modules
- Kernel ring buffer messages
- Kernel symbol tables
This information allows investigators to reconstruct system activity at the time the memory snapshot was captured.
File Recovery from Memory
Another powerful capability of mquire is file extraction from the kernel page cache.
Linux keeps recently accessed file data in memory for performance reasons. Even if a file has been deleted from disk, its contents may still exist in RAM.
mquire provides a command that extracts cached file contents directly from memory:
mquire command snapshot.lime '.dump /output_directory'
This feature can be extremely useful in forensic scenarios where attackers attempt to delete evidence.
Detecting Hidden Processes and Rootkits
Rootkits sometimes hide processes by manipulating kernel data structures. One common technique involves unlinking a process from the kernelโs task list while leaving it running.
mquire implements multiple process enumeration strategies, including:
- Walking the kernel task list
- Enumerating processes through the PID namespace
By comparing the results of these methods, investigators may detect processes that appear in one list but not the other. Such inconsistencies can indicate rootkit activity or kernel manipulation.
Kernel Requirements
mquire works with modern Linux kernels that provide the necessary metadata.
The primary requirements include:
- Kernel 4.18 or newer with BTF enabled
- Kernel 6.4 or newer for Kallsyms format compatibility
Most modern Linux distributions already enable BTF because it is required for many eBPF tools.
Getting Started with mquire
Before analyzing memory, you must first capture a memory dump. One commonly used tool for this purpose is LiME (Linux Memory Extractor).
Example command to capture memory:
insmod lime.ko "path=/tmp/memory.lime format=lime"
Once the memory dump is obtained, you can start exploring it with mquire.
Interactive shell:
mquire shell /path/to/memory.lime
Running a single query:
mquire query /path/to/memory.lime 'SELECT * FROM os_version;'
Listing available tables:
mquire query /path/to/memory.lime '.schema'
This workflow makes it possible to begin analyzing system artifacts almost immediately.
Limitations of mquire
Although mquire introduces several important innovations, it also has some limitations.
First, the tool focuses primarily on kernel-level analysis. BTF does not contain information about user-space structures, so detailed analysis of user-space memory is outside its scope.
Second, the tool relies on the format used by the kernelโs Kallsyms implementation. If future kernel versions change this format significantly, the detection logic may need to be updated.
Despite these limitations, the tool already provides significant capabilities for incident response and forensic analysis.
Why mquire Matters for Linux Security
Linux servers power much of the modern internet. They run cloud infrastructure, containers, enterprise platforms, and embedded devices. As attacks against Linux environments increase, forensic capabilities become more important.
mquire introduces several advantages:
- Eliminates dependence on external debug symbols
- Works with unknown or custom kernels
- Provides a flexible SQL interface
- Enables recovery of files directly from memory
- Supports advanced rootkit detection techniques
For DFIR professionals, these improvements can significantly reduce the time required to begin investigating a compromised system.
Final Thoughts
Linux memory forensics has historically been a complex field filled with compatibility challenges and missing debug symbols. mquire changes that landscape by introducing a smarter approach: extracting the necessary information directly from the memory dump itself.
The SQL-based investigation model also makes memory analysis more accessible and flexible, allowing analysts to explore system artifacts using familiar query techniques.
As the tool evolves and gains additional features, it may become a valuable addition to the toolkit of security researchers, incident responders, and forensic investigators working with Linux systems.
If you regularly analyze Linux systems during incident response, mquire is definitely a project worth following.





