Ejemplo n.º 1
0
 def init(self):
     '''更新任务类型'''
     MT = models.TaskType
     for name, f in self.tasklist.items():
         try:
             R = MT.get(MT.task_name == f['name'])
         except MT.DoesNotExist:
             R = MT(task_name=f['name'])
         R.task_desc = f['doc']
         R.task_type = f['type']
         R.save()
     '''更新插件'''
     PluginsManage.load('./payloads')
     MP = models.TaskPlugins
     MV = models.Vulnerable
     for plug in BaseHostPlugin.payloads() + BaseWebPlugin.payloads():
         if plug.bugname == ('', ):
             continue
         RV, cd = MV.get_or_create(vul_name=plug.bugname)
         if cd:
             RV.vul_rank = plug.bugrank
             RV.vul_desc = plug.bugdesc
             RV.vul_plan = plug.bugplan
             RV.vul_number = plug.bugnumber
             RV.save()
         R, cd = MP.get_or_create(plug_name=plug.__class__.__name__)
         if cd:
             R.updatedate = datetime.datetime.now()
         R.vulid = RV
         R.plug_desc = plug.bugname
         R.plug_type = plug.__class__.__base__
         R.plug_file = plug.__class__
         R.save()
Ejemplo n.º 2
0
 def __init__(self,taskid):
     PluginsManage.load('./payloads')
     M = models.ScanTask
     self.Q = M.get(M.task_id==taskid)
     self.T = app.AsyncResult(taskid)
     self.settings = {}
     self.target = None
     self.args = json.loads(self.Q.task_args)
     self.target = str(self.Q.task_host).strip()
     '''
Ejemplo n.º 3
0
 def __init__(self, taskid):
     PluginsManage.load('./payloads')
     M = models.ScanTask
     self.Q = M.get(M.task_id == taskid)
     self.T = app.AsyncResult(taskid)
     self.settings = {}
     self.target = None
     self.args = {}
     av = {}
     for d in str(self.Q.task_args).strip().split():
         if d is None or d == 'None':
             continue
         d = d[1:].split('=')
         av[d[0]] = d[1]
     self.args = av
     self.target = str(self.Q.task_host).strip()
     '''