πLogrotate Exploitation
π― Overview
π Prerequisites
Required Conditions
# 1. Write permissions on log files
ls -la /var/log/ | grep $(whoami)
# 2. Vulnerable logrotate version
logrotate --version
# Vulnerable: 3.8.6, 3.11.0, 3.15.0, 3.18.0
# 3. Logrotate runs as root (via cron)
ps aux | grep logrotate
cat /etc/cron.daily/logrotateConfiguration Analysis
# Check logrotate configuration
cat /etc/logrotate.conf
# Important settings
grep "create\|compress" /etc/logrotate.conf | grep -v "#"
# Check specific log configurations
ls /etc/logrotate.d/
cat /etc/logrotate.d/*π Exploitation with Logrotten
Download and Compile Exploit
Create Payload
Execute Exploit
HTB Academy Lab Example
π§ Configuration Mode Detection
Determine Logrotate Mode
Mode-Specific Exploitation
π Timing and Execution
Cron Schedule Analysis
Manual Triggering (if possible)
π Detection & Enumeration
Logrotate Vulnerability Check
Log File Analysis
π Quick Reference
Immediate Checks
Emergency Exploitation
β οΈ Exploit Limitations
Requirements Summary
Success Factors
Last updated