Performing Privilege Escalation on Linux
Linux privilege escalation involves elevating from a low-privilege user account to root access on a compromised
MCP get_skill({ skillId: "performing-privilege-escalation-on-linux-20e406a7" })Use this skill with your agent
Create a free account and connect via MCP
# Performing Privilege Escalation on Linux > **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws. ## Overview Linux privilege escalation involves elevating from a low-privilege user account to root access on a compromised system. Red teams exploit misconfigurations, vulnerable services, kernel exploits, and weak permissions to achieve root. This skill covers both manual enumeration techniques and automated tools for identifying and exploiting privilege escalation vectors. ## When to Use - When conducting security assessments that involve performing privilege escalation on linux - When following incident response procedures for related security events - When performing scheduled security testing or auditing activities - When validating security controls through hands-on testing ## Prerequisites - Familiarity with red teaming concepts and tools - Access to a test or lab environment for safe execution - Python 3.8+ with required dependencies installed - Appropriate authorization for any testing activities ## MITRE ATT&CK Mapping - **T1548.001** - Abuse Elevation Control Mechanism: Setuid and Setgid - **T1548.003** - Abuse Elevation Control Mechanism: Sudo and Sudo Caching - **T1068** - Exploitation for Privilege Escalation - **T1574.006** - Hijack Execution Flow: Dynamic Linker Hijacking - **T1053.003** - Scheduled Task/Job: Cron - **T1543.002** - Create or Modify System Process: Systemd Service ## Key Escalation Vectors ### SUID/SGID Binaries - Find SUID binaries: `find / -perm -4000 -type f 2>/dev/null` - Check GTFOBins for exploitation methods - Custom SUID binaries may have vulnerabilities ### Sudo Misconfigurations - `sudo -l` to list allowed commands - Wildcards in sudo rules allow injection - NOPASSWD entries for dangerous commands - sudo versions vulnerable to CVE-2021-3156 (Baron Samedit) ### Kernel Exploits - Dirty Cow (CVE-2016-5195) for older kernels - Dirty Pipe (CVE-2022-0847) for kernel 5.8+ - PwnKit (CVE-2021-4034) for pkexec - GameOver(lay) (CVE-2023-2640, CVE-2023-32629) for Ubuntu ### Cron Job Abuse - World-writable cron scripts - PATH hijacking in cron jobs - Wildcard injection in cron commands ### Capabilities - `getcap -r / 2>/dev/null` to find binaries with capabilities - cap_setuid allows UID manipulation - cap_dac_override bypasses file permissions ### Writable Service Files - Systemd unit files with weak permissions - Init scripts writable by non-root users - Socket files in accessible locations ## Tools and Resources | Tool | Purpose | |------|---------| | LinPEAS | Automated privilege escalation enumeration | | LinEnum | Linux enumeration script | | linux-exploit-suggester | Kernel exploit matching | | pspy | Process monitoring without root | | GTFOBins | SUID/sudo binary exploitation reference | | PEASS-ng | Privilege escalation awesome scripts suite | ## Validation Criteria - [ ] Enumeration performed using automated tools - [ ] Privilege escalation vector identified - [ ] Root access achieved through identified vector - [ ] Evidence documented (screenshots, command output) - [ ] Alternative escalation paths identified
Related Skills
More skills in Security & Compliance
1password
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in, and reading/injecting secrets for commands.
1password
Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
Accessibility Lead
Accessibility team lead and orchestrator. Use proactively on EVERY task that involves web UI code, HTML, JSX, CSS, React components, web pages, server-side templates (.leaf, .ejs, .erb, .hbs), or any user-facing web content. This agent coordinates the accessibility specialist team and ensures no accessibility requirement is missed. Runs the final review before any UI code is considered complete. Applies to any web framework, server-side templating framework (Vapor/Leaf, Rails/ERB, Django/Jinja, Express/EJS), or vanilla HTML/CSS/JS. Works alongside other team leads (e.g., swift-lead) in multi-language projects.
Accessibility Regression Detector
Detects accessibility regressions by comparing audit results across commits/branches. Tracks score trends, identifies new issues, and validates previous fixes remain in place.
Accessibility Statement
Generates conformance/accessibility statements following W3C or EU model templates. Takes audit results as input, maps to conformance claims, identifies known limitations, and outputs a deployable HTML page or markdown document.
Accessibility Tool Builder
Expert in building accessibility scanning tools, rule engines, document parsers, report generators, and audit automation. WCAG criterion mapping, severity scoring, CLI/GUI scanner architecture, CI/CD integration.
Explore Other Categories
Skills from other categories with shared topics
GitHub Review Requests
Fetch unread GitHub notifications for open PRs where review is requested from a specified team or opened by a team member. Use when asked to "find PRs I need to review", "show my review requests", "what needs my review", "fetch GitHub review requests", or "check team review queue".
PDF Processing Guide
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Requesting Code Review
Prepare and request a code review after implementation or before merge by assembling scope, requirements, git range, and reviewer instructions.