MemForge is a Linux memory acquisition tool focused on creating dump artifacts.
| Maintainer | Cuma KURT — cumakurt@gmail.com |
| Source | github.com/cumakurt/memforge |
memforge dump— Captures memory and writes a dump artifact plus a sidecar.memforge.jsonmanifest with metadata (hash, host, kernel, method, size).- Default mode is physical and writes uncompressed raw linear memory.
- Use
--compressfor.zstoutput. - Use
--type process --pid <PID>for process dumps. - Output can be a file path or a target directory (
-o).
memforge doctor— Quick host capability check for physical acquisition (/dev/memandmemforge_kacreadiness).memforge kac— Helper commands for bundledmemforge-kackernel module.
git clone https://github.com/cumakurt/memforge.git && cd memforge
chmod +x install.sh && sudo ./install.shBy default this installs to /usr/local, builds the release binary, and builds memforge-kac unless INSTALL_MEMFORGE_KAC=0 is set.
git clone https://github.com/cumakurt/memforge.git && cd memforge
chmod +x install_static.sh && ./install_static.shThis produces a static binary in the repository root:
./memforge-static(default)
Optional:
OUT_NAME=memforge ./install_static.sh
TARGET_TRIPLE=x86_64-unknown-linux-musl ./install_static.sh
SKIP_PACKAGE_INSTALL=1 ./install_static.shmemforge-kac is an out-of-tree Linux kernel module bundled in memforge-kac/.
It exists to provide a fallback acquisition path when user-space /dev/mem access
is restricted by kernel hardening (commonly STRICT_DEVMEM/related policies).
On many modern Linux systems, reading full physical RAM via /dev/mem is limited.
Typical behavior is:
- very low ranges may be readable,
- then reads fail with
Permission denied, or - resulting artifact is incomplete.
MemForge uses this strategy:
- try
/dev/memfirst (default physical path), - if that cannot read full memory, use
memforge-kacfallback (when available).
Without the module, full physical dumps may be impossible on hardened kernels.
You should build/load memforge-kac when:
memforge doctorreports/dev/memlimitations,- physical dump fails early with access errors,
- you need reliable full physical acquisition on production kernels.
You may skip it when:
/dev/memworks for your environment and use case,- you only do process dumps (
--type process), - you intentionally avoid kernel module loading.
- Building/loading a kernel module requires root privileges.
- The module runs in kernel space; treat it as sensitive code.
- Only use on systems where you are authorized to perform memory acquisition.
- Keep kernel headers matching your running kernel (
uname -r).
Both installers support automatic dependency detection and module build:
./install.sh(standard install)./install_static.sh(static standalone build)
Default behavior is to build memforge-kac.
To skip module build explicitly:
INSTALL_MEMFORGE_KAC=0 ./install.sh
INSTALL_MEMFORGE_KAC=0 ./install_static.shIf you want full manual control:
- Install matching kernel headers for the running kernel
uname -r
# install headers/devel package matching this exact kernel releaseExamples by distribution:
# Debian / Ubuntu / Kali
sudo apt-get update
sudo apt-get install -y "linux-headers-$(uname -r)"
# Fedora
sudo dnf install -y kernel-devel kernel-headers
# RHEL / Rocky / Alma / CentOS
sudo dnf install -y kernel-devel kernel-headers
# or (older systems)
sudo yum install -y kernel-devel kernel-headers
# Arch / Manjaro
sudo pacman -Sy --needed linux-headers
# openSUSE / SLES
sudo zypper --non-interactive install -y kernel-default-devel kernel-devel
# fallback:
sudo zypper --non-interactive install -y kernel-devel
# Alpine
sudo apk add --no-cache linux-headers- Build module
cd memforge-kac
makeExpected output artifact:
memforge-kac/memforge_kac.ko
- Load module
sudo insmod ./memforge_kac.koAlternative (if installed under module tree):
sudo modprobe memforge_kac- Verify module is active
lsmod | grep memforge_kac
test -e /proc/memforge_kac/control && echo "control interface ready"- Optional unload
sudo rmmod memforge_kacNo such file or directoryon module load:- module was built for a different kernel version than
uname -r.
- module was built for a different kernel version than
Invalid module format:- kernel ABI/version mismatch; rebuild with matching headers.
Operation not permitted:- root privileges or module loading policy restrictions (e.g. secure boot lockdown).
- build fails in
make -C /lib/modules/.../build:- kernel headers/devel package is missing or mismatched.
For most users, keep default installer behavior (build module automatically),
run memforge doctor, then use:
memforge dump --type physical --physical-backend autoThis gives best effort /dev/mem first and reliable fallback through memforge-kac.
memforge dump
memforge dump -o /path/to/dir/
memforge dump -o /path/file.zst
memforge dump --type process --pid 1234 -o ./proc1234.zst
memforge doctor
memforge kac status
Use memforge <subcommand> --help for options.
RUST_LOG, MEMFORGE_CONFIG_DIR, MEMFORGE_PREFIX, MEMFORGE_KAC_KO, MEMFORGE_AUTOLOAD_KAC
Use only for authorized security work, forensics, and legitimate administration.
AGPL-3.0-only — see LICENSE.
