
Herramientas para obtener offsets y añadir parches para soporte i386
$ cat /proc/sys/kernel/unprivileged_userns_clone
Salida:
1
Si el archivo "/proc/sys/kernel/unprivileged_userns_clone" no existe:
$ unshare -mU /bin/sh -c "sleep 5" & /bin/sh -c "sleep 1; cd /proc/$!/cwd; realpath .; kill -9 $!"
La salida debe contener la cadena "(unreachable)" antes de '/':
[1] 12345
(unreachable)/home/user
Las opciones se pasan mediante variables de entorno:
TRACE_DEBUG=1 - Value for printing debug information (Default: 0)
STACK_SIZE=100 - Size output data of stack (Default: 100)
Cómo ejecutar:
$ make
$ cp /bin/umount .
$ LD_PRELOAD="$(realpath tool.so)" TRACE_DEBUG=1 STACK_SIZE=100 ./umount /root
https://www.halfdog.net/Security/2017/LibcRealpathBufferUnderflow/