performing-privilege-escalation-assessment
它能做什么
这个工具帮助你在已获得有限访问权限的计算机上,找到获取更多控制权的途径。它会查找错误配置或存在漏洞的程序,以获取管理员权限。
适用场景
- ✓在安全测试中获得初始访问权限之后。
- ✓检查服务器是否具备良好的入侵防护时。
- ✓测试安全程序能否检测到入侵尝试时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-privilege-escalation-assessment/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“检查我能否在这台服务器上获得管理员权限。”
每周 5 个新技能,1 分钟读完。
工作原理
该工具会检查系统中的错误设置、过时的程序或保存的密码,然后尝试利用这些发现来获得系统的完全访问权限。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Performing Privilege Escalation Assessment
When to Use
- After gaining initial low-privilege access during a penetration test to demonstrate full system compromise
- Assessing the security hardening of Linux and Windows servers against local privilege escalation attacks
- Evaluating whether endpoint detection and response (EDR) tools detect common privilege escalation techniques
- Testing the effectiveness of least-privilege policies and application whitelisting on endpoints
- Validating that container breakout and VM escape controls are properly configured
Do not use without written authorization, against production systems where exploitation could cause downtime, or for deploying kernel exploits on systems without prior approval and rollback capability.
Prerequisites
- Low-privilege shell access (reverse shell, SSH, RDP) to the target system obtained through authorized means
- Privilege escalation enumeration scripts: linPEAS (Linux), winPEAS (Windows), Linux Smart Enumeration (LSE)
- Compiled kernel exploits for common CVEs or access to compilation tools on the target
- GTFOBins reference for Linux SUID/sudo binary abuse and LOLBAS reference for Windows living-off-the-land binaries
- Precompiled post-exploitation binaries for the target architecture if compilation is not available on the target
Workflow
Step 1: System Enumeration
Gather comprehensive information about the target system:
Linux Enumeration:
id && whoami- Current user and group membershipsuname -a- Kernel version for kernel exploit identificationcat /etc/os-release- Distribution and versionsudo -l- Commands the current user can run as root via sudofind / -perm -4000 -type f 2>/dev/null- SUID binariesfind / -perm -2000 -type f 2>/dev/null- SGID binariescrontab -l && ls -la /etc/cron*- Scheduled tasks running as rootps aux | grep root- Processes running as rootcat /etc/passwd- User accounts (look for additional users with UID 0)find / -writable -type d 2>/dev/null- World-writable directories- Run
linpeas.shfor automated comprehensive enumeration
Windows Enumeration:
whoami /priv- Current user privileges (look for SeImpersonatePrivilege, SeDebugPrivilege)systeminfo- OS version, hotfix level, architecturewmic service get name,pathname,startmode- Unquoted service pathsicacls "C:\Program Files" /T- Writable directories in Program Filesreg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated- AlwaysInstallElevated checkcmdkey /list- Stored Windows credentialsschtasks /query /fo LIST /v- Scheduled tasks with their run-as accounts- Run
winPEAS.exefor automated comprehensive enumeration
Step 2: Linux Privilege Escalation Vectors
Test identified escalation vectors systematically:
- Sudo misconfigurations: If
sudo -lshows entries like(ALL) NOPASSWD: /usr/bin/vim, use GTFOBins to escalate:sudo vim -c ':!/bin/bash'to spawn a root shell- Common dangerous sudo entries: vim, less, find, nmap, python, perl, ruby, awk, env
- SUID binary abuse: If a SUID binary is identified that allows arbitrary command execution, shell escape, or file read:
- Custom SUID: Check if a custom SUID binary calls other programs without absolute paths (PATH injection)
- Known SUID: Check GTFOBins for exploitation of standard SUID binaries
- Cron job exploitation: If a cron job runs a script writable by the current user, or runs a script from a writable directory:
- Modify the script to add a reverse shell or SUID copy of bash
- PATH-based cron exploitation: if the cron job calls a command without absolute path and PATH is writable
- Kernel exploits: Match the kernel version to known exploits:
- DirtyPipe (CVE-2022-0847): Linux kernel 5.8-5.16.11
- DirtyCow (CVE-2016-5195): Linux kernel 2.6.22-4.8.3
- PwnKit (CVE-2021-4034): Polkit pkexec vulnerability affecting most Linux distributions
- Capabilities abuse:
getcap -r / 2>/dev/nullto find binaries with elevated capabilities (cap_setuid, cap_dac_override) - Writable /etc/passwd: If /etc/passwd is writable, add a new root user:
echo 'newroot:$1$hash:0:0::/root:/bin/bash' >> /etc/passwd
Step 3: Windows Privilege Escalation Vectors
Test Windows-specific escalation paths:
- Token impersonation: If the user has
SeImpersonatePrivilege(common for service accounts and IIS):
…
常见问题
使用此工具需要获得许可吗?
需要。使用前你必须获得书面授权,尤其是在重要系统上。
什么是“权限提升”?
这是指在系统中获得更高权限的过程,比如从普通用户变为管理员。
这个工具支持哪些系统?
它同时支持 Linux 和 Windows 系统。
详情
作者的原始描述
Performs privilege escalation assessments on compromised Linux and Windows systems to identify paths from low-privilege access to root or SYSTEM-level control. The tester enumerates misconfigurations, vulnerable services, kernel exploits, SUID binaries, unquoted service paths, and credential stores to demonstrate the full impact of an initial compromise. Activates for requests involving privilege
热度
- GitHub 星标
- 35k
- 排名
- #8288
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。