
Linux 및 Android 기기에서 휘발성 메모리를 획득하는 커널 모듈로, 포렌식 무결성을 유지한 캡처를 디스크 또는 네트워크를 통해 생성합니다.
Linux 및 Linux 기반 장치(예: Android)에서 휘발성 메모리를 획득하기 위한 로드 가능한 커널 모듈(LKM)입니다. LiME는 획득 과정에서 사용자 공간과 커널 공간 프로세스 간의 상호 작용을 최소화하여, Linux 메모리 획득용으로 설계된 다른 도구들보다 포렌식적으로 더 건전한 메모리 캡처를 생성합니다.
LiME 사용법과 내부 구조에 대한 자세한 문서는 프로젝트의 "docs" 디렉터리에서 찾을 수 있습니다.
LiME는 모듈을 로드하기 위해 insmod 명령을 사용하며, 실행에 필요한 인자를 전달합니다.
insmod ./lime-$(uname -r).ko "path=<outfile | tcp:<port>>
format=<raw|padded|lime>
[digest=<digest>]
[dio=<0|1>]
[compress=<0|1>]
[localhostonly=<0|1>]
[timeout=<ms>]"
path (required):
outfile ~ name of file to write to on local system
tcp:port ~ network port to communicate over
format (required):
padded ~ pads all non-System RAM ranges with 0s,
starting from physical address 0
lime ~ each range prepended with fixed-size header
containing address space info
raw ~ concatenates all System RAM ranges
(warning: original position of dumped memory
is likely to be lost therefore making analysis
in most forensics tools impossible. This format
is not recommended except for advanced users)
digest (optional):
Hash the RAM and provide a sidecar file with the sum.
The sidecar filename is the output path with the
digest algorithm appended (e.g., ram.lime.sha256).
Supports kernel version 2.6.11 and up. See below for
available digest options.
Note: enabling digest increases code complexity during
acquisition and will overwrite additional memory. Only
use when integrity verification is required.
compress (optional):
1 ~ compress output with zlib
0 ~ do not compress (default)
Only available when CONFIG_ZLIB_DEFLATE is enabled
in the kernel.
Note: enabling compression allocates additional kernel
memory (~24 KB) and increases code complexity during
acquisition, disturbing more of the target system's
memory. Only use when the speed or size benefit is
required.
dio (optional):
1 ~ attempt to enable Direct IO
0 ~ do not attempt Direct IO (default)
localhostonly (optional):
1 ~ restricts tcp to only listen on localhost
0 ~ binds on all interfaces (default)
timeout (optional):
1000 ~ max milliseconds tolerated to read/write a
page (default, 1 second). If a page exceeds the timeout,
the rest of that memory range is skipped.
0 ~ disable the timeout so the slow region will
be acquired.
This feature is only available on kernels >= 2.6.35.
메모리를 파일로 획득:
insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"
네트워크를 통해 메모리 획득:
insmod ./lime-$(uname -r).ko "path=tcp:4444 format=lime"
그런 다음 수신 컴퓨터에서:
nc <target-ip> 4444 > ram.lime
adb를 사용하여 LiME를 로드하고 네트워크를 통해 메모리를 획득합니다:
adb push lime.ko /sdcard/lime.ko
adb forward tcp:4444 tcp:4444
adb shell
su
insmod /sdcard/lime.ko "path=tcp:4444 format=lime"
호스트 컴퓨터에서 netcat을 사용하여 메모리 덤프를 캡처합니다:
nc localhost 4444 > ram.lime
SD 카드로 획득:
insmod /sdcard/lime.ko "path=/sdcard/ram.lime format=lime"
LiME는 커널의 암호화 라이브러리에서 제공하는 모든 다이제스트 알고리즘을 지원합니다. TCP로 덤프할 때 다이제스트 파일을 수집하려면 두 개의 별도 연결이 필요합니다.
nc localhost 4444 > ram.lime
nc localhost 4444 > ram.sha1
빠른 참조를 위해 지원되는 다이제스트 목록은 다음과 같습니다.
crc32c
md4, md5
sha1, sha224, sha256, sha384, sha512
wp512, wp384, wp256
rmd128, rmd160, rmd256, rmd320
sha3-224, sha3-256, sha3-384, sha3-512
압축은 메모리 캡처를 획득하는 데 필요한 시간을 크게 줄일 수 있습니다. 압축하지 않은 전송에 비해 최대 4배의 속도 향상을 얻을 수 있으며 메모리 오버헤드는 최소입니다(~24 KB).
RAM 파일은 gzip 또는 zip 형식과 다른 zlib 형식입니다. 커널에 내장된 deflate 라이브러리가 해당 형식을 지원하지 않기 때문입니다.
압축을 풀려면 pigz 또는 zlib 호환 라이브러리를 사용할 수 있습니다.
nc localhost 4444 | unpigz > ram.lime
RAM 파일만 압축됩니다. 다이제스트 파일은 압축되지 않으며 해시 값은 압축되지 않은 데이터와 일치합니다.
LiME는 2012년 Shmoocon에서 Joe Sylve가 처음 발표했습니다.
Youtube~ Android Mind Reading: Memory Acquisition and Analysis with DMD and Volatility