drupal webscan

This commit is contained in:
Roman Hergenreder 2020-09-17 00:28:12 +02:00
parent 41597de94c
commit 9e69b2d063

@ -89,6 +89,7 @@ class WebServicecFinder:
self.analyseHtml(startPage) self.analyseHtml(startPage)
self.analyseRobots() self.analyseRobots()
self.analyseSitemap() self.analyseSitemap()
self.analyseChangelog()
def analyseHeaders(self, res): def analyseHeaders(self, res):
phpFound = False phpFound = False
@ -141,7 +142,8 @@ class WebServicecFinder:
meta_generator = soup.find("meta", {"name":"generator"}) meta_generator = soup.find("meta", {"name":"generator"})
if meta_generator: if meta_generator:
print("[+] Meta Generator:", meta_generator["content"].strip()) banner = meta_generator["content"].strip()
print("[+] Meta Generator:", banner)
footer = soup.find("footer") footer = soup.find("footer")
if footer: if footer:
@ -174,10 +176,28 @@ class WebServicecFinder:
def analyseSitemap(self): def analyseSitemap(self):
res = self.do_get("/sitemap.xml", allow_redirects=False) res = self.do_get("/sitemap.xml", allow_redirects=False)
if res.status_code in (301,302,404,403): if res.status_code != 200:
print("[-] sitemap.xml not found or inaccessible") print("[-] sitemap.xml not found or inaccessible")
return False return False
def analyseChangelog(self):
drupal_pattern = re.compile("^Drupal ([0-9.]+),")
drupal_found = False
changelog_files = ["CHANGELOG", "CHANGELOG.txt"]
for file in changelog_files:
res = self.do_get(file, allow_redirects=False)
if res.status_code != 200:
continue
print("[+] Found:", file)
for line in res.text.split("\n"):
line = line.strip()
if not drupal_found and self.printMatch("Drupal", drupal_pattern.search(line)):
drupal_found = True
def banner(): def banner():
print(""" print("""
,--------. ,--. ,--------. ,--. ,--. ,--. ,--------. ,--. ,--------. ,--. ,--. ,--.