コード例 #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 main(self):
     for rule in ruleDatas:
         cms = rule[0]
         rulesRegex = rule[2]
         if 'headers' == rule[1]:
             self.heads(rulesRegex, cms)
         elif 'cookie' == rule[1]:
             self.cookieInfo(rulesRegex, cms)
         else:
             self.bodys(rulesRegex, cms)
     webTitle = ""
     webServer = ""
     webCms = "None"
     for key in 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"
         OutInfos[key] = webCms, webServer, WebInfos[key][2], webTitle
         logger.success("{} {} {} {}".format(mkPut.green(webServer), mkPut.yellow(
             WebInfos[key][2]), key, mkPut.blue(webTitle)))
コード例 #3
0
ファイル: rulesCli.py プロジェクト: sesyi/Glass
 def main(self):
     for rule in ruleDatas:
         cms = rule[0]
         rulesRegex = rule[2]
         if 'headers' == rule[1]:
             self.heads(rulesRegex, cms)
         elif 'cookie' == rule[1]:
             self.cookieInfo(rulesRegex, cms)
         else:
             self.bodys(rulesRegex, cms)
     webTitle = ""
     webServer = ""
     for key in 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"
         print(
             mkPut.fuchsia("[{0}]".format(
                 time.strftime("%H:%M:%S", time.localtime()))),
             mkPut.green(webServer), mkPut.yellow(WebInfos[key][2]), key,
             mkPut.blue(webTitle))
         OutInfos[key] = webServer, WebInfos[key][2], webTitle
コード例 #4
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)