Adam Outler · Aug 11, 2012 at 07:30 am

LiME Forensics Kernel Module for Raw Memory Snapshots

Raw access to memory is useful while performing data forensics or while hacking devices.  Sometimes you need a snapshot of memory to be able to analyze what is going on with locked bootloaders, get a snapshot of a memory location to track down a bug, or just to figure out the proper memory location of your Angry Birds score. This is where Linux Memory Extractor, a.k.a. LiME Forensics, comes in. LiME is a loadable kernel module that allows you to access to the full range of device memory. As soon as the kernel module is loaded into memory, it basically takes a snapshot, allowing for very efficient debugging.

I asked Joe Sylve, the author of LiME Forensics to explain the benefeits of LiME over traditional tools like viewmem:

To answer your questions, the tools were designed with different uses in purpose.  LiME is designed to acquire a full dump of the physical memory layout of RAM for forensic analysis or security research.  It does it all in kernel space and can dump an image either to the local file system or over TCP.  It’s designed to give you as close of a copy of physical memory as possible, while minimizing it’s interaction with the system.
It appears viewmem is a userland program which reads a range of virtual memory addresses from a memory device, such as /dev/mem or /dev/kmem and prints the contents to stdout.  I’m not sure that it does more than simply using dd on one those devices would.
This is less acceptable in forensics for several reasons.  First of all, /dev/mem and /dev/kmem are being phased out and more and more devices aren’t shipping with those devices.  Secondly, /dev/mem and /dev/kmem limit you to reading from the first 896MB of RAM.  Also, the tool is causing several context switches between userland and kernelland for every block of memory read and is overwriting RAM with it’s buffers.
I’d say each tool has their use.  If you just need to know the contents of an address that’s within the first 896MB of RAM and your device has /dev/mem and /dev/kmem and you don’t care about capturing a forensically sound image, then viewmem (or dd) would be useful.  However, LiME was not designed specifically for that use case.

The most important thing, for you memory hackers out there, is that viewmem relies on the /dev/mem and /dev/kmem devices.  Since the /dev/mem and /dev/kmem devices allow direct access to device memory, they are a vulnerability.  These Linux devices are being phased out, as they have been the targets of multiple exploits as of late.  LiME not only replaces the viewmem utility, it does it better.

Manufacturers take note: By locking down features that developers want, you promote the development of better tools.

Source: LiME Forensics & Inteview with Author Joe Sylve

[Image Credit: LiME Presentation by Joe Sylve]
_________
Want something on the XDA Portal? Send us a tip!
TAGS:

Adam Outler

AdamOutler is an editor on XDA-Developers, the largest community for Android users. Electronics Tech/ Developer View AdamOutler's posts and articles here.
Mario Tomás Serrafero · Mar 31, 2015 at 11:55 am · 2 comments

Xiaomi Finally Releases Kernel Sources

If you are familiar with Xiaomi, you might have heard that they are not the most compliant when it comes to the General Public License that makes the core of Android open to us. The terms of the GPLv2 state that since the Android kernel is based on the Linux kernel, which is licensed under GPL,v2 Android has to be open-source for everyone to study or modify, and those that modify the Android kernel have to make their sources immediately available for...

XDA NEWS
Faiz Malkani · Mar 31, 2015 at 10:59 am · 2 comments

Xiaomi Announces Redmi 2A and More for 5th Anniversary

Xiaomi was founded on April 6th, 2010 and its fifth anniversary is just around the corner. In the past five years, the company has grown by leaps and bounds, rising to the positions of largest smartphone OEM in China and third-largest globally and coupled with its expansion plans and 100 million sales benchmark, this anniversary warranted a fervent celebration. After teasing products on its forums for a few days, Xiaomi held the anniversary event earlier today and staying true to the...

XDA NEWS
Tomek Kondrat · Mar 31, 2015 at 10:00 am · 2 comments

The History of Flagships: Part III – HTC

A few months ago, we came up with the idea of presenting the history of flagship devices released by some of the major Android OEMs. In this, we've had the pleasure of bringing you the stories of Sony (Ericsson) and Samsung. Now, it's time for our third and final installment. This is a very special episode, as the OEM I will talk about was heavily connected to Android and the beginnings of XDA as a whole. Yes, I'm talking about HTC, the...

XDA NEWS
Share This