예제 #1
0
 def onCVEAction(self, cve, action, **args):
   if   action == "filter":
     try:
       filters = {x.split("=")[0]: x.split("=")[1] for x in args["fields"]['filter'][0].split("&")}
       filters = {x: urllib.parse.unquote(y) for x,y in filters.items()}
       fields  = json.loads(args["fields"]["fields"][0])
       limit = 0
       skip = 0
       cves = self.filter_logic(filters, limit, skip, args["plugin_manager"], **args)
       return {'status': 'plugin_action_complete', 'data': self.generateCSV(cves, fields)}
     except Exception as e:
       traceback.print_exc()
       return False
   elif action == "textsearch":
     try:
       text   = args["fields"]["text"][0]
       fields = json.loads(args["fields"]["fields"][0])
       dbResults = db.getSearchResults(text)
       plugResults = args["plugin_manager"].getSearchResults(text, **args)
       result = mergeSearchResults(dbResults, plugResults)
       cves=result['data']
       fields["reason"] = True
       return {'status': 'plugin_action_complete', 'data': self.generateCSV(cves, fields)}
     except Exception as e:
       traceback.print_exc()
       return False
예제 #2
0
파일: index.py 프로젝트: slox3r/cve-search
def searchText():
    search = request.form.get('search')
    dbResults = db.getSearchResults(search)
    plugResults = plugManager.getSearchResults(search, **pluginArgs())
    result = mergeSearchResults(dbResults, plugResults)
    cve = result['data']
    errors = result['errors'] if 'errors' in result else []
    return render_template('search.html', cve=cve, errors=errors)
예제 #3
0
def searchText():
    search = request.form.get('search')
    dbResults = db.getSearchResults(search)
    plugResults = plugManager.getSearchResults(search)
    result = mergeSearchResults(dbResults, plugResults)
    cve=result['data']
    errors=result['errors'] if 'errors' in result else []
    return render_template('search.html', cve=cve, errors=errors)