def systeminfo(request): from spidertool import sniffertask, zmaptool, portscantask, Sqldatatask from spidertool.template_identify.fluzzdetect import fuzztask from spidertool.template_identify.poc_file import pocsearchtask resultdata = {} resultdata['nmapfont'] = taskcontrol.getObject().get_length() resultdata['nmapfont_running'] = taskcontrol.getObject( ).get_current_task_num() resultdata['nmapback'] = sniffertask.getObject().get_length() resultdata['nmapback_running'] = sniffertask.getObject( ).get_current_task_num() resultdata['portacsn'] = portscantask.getObject().get_length() resultdata['portacsn_running'] = portscantask.getObject( ).get_current_task_num() resultdata['fuzz'] = fuzztask.getObject().get_length() resultdata['fuzz_running'] = fuzztask.getObject().get_current_task_num() resultdata['pocdect'] = pocsearchtask.getObject().get_length() resultdata['pocdect_running'] = pocsearchtask.getObject( ).get_current_task_num() resultdata['sqltask'] = Sqldatatask.getObject().get_length() resultdata['sqltask_running'] = Sqldatatask.getObject( ).get_current_task_num() return HttpResponse(json.dumps(resultdata, skipkeys=True, default=webtool.object2dict), content_type="application/json")
def systeminfo(request): from spidertool import sniffertask, zmaptool, portscantask, Sqldatatask from spidertool.detection.fluzzdetect import fuzztask # from spidertool.detection.vuldect import pocsearchtask resultdata = {} # TaskTool中定义的对象信息 resultdata['nmapfont'] = taskcontrol.getObject().get_length( ) # threadtool.getqueue_size() resultdata['nmapfont_running'] = taskcontrol.getObject( ).get_current_task_num() #get_running_size() resultdata['nmapback'] = sniffertask.getObject().get_length() # resultdata['nmapback_running'] = sniffertask.getObject( ).get_current_task_num() resultdata['portacsn'] = portscantask.getObject().get_length() resultdata['portacsn_running'] = portscantask.getObject( ).get_current_task_num() resultdata['fuzz'] = fuzztask.getObject().get_length() resultdata['fuzz_running'] = fuzztask.getObject().get_current_task_num() # resultdata['pocdect'] = pocsearchtask.getObject().get_length() # resultdata['pocdect_running']=pocsearchtask.getObject().get_current_task_num() resultdata['sqltask'] = Sqldatatask.getObject().get_length() resultdata['sqltask_running'] = Sqldatatask.getObject( ).get_current_task_num() return HttpResponse(json.dumps(resultdata, skipkeys=True, default=webtool.object2dict), content_type="application/json")
def updatejob(request,state=''): if request.method=='POST': islogin = request.COOKIES.get('islogin',False) jobid= request.POST.get('taskid','') username = request.COOKIES.get('username','') role = request.COOKIES.get('role','1') response_data = {} response_data['result'] = '0' if role=='1': tempresult=jobcontrol.jobupdate(jobstatus=state,username=username,taskid=jobid) # print 'this is user' else: tempresult=jobcontrol.jobupdate(jobstatus=state,taskid=jobid) if tempresult==True: if state=='2': jobs,count,pagecount=jobcontrol.jobshow(taskid=jobid) if count>0: tasktotally=taskcontrol.getObject() if jobs[0].getForcesearch==1: tasktotally.add_work(jobs) else: tasktotally.add_work(jobs) response_data['result'] = '1' return response_data
def systeminfo(request): from spidertool import sniffertask, zmaptool,portscantask from spidertool.template_identify.fluzzdetect import fuzztask from spidertool.template_identify.poc_file import pocsearchtask resultdata={} resultdata['nmapfont']=taskcontrol.getObject().get_length() resultdata['nmapfont_running'] = taskcontrol.getObject().get_current_task_num() resultdata['nmapback']=sniffertask.getObject().get_length() resultdata['nmapback_running'] = sniffertask.getObject().get_current_task_num() resultdata['portacsn']=portscantask.getObject().get_length() resultdata['portacsn_running'] = portscantask.getObject().get_current_task_num() resultdata['fuzz']=fuzztask.getObject().get_length() resultdata['fuzz_running'] = fuzztask.getObject().get_current_task_num() resultdata['pocdect'] = pocsearchtask.getObject().get_length() resultdata['pocdect_running']=pocsearchtask.getObject().get_current_task_num() return HttpResponse(json.dumps(resultdata,skipkeys=True,default=webtool.object2dict), content_type="application/json")
def getwork(request): data={} taskinstance=taskcontrol.getObject() tempwork=taskinstance.get_work() if len(tempwork)>0: data['result']='1' data['jobs']=tempwork else: data['result']='0' return HttpResponse(json.dumps(data,skipkeys=True,default=webtool.object2dict), content_type="application/json")
def updatejob(request, state=''): print( "==========================================================================\n======================job state:%s request.method:%s======================\n==========================================================================\n" % (state, request.method)) if request.method == 'POST': #POST islogin = request.COOKIES.get('islogin', False) jobid = request.POST.get('taskid', '') # jobid = request.POST.get('taskid','1410a6d6-90ac-11e8-af6f-74e50ba386da') username = request.COOKIES.get('username', '') role = request.COOKIES.get('role', '1') response_data = {} response_data['result'] = '0' ctx = {} ctx['islogin'] = islogin ctx['jobid'] = jobid ctx['username'] = username ctx['role'] = role ctx['state'] = state # return render(request, 'nmaptoolview/post.html', ctx) if role == '1': # normal user tempresult = jobcontrol.jobupdate(jobstatus=state, username=username, taskid=jobid) else: tempresult = jobcontrol.jobupdate(jobstatus=state, taskid=jobid) if tempresult == True: if state == '2': jobs, count, pagecount = jobcontrol.jobshow(taskid=jobid) if count > 0: tasktotally = taskcontrol.getObject( ) # return nmaptask(sniffertask.snifferTask(1)) if jobs[0].getForcesearch == 1: tasktotally.add_work(jobs) else: tasktotally.add_work(jobs) response_data['result'] = '1' return response_data