技能 linux-privilege-escalation
🔐

linux-privilege-escalation

严重 ⚡ 包含脚本⚙️ 外部命令🌐 网络访问📁 文件系统访问

执行Linux权限提升评估

安全专业人员需要在授权的渗透测试期间使用系统化方法识别Linux系统上的权限提升向量。此技能提供全面的枚举和利用工作流程,涵盖内核漏洞、sudo错误配置、SUID二进制文件和定时任务弱点。

支持: Claude Codex Code(CC)
⚠️ 55
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“linux-privilege-escalation”。 用户运行sudo -l发现可以以root身份执行/usr/bin/find

预期结果:

GTFOBins利用:运行'sudo find . -exec /bin/bash \; -quit'来生成root shell。find命令的-exec标志允许使用root权限执行任意命令。

正在使用“linux-privilege-escalation”。 发现位于/usr/bin/base64的SUID base64二进制文件

预期结果:

利用:使用'base64 /etc/shadow | base64 -d > shadow.txt'来提取密码哈希值。将shadow.txt传输到攻击者机器并使用'john --wordlist=rockyou.txt shadow.txt'破解以恢复明文密码。

正在使用“linux-privilege-escalation”。 Root定时任务执行/opt/scripts/backup.sh中的可写脚本

预期结果:

劫持:将'cp /bin/bash /tmp/bash; chmod +s /tmp/bash'追加到脚本中。定时任务执行后,运行'/tmp/bash -p'通过SUID后门获得持久的root访问权限。

安全审计

严重
v1 • 2/25/2026

This skill contains complete weaponized exploitation workflows for Linux privilege escalation. While framed as educational content for penetration testing, it provides ready-to-use commands for gaining unauthorized root access, credential theft via /etc/shadow access, SUID backdoor creation, kernel exploitation, and persistent reverse shell payloads. The static scanner correctly identified 44 high-risk patterns including sudo exploitation, SUID manipulation, and shadow file access. False positives include Ruby backtick detection (actually bash commands in markdown). This content should only be distributed in controlled professional security contexts with explicit authorization requirements.

1
已扫描文件
510
分析行数
20
发现项
1
审计总数

严重问题 (4)

Credential File Access for Password Theft
Direct access to /etc/shadow and /etc/passwd files for credential harvesting. The skill teaches reading shadow hashes and cracking them with John the Ripper, enabling unauthorized password recovery for any system user.
SUID Backdoor Creation
Instructions for creating persistent SUID root shells that provide permanent backdoor access. The skill teaches copying /bin/bash and setting the SUID bit, allowing any user to gain root access indefinitely.
Kernel Exploitation with Crash Risk
Complete kernel exploit workflow including Dirty COW and Dirty Pipe exploitation. The skill acknowledges failed exploits may crash the system (line 433), indicating dangerous unstable code execution.
Reverse Shell Payload Library
Multiple ready-to-use reverse shell payloads for bash, Python, Netcat, and Perl. These one-liners enable covert remote access and are commonly used in real attacks for persistent unauthorized access.

高风险问题 (6)

Sudo Misconfiguration Exploitation
Comprehensive guide to exploiting sudo permissions via GTFOBins techniques. Teaches escaping to root shell through common binaries like vim, find, awk, and python when available via sudo.
LD_PRELOAD Shared Library Injection
Instructions for creating malicious shared libraries to hijack sudo execution. The provided C code sets uid/gid to 0 and spawns a root shell when loaded via LD_PRELOAD.
UID/GID Manipulation for Root Access
Direct manipulation of process credentials using cap_setuid capability. Python, vim, and perl commands shown that set uid(0) to gain root privileges without password.
Cron Job Hijacking
Techniques for modifying writable cron scripts to execute attacker commands as root. Includes adding reverse shell payloads to backup scripts that run with root privileges.
PATH Hijacking Attack
Instructions for exploiting SUID binaries that call external commands by placing malicious executables in writable PATH directories. Creates fake 'service' command to spawn root shell.
NFS no_root_squash Exploitation
Exploits NFS shares configured with no_root_squash to create SUID binaries on mounted shares. When executed on target, the binary runs as root providing unauthorized access.
中风险问题 (3)
Automated Reconnaissance Script Execution
Pipes curl directly to shell for LinPEAS execution. While common in penetration testing, this pattern downloads and executes unverified code which could be intercepted or modified.
Network Service Enumeration
Extensive network reconnaissance commands including netstat, ss, and ip route enumeration. These could be used to map internal network topology for lateral movement.
User Enumeration via passwd File
Commands to enumerate users with login shells and home directories. While /etc/passwd is world-readable, this information facilitates targeted attacks.
低风险问题 (3)
System Information Gathering
Basic enumeration commands for kernel version, hostname, and architecture. Standard reconnaissance that is necessary for vulnerability matching but low risk in isolation.
Process and Service Enumeration
Commands to list running processes and identify services running as root. Useful for identifying exploitation targets but benign administrative commands.
Capability Enumeration
Uses getcap to enumerate Linux capabilities on binaries. Standard security auditing command that identifies potential escalation vectors.

