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
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)))
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
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)