performing-privilege-escalation-on-linux
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 w
What this skill does
# 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 in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.