Home

Awesome

The LeechCore Physical Memory Acquisition Library:

The LeechCore Memory Acquisition Library focuses on Physical Memory Acquisition using various hardware and software based methods.

LeechCore provides API-based access to various hardware and software based memory sources via its C/C++, Python and C# APIs. Download the latest release of the library here on Github. If using Python it's recommended to install the leechcorepyc python pip package which is available for 64-bit Linux and Windows.

Use the LeechCore library locally or connect to, over the network, a LeechAgent to acquire physical memory or run commands remotely. The connection is by default compressed and secured with mutually authenticated kerberos - making it ideal in incident response when combined with analysis and live memory capture using Comae DumpIt or WinPMEM - even over high latency low-bandwidth connections!

The LeechCore library is used by PCILeech and The Memory Process File System (MemProcFS).

The LeechCore library is supported on 32/64-bit Windows (.dll) and 64-bit Linux (.so). No executable exists for LeechCore - the library is always loaded by other applications using it - such as PCILeech and The Memory Process File System MemProcFS.exe.

For detailed information about individual memory acquisition methods, the API and related examples please check out the LeechCore wiki.

Memory Acquisition Methods:

Software based memory aqusition methods:

Please find a summary of the supported software based memory acquisition methods listed below. Please note that the LeechAgent only provides a network connection to a remote LeechCore library. It's possible to use both hardware and software based memory acquisition once connected.

DeviceTypeVolatileWriteLinux SupportPlugin
RAW physical memory dumpFileNoNoYesNo
Full Microsoft Crash DumpFileNoNoYesNo
Full ELF Core DumpFileNoNoYesNo
QEMULive MemoryYesYesNoNo
VMwareLive MemoryYesYesNoNo
VMware memory save fileFileNoNoYesNo
TotalMeltdownCVE-2018-1038YesYesNoNo
DumpIt /LIVEKDLive MemoryYesNoNoNo
WinPMEMLive MemoryYesNoNoNo
LiveKdLive MemoryYesNoNoNo
LiveCloudKdLive MemoryYesYesNoYes
libmicrovmiLive MemoryYesYesYesYes
Hyper-V Saved StateFileNoNoNoYes
LeechAgent*RemoteNoNo

Hardware based memory aqusition methods:

Please find a summary of the supported hardware based memory acquisition methods listed below. All hardware based memory acquisition methods are supported on both Windows and Linux.

DeviceTypeInterfaceSpeed64-bit memory accessPCIe TLP accessProject<br>Sponsor
Screamer PCIe SquirrelFPGAUSB-C190MB/sYesYes💖
ZDMAFPGAThunderbolt31000MB/sYesYes💖
LeetDMAFPGAUSB-C190MB/sYesYes💖
AC701/FT601FPGAUSB3190MB/sYesYes
USB3380-EVBUSB3380USB3150MB/sNoNo
PP3380USB3380USB3150MB/sNoNo
DMA patched HP iLOBMCTCP1MB/sYesNo

The LeechAgent Memory Acquisition and Analysis Agent:

The LeechAgent Memory Acquisition and Analysis Agent exists for Windows only. It allows users of the LeechCore library (PCILeech and MemProcFS) to connect to remotely installed LeechAgents over the network. The connection is secured, by default, with mutually authenticated encrypted kerberos.

Once connected physical memory may be acquired over the secure compressed connection. Memory analysis scripts, written in Python, may also be submitted for remote processing by the LeechAgent.

The LeechAgent authenticates all incoming connections against membership in the Local Administrators group. The clients must also authenticate the agent itself against the SPN used by the agent - please check the Application Event Log for information about the SPN and also successful authentication events against the agent.

There is also a possibility to run the LeechAgent in interactive mode (as a normal program). If run in interactive mode a user may also start the LeechAgent in "insecure" mode - which means no authentication or logging at all.

The LeechAgent listens on the port tcp/28473 - please ensure network connectivity for this port in the firewall. Also, if doing live capture ensure that LeechAgent (if running in interactive mode) is started as an administrator.

For more information please check the LeechCore wiki and the blog entry about remote live memory capture with the LeechAgent.

