Shared Libraries & Interpreter Hijacking
LD_PRELOAD & Shared Library Hijacking
- Find Binaries That Honor LD_PRELOAD (Including SUID)
- Create a Malicious Shared Object
- Preload & Execute the SUID Binary
- If the binary loads
libc
or another library, yourexploit.so
runs as root. - Modify
/etc/ld.so.conf.d
if Writable - Place your
.so
in/home/user/mylibs
and run the vulnerable binary.
Python Module Hijacking
- Locate SUID Python Scripts
- Create malicious python module
- Set PYTHONPATH and Run the Script
- If
vulnerable_suid_script.py
doesimport pickle
(or another module you control), it spawns a root shell.