dissect.target.plugins.os.unix.cronjobs

Module Contents

Classes

CronjobPlugin

Unix cronjob plugin.

Attributes

dissect.target.plugins.os.unix.cronjobs.CronjobRecord
dissect.target.plugins.os.unix.cronjobs.EnvironmentVariableRecord
dissect.target.plugins.os.unix.cronjobs.RE_CRONJOB
dissect.target.plugins.os.unix.cronjobs.RE_ENVVAR
class dissect.target.plugins.os.unix.cronjobs.CronjobPlugin(target)

Bases: dissect.target.plugin.Plugin

Unix cronjob plugin.

CRONTAB_DIRS = ['/var/cron/tabs', '/var/spool/cron', '/var/spool/cron/crontabs', '/etc/cron.d', '/usr/local/etc/cron.d']
CRONTAB_FILES = ['/etc/crontab', '/etc/anacrontab']
crontabs
check_compatible() None

Perform a compatibility check with the target.

This function should return None if the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

find_crontabs() Iterator[pathlib.Path]
cronjobs() Iterator[CronjobRecord | EnvironmentVariableRecord]

Yield cronjobs, and their configured environment variables on a Unix system

A cronjob is a scheduled task/command on a Unix based system. Adversaries may use cronjobs to gain persistence on the system.

Resources: