Priv Escalation

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

*/3 *   * * *   root    python /var/www/html/booked/cleanup.py

Cron job running as root.


╔══════════╣ Searching passwords in config PHP files
$conf['settings']['database']['password'] = 'password';
$conf['settings']['password']['minimum.letters'] = '6';
$conf['settings']['password']['minimum.numbers'] = '0';
$conf['settings']['password']['upper.and.lower'] = 'false';
$conf['settings']['database']['password'] = 'RoachSmallDudgeon368';
$conf['settings']['password']['minimum.letters'] = '6';
$conf['settings']['password']['minimum.numbers'] = '0';
$conf['settings']['password']['upper.and.lower'] = 'false';

I can edit the cronjob.

www-data@zino:/var/www/html/booked$ echo "lol" >>cleanup.py 
www-data@zino:/var/www/html/booked$ cat cleanup.py 
#!/usr/bin/env python
import os
import sys
try:
        os.system('rm -r /var/www/html/booked/uploads/reservation/* ')
except:
        print 'ERROR...'
sys.exit(0)
lol

Replaced the python file with a python3 reverse shell.

This is the client.py that I transferred, I do this with every python file that I can replace.

This is the server.

Last updated