Exemplo n.º 1
0
	def scan(self):

		#commands
		commands = []

		#dbg msg
		utils.logMessage(utils.MODE_INFO, 'running scan')

		#init results dictionary
		results = self.initResults(LAUNCHD_CONF_NAME, LAUNCHD_CONF_DESCRIPTION)

		#get all commands in launchd.conf
		# ->note, commands in functions will be ignored...
		commands = utils.parseBashFile(LAUNCHD_CONF_FILE)

		#iterate over all commands
		# ->instantiate command obj and save into results
		for extractedCommand in commands:

			#TODO: could prolly do some more advanced processing (e.g. look for bsexec, etc)

			#instantiate and save
			results['items'].append(command.Command(extractedCommand))

		return results
Exemplo n.º 2
0
	def scan(self):

		#commands
		commands = []

		#dbg msg
		utils.logMessage(utils.MODE_INFO, 'running scan')

		#init results dictionary
		results = self.initResults(RC_SCRIPT_NAME, RC_SCRIPT_DESCRIPTION)

		#scan/parse all rc files
		for rcScript in RC_SCRIPTS:

			#get all commands in script file
			# ->note, commands in functions will be ignored...
			#   of course, if the function is invoked, this invocation will be displayed
			commands = utils.parseBashFile(os.path.join('/etc', rcScript))

			#iterate over all commands
			# ->instantiate command obj and save into results
			for extractedCommand in commands:

				#instantiate and save
				results['items'].append(command.Command(extractedCommand, rcScript))

		return results
Exemplo n.º 3
0
	def scan(self):

		#commands
		commands = []

		#dbg msg
		utils.logMessage(utils.MODE_INFO, 'running scan')

		#init results dictionary
		results = self.initResults(RC_COMMON_NAME, RC_COMMON_DESCRIPTION)

		#get all commands in rc.common
		# ->note, commands in functions will be ignored...
		#   of course, if the function is invoked, this invocation will be displayed
		commands = utils.parseBashFile(RC_COMMON_FILE)

		#iterate over all commands
		# ->instantiate command obj and save into results
		for extractedCommand in commands:

			#instantiate and save
			results['items'].append(command.Command(extractedCommand))

		return results