The videos below shows the process of installing the LeechAgent to a remote computer, connecting to it with MemProcFS to analyze and dump the memory while also connecting to it in parallel with PCILecch to submit a Python memory analysis script that make use of the MemProcFS API to analyze the remote CPU page tables for rwx-sections. Click on the video to open a higher-quality version on Youtube.

<p align="center"><a href="https://www.youtube.com/watch?v=UIsNWJ5KTvQ" alt="Installing the LeechAgent, Dumping remote memory and running remote Python analysis scripts." target="_new"><img src="https://raw.githubusercontent.com/wiki/ufrisk/LeechCore/resources/agent-anim.gif"/></a>&nbsp;&nbsp;<a href="https://www.youtube.com/watch?v=Mij6LY1z4SY" alt="Demo: Remote memory analysis with MemProcFS and PCILeech" target="_new"><img src="http://img.youtube.com/vi/Mij6LY1z4SY/0.jpg" height="285"/></a></p>

Examples:

Installing the LeechAgent on the local system (run as elevated administrator)'. Please ensure that the LeechAgent.exe is on the local C: drive before installing the agent service. Please also ensure that dependencies such as required .dll and/or .sys files (and optional Python sub-subfolder) are put in the same directory as the LeechAgent before running the install command.

Installing the LeechAgent on a remote system (or on the local system) in the Program Files\LeechAgent folder. An Actice Directory environment with remote access to the Service Manager of the target system is required. For additional information see the wiki entry about installing LeechAgent.

Uninstall an existing, locally installed, LeechAgent. The agent service will be uninstalled but any files will remain.

Uninstall a LeechAgent from a remote system and delete the Program Files\LeechAgent folder.

Start the LeechAgent in interactive mode only accepting connections from administative users over kerberos-secured connections. Remember to start as elevated administrator if clients accessing LeechAgent should load WinPMEM to access live memory.

Start the LeechAgent in interactive insecure mode - accepting connections from all clients with access to port tcp/28473. NB! unauthenticated clients may dump memory and submit Python scripts running as SYSTEM. Use with care for testing only!

Start the LeechAgent in interactive mode with DumpIt LIVEKD to allow connecting clients to access live memory. Start as elevated administrator. Only accept connections from administative users over kerberos-secured connections.

Start the LeechAgent in interactive mode with DumpIt LIVEKD to allow connecting clients to access live memory. Start as elevated administrator. Accept connections from all clients with access to port tcp/28473 without any form of authentication.

PCILeech and MemProcFS community:

Find all this a bit overwhelming? Or just want to ask a quick question? Join the PCILeech and MemProcFS DMA community server at Discord!

<a href="https://discord.gg/pcileech"><img src="https://discord.com/api/guilds/1155439643395883128/widget.png?style=banner3"/></a>

Building:

<b>Pre-built binaries, modules and configuration files are found in the latest release.</b> Build instructions are found in the Wiki in the Building section.

Contributing:

PCILeech, MemProcFS and LeechCore are open source but not open contribution. PCILeech, MemProcFS and LeechCore offers a highly flexible plugin architecture that will allow for contributions in the form of plugins. If you wish to make a contribution, other than a plugin, to the core projects please contact me before starting to develop.

Links:

Support PCILeech/MemProcFS development:

PCILeech and MemProcFS is free and open source!

I put a lot of time and energy into PCILeech and MemProcFS and related research to make this happen. Some aspects of the projects relate to hardware and I put quite some money into my projects and related research. If you think PCILeech and/or MemProcFS are awesome tools and/or if you had a use for them it's now possible to contribute by becoming a sponsor!

If you like what I've created with PCIleech and MemProcFS with regards to DMA, Memory Analysis and Memory Forensics and would like to give something back to support future development please consider becoming a sponsor at: https://github.com/sponsors/ufrisk

To all my sponsors, Thank You 💖

All sponsorships are welcome, no matter how large or small. I especially wish to thank my bronze sponsors: grandprixgp.

Changelog:

<details><summary>Previous releases (click to expand):</summary> v1.0-1.8 * Initial Release and various updates. Please see individual relases for more information.

v2.0

v2.1

v2.2

v2.3

v2.4

v2.5

v2.6

v2.7

v2.8

v2.9

v2.10

v2.11

v2.12

v2.13

v2.14

v2.15

v2.16

</details>

v2.17

v2.18

Latest: