
Prueba de concepto en Python para CVE-2026-31431, que explota el kernel AF_ALG para modificar la caché de páginas de binarios SUID y obtener una shell root en sistemas Linux.
Python PoC for CVE-2026-31431, intended for controlled laboratory testing on authorized Linux systems.
For use only in your own environments, labs, or systems where you have explicit permission. Do not run this code against third-party systems.
copy-fail.py checks whether algif_aead is available through the kernel AF_ALG interface and, if the system is compatible with the technique tested by this PoC, attempts to modify the page cache of a target SUID binary to launch an interactive PTY shell.
The script includes payloads for:
x86_64i686aarch64
AF_ALG and algif_aead./usr/bin/su.No external Python dependencies are required; the script only uses standard library modules.
Show help:
python3 copy-fail.py --help
Run with the default target (/usr/bin/su):
python3 copy-fail.py
Use another SUID binary as the target:
python3 copy-fail.py --target /usr/bin/newgrp
Run a specific command as root:
python3 copy-fail.py --exec /bin/bash
Disable automatic terminal setup:
python3 copy-fail.py --no-setup
Show the project version:
python3 copy-fail.py --version
Before running the main flow, the script attempts to create and bind an AF_ALG socket with:
authencesn(hmac(sha256),cbc(aes))
If algif_aead is not available, the program exits without continuing.
The test suite only covers inert CLI paths such as --help and --version. It does not execute the PoC flow.
python3 -m unittest discover -s tests
copy-fail.py: complete PoC implementation and CLI.tests/test_cli.py: safe CLI smoke tests.SECURITY.md: security policy and reporting scope.DISCLAIMER.md: authorized-use disclaimer.CHANGELOG.md: release history.CONTRIBUTING.md: contribution guidelines.LICENSE: MIT license.MIT License — Copyright (c) 2026 Juguitos
PoC en Python para CVE-2026-31431, orientado a pruebas controladas de laboratorio en sistemas Linux autorizados.
Uso exclusivo en entornos propios, de laboratorio o con permiso explícito. No ejecutes este código contra sistemas de terceros.
copy-fail.py verifica la disponibilidad de algif_aead mediante la interfaz AF_ALG del kernel y, si el sistema es compatible con la técnica probada por el PoC, intenta modificar la page cache de un binario SUID objetivo para lanzar una shell con PTY interactiva.
El script incluye payloads para:
x86_64i686aarch64
AF_ALG y algif_aead./usr/bin/su.No requiere dependencias externas de Python; usa módulos de la biblioteca estándar.
Mostrar ayuda:
python3 copy-fail.py --help
Ejecutar con el objetivo por defecto (/usr/bin/su):
python3 copy-fail.py
Usar otro binario SUID como objetivo:
python3 copy-fail.py --target /usr/bin/newgrp
Ejecutar un comando específico como root:
python3 copy-fail.py --exec /bin/bash
Deshabilitar la configuración automática de terminal:
python3 copy-fail.py --no-setup
Mostrar la versión del proyecto:
python3 copy-fail.py --version
Antes de ejecutar el flujo principal, el script intenta crear y enlazar un socket AF_ALG con:
authencesn(hmac(sha256),cbc(aes))
Si algif_aead no está disponible, el programa termina sin continuar.
La suite de pruebas solo cubre rutas inertes de CLI como --help y --version. No ejecuta el flujo del PoC.
python3 -m unittest discover -s tests
copy-fail.py: implementación completa del PoC y CLI.tests/test_cli.py: pruebas seguras de la CLI.SECURITY.md: política de seguridad y alcance de reportes.DISCLAIMER.md: aviso de uso autorizado.CHANGELOG.md: historial de cambios.CONTRIBUTING.md: guía de contribución.LICENSE: licencia MIT.Licencia MIT — Copyright (c) 2026 Juguitos
| Option | Description |
|---|
-t, --target PATH | Target SUID binary. Default: /usr/bin/su. |
-e, --exec CMD | Command to run as root. Must be provided as a full path. |
--no-setup | Disables automatic terminal environment setup. |
--version | Shows the project version. |
-h, --help | Shows the program help. |
| Opción | Descripción |
|---|
-t, --target PATH | Binario SUID objetivo. Default: /usr/bin/su. |
-e, --exec CMD | Comando a ejecutar como root. Debe indicarse con ruta completa. |
--no-setup | Deshabilita la configuración automática del entorno de terminal. |
--version | Muestra la versión del proyecto. |
-h, --help | Muestra la ayuda del programa. |