检测到的模式

Dynamic Code Execution via os.systemShell Command Execution via awkNetwork Callback via /dev/tcpSUID Permission Modification
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
0
安全
87
规范符合性

你能构建什么

授权渗透测试

执行内部网络评估的安全顾问使用此技能系统地识别权限提升路径并展示初始访问的业务影响。

安全审计与合规

系统管理员审计自己的基础设施,以在攻击者利用之前识别并修复错误配置。

安全培训与教育

准备OSCP、GPEN或CRT等认证考试的安全专业人员使用此技能在实验环境中了解常见的Linux权限提升技术。

试试这些提示

基本系统枚举
我拥有对Linux系统的低权限shell访问权限。请帮助我枚举系统以识别潜在的权限提升向量,包括内核版本、sudo权限、SUID二进制文件和运行的服务。
Sudo权限分析
我运行'sudo -l'看到我对特定二进制文件有NOPASSWD访问权限。分析输出并为每个允许的命令提供GTFOBins利用技术。
SUID二进制文件利用
查找此系统上的所有SUID二进制文件,并识别哪些可以被利用进行权限提升。为每个易受攻击的二进制文件提供具体的利用命令。
内核漏洞利用代码选择
内核版本是[VERSION]。搜索适用于此内核的已知漏洞利用代码,并提供编译和执行说明。如果主要漏洞利用代码失败,请包括备用选项。

最佳实践

  • 始终在测试前获得书面授权并验证范围边界
  • 在生产环境使用内核漏洞利用代码之前先在实验室环境中测试,以避免系统崩溃
  • 记录评估期间所做的所有更改,以便进行修复和清理

避免

  • 在不了解其机制或失败模式的情况下运行内核漏洞利用代码
  • 在授权评估期之外创建持久后门
  • 访问或窃取超出证明权限提升所需的数据

常见问题

此技能是否合法可用?
仅在您拥有或已获得明确书面授权测试的系统上使用此技能。未经授权的权限提升在大多数司法管辖区都是非法的。始终在定义的范围内操作。
内核漏洞利用代码是否适用于所有Linux系统?
不能。现代内核包括ASLR、SMEP和SMAP等缓解措施,可以阻止许多漏洞利用代码。容器环境也会限制内核级攻击。始终验证内核版本并先测试漏洞利用代码。
如果漏洞利用代码导致系统崩溃该怎么办?
这就是在实验室环境中测试至关重要的原因。如果在授权测试期间发生崩溃,请记录事件,必要时从备份恢复,并立即向系统所有者报告。
我如何知道SUID二进制文件是否可被利用?
检查GTFOBins(gtfobins.github.io)以获取特定二进制文件。许多常见的二进制文件如find、vim、python和base64在以SUID运行时都有已知的利用技术。
此技能是否可用于AWS或Azure等云环境?
云实例有额外的限制。内核漏洞利用代码通常在容器中失败。应专注于sudo权限、功能和IAM角色滥用等错误配置。
此技能与LinPEAS等工具有什么区别?
LinPEAS自动执行枚举,但不提供利用指导。此技能涵盖枚举并为已识别的漏洞提供具体的利用命令。

开发者详情

文件结构

📄 SKILL.md