πShared Libraries
π― Overview
π Prerequisites
Check for LD_PRELOAD in Sudo
# Check sudo configuration
sudo -l
# Look for env_keep+=LD_PRELOAD in output:
# env_keep+=LD_PRELOAD
# Example vulnerable entry:
# (root) NOPASSWD: /usr/sbin/apache2 restartLibrary Dependencies Analysis
# View shared library dependencies
ldd /bin/ls
ldd /usr/sbin/apache2
# Check LD_PRELOAD current value
echo $LD_PRELOADπ LD_PRELOAD Exploitation
Create Malicious Library
Compile Shared Library
Execute Privilege Escalation
π§ Alternative Payloads
Reverse Shell Library
SUID Binary Creation
π Detection & Enumeration
LD_PRELOAD Vulnerability Check
Environment Variable Analysis
π Quick Reference
Immediate Checks
Emergency Exploitation
HTB Academy Example
β οΈ Exploitation Requirements
Must Have
Common Scenarios
Last updated