MCPcopy
hub / github.com/sleventyeleven/linuxprivchecker / enum_cron_jobs

Function enum_cron_jobs

linuxprivchecker.py:146–161  ·  view source on GitHub ↗

Enumerate crontab Information (enum_cron_jobs) Enumerate system and user cron jobs and save the results :return: None TODO: Should also parse at and systemd jobs for possible information as well

()

Source from the content-addressed store, hash-verified

144
145
146def enum_cron_jobs():
147 """
148 Enumerate crontab Information (enum_cron_jobs)
149 Enumerate system and user cron jobs and save the results
150
151 :return: None
152 TODO: Should also parse at and systemd jobs for possible information as well
153 """
154 croninfo = {
155 "CRON": {"cmd": "ls -la /etc/cron* 2>/dev/null", "msg": "Scheduled cron jobs", "results": []},
156 "CRONW": {"cmd": "ls -aRl /etc/cron* 2>/dev/null | awk '$1 ~ /w.$/' 2>/dev/null", "msg": "Writable cron dirs", "results": []},
157 "CRONU": {"cmd": "crontab -l 2>/dev/null", "msg": "Users cron jobs", "results": []}
158 }
159
160 croninfo = execute_cmd(croninfo)
161 print_results(croninfo)
162
163
164def enum_user_info():

Callers 1

Calls 2

execute_cmdFunction · 0.70
print_resultsFunction · 0.70

Tested by

no test coverage detected