返回 Skill 列表
extension
分类: 开发与工程无需 API Key

detecting-privilege-escalation

检测提权漏洞,包括setuid/setgid滥用、权限检查绕过和不安全的权限管理。在分析setuid二进制文件、权限检查或调查提权路径时使用。

person作者: jakexiaohubgithub

Privilege Escalation Detection

Detection Workflow

  1. Identify privileged operations: Find setuid/setgid binaries, locate privilege checks, identify file operations with elevated privileges, map privilege boundaries
  2. Analyze permission model: Understand intended permission model, identify all privilege boundaries, map privilege escalation paths, assess access control mechanisms
  3. Check validation: Verify permission checks are correct, look for race conditions, assess validation completeness, identify TOCTOU issues
  4. Assess exploitability: Can attacker bypass checks? Is there a usable escalation path? What's the impact of successful escalation?

Key Patterns

  • Setuid/setgid binaries: binaries with setuid/setgid bits set, unsafe operations in privileged binaries, environment variable usage, path traversal vulnerabilities
  • Insecure permission checks: race conditions in permission checks, missing privilege validation, TOCTOU in file operations, weak access control implementations
  • Environment-based escalation: environment variable manipulation, LD_PRELOAD/DT_RPATH abuse, PATH manipulation, IFS exploitation
  • Resource manipulation: symlink attacks, hard link manipulation, file descriptor manipulation, /proc filesystem abuse

Output Format

Report with: id, type, subtype, severity, confidence, location, binary_info (path, setuid, setgid, owner), vulnerability, attack_path, exploitable, impact, mitigation.

Severity Guidelines

  • CRITICAL: Direct path to root/admin access
  • HIGH: Escalation to lower privileged user
  • MEDIUM: Limited privilege escalation
  • LOW: Information disclosure about privileges

See Also

  • patterns.md - Detailed detection patterns and exploitation scenarios
  • examples.md - Example analysis cases and code samples
  • references.md - CWE references and mitigation strategies