Rekall and GRR: Searching For Evil, Together!
Rekall and GRR: Searching For Evil, Together!
Michael Cohen
Google Inc
Rekall - What is it?
● A suite of Digital Forensic/Incident Response tools:
○ Pmem suite of memory acquisition tools.
■ MacPmem - only driver (commercial or opensource) that works with latest OSX.
■ WinPmem - the most advanced and reliable windows memory acquisition tool.
■ LinPmem - Linux acquisition driver (We usually use /proc/kcore though).
○ Live analysis capability:
■ Automatically load driver and access raw memory without taking an image first.
■ Used for triaging and collecting a more complete image.
■ Focus on automated acquisition with live analysis.
○ The largest repository for memory analysis profiles:
■ Rekall usually autodetects the right profile to use automatically.
○ Focus on user experience.
■ Automate as much as possible
■ Provide a complete working environment with a user friendly interface.
Installing
$ virtualenv /path/to/MyEnv
New python executable in
Rekall /path/to/MyEnv/bin/python
Installing setuptools, pip...done.
$ source /path/to/MyEnv/bin/activate
$ pip install --upgrade setuptools pip wheel
$ pip install rekall
On Windows:
Edit ~/.rekallrc:
profile_path:
- /path/to/my/rekall-profiles/
Note: For this workshop I have provided a copy of the main branch on the
thumbdrive. Unzip it somewhere and point Rekall at it if the internet does
not work for you. (c:\python27\python -m zipfile -e foo.zip
path)
Rekall tips Use command completion by typing tab twice
rekall --live
Insert memory drivers and gain access to raw physical
memory.
❖ Usage examples:
➢ AFF4 Zip file: winpmem -o output.aff4 -c snappy
➢ AFF4 Directory: winpmem -o output.dir\ -c snappy
➢ Raw, padded format in a zip file: winpmem -o output.aff4 --format raw
➢ Raw, padded format in a directory: winpmem -o output.dir/--format raw
More information:
http://rekall-forensic.blogspot.ch/2016/05/the-pmem-suite-of-memory-acquisit
ion.html
Acquisition through Rekall
● Rekall itself may be used to acquire memory.
○ This allows triaging and analysis to be done prior to acquisition.
○ Allows Artifact Collector to be used (more on that later).
Structured output
● Most Rekall plugins produce tabular output:
the windows
}
directory.
select path.filename from Path glob
glob("c:\windows\*.exe")
the windows
parameters:
encoded in
binary_string: {str})',
query_parameters=dict(str="Microsoft"
UTF16. .encode("utf-16-le").encode("hex")))
Example - process listing through WMI
● WMI plugin allows arbitrary
WMI queries to be issued.
● There are many resources for
good IR WMI queries to issue.
● The wmi plugin allows to
specify a different base object
Excercise - Use WMI
1. List local user accounts.
2. List installed hotfixes.
3. Which AV product is installed?
4. What are the MAC addresses? What IP addresses are currently assigned?
artifacts
artifact locates modules which are not loaded from this location. Such
kernel modules might be suspicious because they are loaded from temporary
paths or dropped by first stage loaders.
sources:
- type: REKALL_EFILTER
attributes:
query: >
select offset_v, file_name, module_base, module_size, path from
modules() where not (path =~ "(?i)Windows")
image_type:
- Windows
type_name: modules
fields:
- name: offset_v
type: int
style: address
- name: file_name
type: unicode
- name: module_base
type: int
style: address
- name: module_size
type: int
style: address
- name: path
type: unicode
Collecting Artifacts
Collecting Artifacts - ARTIFACT_GROUPS
Collecting
Artifacts -
Collecting
files
Collecting Artifacts - Collecting timelines
● Activate it
e:\GRRDev\Scripts\activate
grr_client_build --context
"DebugClientBuild Context" repack
--output_dir templates --template
templates\GRR_3.1.3.0_amd64.exe.zip
Install the
client.