> For the complete documentation index, see [llms.txt](https://shafagh.gitbook.io/try-hack-me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shafagh.gitbook.io/try-hack-me/complete-begginer/privilege-esclation/cron-tab-exploitation.md).

# Cron tab exploitation

## How to view what Cronjobs are active.

We can use the command "cat /etc/crontab" to view what cron jobs are scheduled. This is something you should always check manually whenever you get a chance, especially if LinEnum, or a similar script, doesn't find anything.

then if for example we find a crontab running a writable script as root, we can write to the cron tab to execute commands as root.

e.g. `*/5 * * * * root /home/user4/Desktop/autoscript.sh` runs every five minutes, we can write something like a msfvenom payload to it to give us a root reverse shell.
