diff --git a/core/plugins/apache.py b/core/plugins/apache.py index de0383a..b265893 100644 --- a/core/plugins/apache.py +++ b/core/plugins/apache.py @@ -222,16 +222,8 @@ class Apache: for d in directories: for entry in d: # We get the directory path - grDirectory = re.search( - f"", "") - path = path.replace("\"", "") - report["directories"][path] = dict() + path = self._getDirectoryPath(entry) + report["directories"][path] = dict() # Try to find the Option flag grFlag = re.search( @@ -248,7 +240,6 @@ class Apache: ) if grOption: optsFound.append(opt) - #print(d[0]) report["audit"] = True report["options"] = dict() @@ -266,6 +257,22 @@ class Apache: print(report) return report + def _getDirectoryPath(self, line) -> str: + """ + This function return the directory path + """ + path = None + grDirectory = re.search( + f"", "") + path = path.replace("\"", "") + return path + def _constructReports(self): """ Construct dictionary for result of the tests