Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
LID — LID — Linux Integrity Drift: Bypassing AppArmor via eBPF pathname rewriting. Pre-LSM syscall argument manipulation with zero audit footprint. "Linux is Dying" | Kitploit
Tools/GitHubGitHub/azqzazq1/lid
Privilege EscalationVulnerability AnalysisExploitationIDS/IPS EvasionPenetration TestingBinary AnalysisPapers & ResearchLearning & EducationRed Teaming
GitHubazqzazq1/lid

LID

LID — Linux Integrity Drift: Bypassing AppArmor via eBPF pathname rewriting. Pre-LSM syscall argument manipulation with zero audit footprint. "Linux is Dying"

201194 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
View Repository


  ██╗     ██╗██████╗ 
  ██║     ██║██╔══██╗
  ██║     ██║██║  ██║
  ██║     ██║██║  ██║
  ███████╗██║██████╔╝
  ╚══════╝╚═╝╚═════╝ 

Linux Integrity Drift

— "Linux is Dying" —


Systematic discovery of kernel code paths that bypass LSM security guarantees
The gate was never breached. It was walked around.



What is LID?

The Linux Security Module framework has one core guarantee that has held for 20+ years:

Security modules can only add restrictions. They can never remove them.

This guarantee is correct. LID doesn't break it.

LID finds kernel code paths that bypass LSM hooks entirely — subsystems that perform security-sensitive operations without consulting the LSM framework. The security check is correct. The problem is that the kernel never asks.


Understanding What LID Is (and Isn't)

Each finding has two distinct dimensions that should not be conflated:

A) Policy Visibility Gap

The architectural blind spot. The question is not "can an attacker exploit this?" but:

  • What does AppArmor/SELinux actually see?
  • What does the audit log record?
  • What does your SIEM/EDR observe?
  • What does the policy engine think happened?

If a security-sensitive operation occurs and the enforcement layer never even evaluates it, you have a visibility gap — regardless of whether an attacker can practically abuse it today. This matters for compliance, forensics, and defense-in-depth assumptions.

B) Practical Escalation Path

The real-world exploitability question:

  • Does this cross a privilege boundary?
  • Does an attacker need existing root/CAP_BPF to trigger it?
  • Is an exploit chain required, or is it standalone?
  • What is the actual impact — data access, privilege escalation, policy evasion?

These two things are different. A finding can be a critical visibility gap (your monitoring is blind) without being a practical privilege escalation (attacker already needs root). Conversely, a finding can be a direct escalation path with minimal prerequisites.

FindingVisibility GapPractical Escalation
LID-001Critical — AppArmor sees nothing, audit log empty, zero forensic traceLimited — requires root or CAP_BPF+CAP_PERFMON (already privileged). Not a privilege escalation. Impact: policy evasion + audit blindness.
LID-002High — security_file_receive() never fires, fd transfer invisible to all LSMsHigh — works from unprivileged userspace via io_uring. Crosses LSM enforcement boundary without any privilege.
LID-003High — security_sb_mount() bypassed, AppArmor mount policy is dead codeMedium — requires mount namespace access (CAP_SYS_ADMIN in user ns). Available in many container configs.
LID-004Critical — AppArmor sees nothing, zero BPF hooks (0/9), no audit trace for any BPF token operationMedium — requires bpffs delegation by host + CAP_BPF in user namespace. Available in container runtimes with BPF delegation (LXD/Incus).
LID-005Medium — tc egress classifiers on container interface never evaluate AF_XDP trafficLimited — bypasses tc egress on container eth0 (verified). Cilium NOT bypassed — enforces on node-side veth ingress + source IP verification (tested). Impact limited to plain-Docker setups with tc-only egress filtering.

Reproducibility Matrix

Each finding has specific kernel/config/privilege requirements. If your environment doesn't match, the finding will not reproduce.

LID-001: eBPF Pathname Rewriting

ConditionRequiredNotes
Kernel version5.x+Tested on 5.15, 6.1, 6.6, 6.8
CONFIG_BPF_SYSCALL=yDefault on all major distros
CONFIG_BPF_KPROBE_OVERRIDE=yUbuntu/Debian enable it, RHEL does not
CONFIG_SECURITY_APPARMOR=yTarget LSM must be AppArmor
AppArmor profileEnforcing, deny rule on target pathWorks with any path-based deny rule
Privilegesroot or CAP_BPF + CAP_PERFMONCannot run unprivileged
kernel.lockdownnone or integrityconfidentiality mode blocks kprobe attach
kernel.unprivileged_bpf_disabledIrrelevantRequires CAP_BPF regardless
fs.protected_hardlinks0 for cross-user links1 (default) still allows same-user hard links
SELinux instead of AppArmorDoes not workSELinux is inode-based, not pathname-based

LID-002: io_uring MSG_RING

ConditionRequiredNotes
Kernel version6.0+IORING_MSG_SEND_FD added in 6.0
CONFIG_IO_URING=yDefault on all major distros
PrivilegesNoneWorks from unprivileged userspace
io_uring_disabled sysctl0 (default)2 blocks unprivileged, 1 blocks all
Target LSMAny (SELinux, AppArmor, Smack)security_file_receive() is a generic LSM hook
kernel.lockdownIrrelevantNo BPF involved

LID-004: BPF Token AppArmor Blindness

ConditionRequiredNotes
Kernel version6.9+BPF token introduced in 6.9
CONFIG_BPF_SYSCALL=yDefault on all major distros
CONFIG_SECURITY_APPARMOR=yUbuntu/Debian default
bpffs with delegationYesHost must mount with delegate_* options
PrivilegesCAP_BPF in user namespaceTrivially available to userns root
SELinux instead of AppArmorNot affectedSELinux implements all 9 BPF hooks

LID-003: New Mount API

ConditionRequiredNotes
Kernel version5.2+fsopen/fsmount introduced in 5.2
CONFIG_SECURITY_APPARMOR=yOnly AppArmor is affected
PrivilegesCAP_SYS_ADMIN in user namespaceAvailable with unshare -m
SELinux instead of AppArmorDoes not workSELinux implements security_sb_kern_mount()
Container runtimeDepends on seccomp filterDocker default seccomp blocks fsopen — Podman/LXC may not

LID-005: AF_XDP tc Egress Bypass

ConditionRequiredNotes
Kernel version4.18+AF_XDP introduced in 4.18
CONFIG_XDP_SOCKETS=yDefault on all major distros
PrivilegesCAP_NET_RAW onlyDefault in Docker, Kubernetes pods
Container runtimeDocker, K8s, LXCDefault capability set
tc-based network policyYesCilium eBPF, Calico, tc u32/flower

Quick Reference: What Blocks Each Finding

EnvironmentLID-001LID-002LID-003LID-004LID-005
Ubuntu 22.04+ (AppArmor, default)WorksWorksWorksWorks (6.9+)Works
Debian 12+ (AppArmor)WorksWorksWorksWorks (6.9+)Works
RHEL/Fedora (SELinux)NoWorksNoNoWorks
lockdown=confidentialityNoWorksWorksPartiallyWorks
Unprivileged userNoWorksDepends on user nsDepends on bpffs delegationNo
Container (no CAP_BPF)NoDepends on io_uringDepends on seccompNoWorks
Container (CAP_NET_RAW dropped)NoDependsDependsNoNo

Findings

Download Tool