Skip to content
Back to skills

Linux File Path Abuse

BSecurity

Linux escalation via file, PATH and library manipulation — PATH hijacking of relative commands run by privileged processes, writable shared libraries / LD_PRELOAD / LD_LIBRARY_PATH abuse, writable /etc/passwd or /etc/shadow or sudoers, world-writable sensitive files, and NFS no_root_squash. Identification, safe PoC, remediation.

  • 16 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 17, 2026
securityrustshellbackend

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill linux-file-path-abuse --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Linux File Path Abuse?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Linux File Path Abuse
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-linux-file-path-abuse/badge)](https://www.skillsdirectory.com/skills/anandjogawade-linux-file-path-abuse)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: linux-file-path-abuse
description: Linux escalation via file, PATH and library manipulation — PATH hijacking of relative commands run by privileged processes, writable shared libraries / LD_PRELOAD / LD_LIBRARY_PATH abuse, writable /etc/passwd or /etc/shadow or sudoers, world-writable sensitive files, and NFS no_root_squash. Identification, safe PoC, remediation.
---

# File / PATH / Library Abuse

When a privileged process trusts a path, library, or file you can write, you control its execution or escalate directly. Prove safely, revert.

## Trigger phrases
`path hijack, ld_preload, ld_library_path, writable /etc/passwd, writable shadow, nfs no_root_squash, library hijack`

## Identify & exploit (safe PoC)
- **PATH hijack:** a root process/SUID calls a command by relative name. Place a benign script named like that command earlier in PATH that writes a root marker; confirm; remove it.
- **LD_PRELOAD / LD_LIBRARY_PATH:** if `sudo` keeps these env vars (`env_keep`) or a SUID binary loads a writable lib, build a tiny benign `.so` whose constructor runs `id`; confirm root context; delete it.
- **Writable `/etc/passwd`:** add a known-password root-UID entry **only in a lab/authorized context** (Tier-2 caution) and prove login, then remove the line; on production prefer proving write access without adding an account.
- **Writable `/etc/sudoers(.d)`:** demonstrate you could grant yourself sudo; prefer showing write access over actually editing on production.
- **NFS `no_root_squash`:** mount the export, place a root-owned SUID benign binary from the attacker side, execute on target to prove; clean up.
- **World-writable sensitive files / backups**: read creds for reuse.

## Safe-PoC discipline
Benign markers / read-proofs on production; destructive proofs (passwd/sudoers edits) only in lab/authorized Tier-2 mode, always reverted and logged.

## Remediation to report
Absolute paths in privileged scripts, remove `env_keep` for LD_*, correct permissions on `/etc/passwd|shadow|sudoers`, `root_squash` on NFS, fix world-writable files.

## Backend / Verification
Target shell. **Background-verify** the escalation reproduces (marker owned by root / `id` shows root) before CONFIRMED.

## Evidence
The writable path/lib/file, the benign proof, remediation. Revert everything.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.