def _NewHunt(self):
"""Construct and start new GRR hunt.
Returns:
str representing hunt ID.
Raises:
RuntimeError: if no items specified for collection.
"""
file_list = self.file_list.split(',')
if not file_list:
raise RuntimeError('File must be specified for hunts')
syslog.syslog('Hunt to collect {0:d} items'.format(len(self.file_list)))
self.console_out.VerboseOut(
'Files to be collected: {0:s}'.format(self.file_list))
hunt_name = 'FileFinder'
hunt_action = flows_pb2.FileFinderAction(
action_type=flows_pb2.FileFinderAction.DOWNLOAD,)
hunt_args = flows_pb2.FileFinderArgs(
paths=file_list,
action=hunt_action,)
return self._StartHunt(hunt_name, hunt_args)
评论列表
文章目录