示例#1
0
文件: rulesCli.py 项目: sesyi/Glass
 def heads(self, rulesRegex, cms):
     webTitle = ""
     webServer = ""
     for key in list(WebInfos):
         if 'server' in WebInfos[key][0]:
             webServer = WebInfos[key][0]['server']
         else:
             webServer = "None"
         webTitles = re.findall(self.rex, WebInfos[key][1])
         if webTitles:
             webTitle = webTitles[0]
         else:
             webTitle = "None"
         for head in WebInfos[key][0]:
             resHeads = re.findall(rulesRegex, WebInfos[key][0][head])
             if resHeads:
                 print(
                     mkPut.fuchsia("[{0}]".format(
                         time.strftime("%H:%M:%S", time.localtime()))),
                     mkPut.red(cms), mkPut.green(webServer),
                     mkPut.yellow(WebInfos[key][2]), key,
                     mkPut.blue(webTitle))
                 OutInfos[key] = cms, webServer, WebInfos[key][2], webTitle
                 WebInfos.pop(key)
                 break
示例#2
0
 def bodys(self, rulesRegex, cms):
     webTitle = ""
     webServer = ""
     for key in list(WebInfos):
         if 'server' in WebInfos[key][0]:
             webServer = WebInfos[key][0]['server']
         else:
             webServer = "None"
         webTitles = re.findall(self.rex, WebInfos[key][1])
         if webTitles:
             webTitle = webTitles[0]
         else:
             webTitle = "None"
         resCodes = re.findall(rulesRegex, WebInfos[key][1])
         if resCodes:
             logger.success("{} {} {} {} {}".format(mkPut.red(cms), mkPut.green(
                 webServer), mkPut.yellow(WebInfos[key][2]), key, mkPut.blue(webTitle)))
             OutInfos[key] = cms, webServer, WebInfos[key][2], webTitle
             WebInfos.pop(key)