diff --git a/audit/system/plugins/apache/apache.py b/audit/system/plugins/apache.py similarity index 100% rename from audit/system/plugins/apache/apache.py rename to audit/system/plugins/apache.py diff --git a/audit/system/plugins/postfix/postfix.py b/audit/system/plugins/postfix.py similarity index 100% rename from audit/system/plugins/postfix/postfix.py rename to audit/system/plugins/postfix.py diff --git a/audit/system/plugins/postfix/__init__.py b/audit/system/plugins/postfix/__init__.py deleted file mode 100644 index e5a0d9b..0000000 --- a/audit/system/plugins/postfix/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env python3 diff --git a/audit/system/plugins/postfix/parsing.py b/audit/system/plugins/postfix/parsing.py deleted file mode 100644 index e6843a2..0000000 --- a/audit/system/plugins/postfix/parsing.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 - -import re -from json import dumps -from parsing.base import ParsingBase - - -class Parsing(ParsingBase): - def __init__(self, objects, arguments): - self._parsing = dict() - self._reports = dict() - self._objects = objects - self._postfix_file = arguments["postfix_file"] - - def runParsing(self): - # Generate report - self._constructReports() - - # Check if the file exist - try: - with open(self._postfix_file, 'rb') as fdata: - self._parseFile(fdata) - except FileNotFoundError: - print("No postfix file found. Add into the report") - pass - - def _parseFile(self, fdata): - data = fdata.read() - lines = data.splitlines() - - obj = self._objects['regexp'].split("=") - directive = obj[0].strip() - value = obj[1].strip() - print(self._objects) - - for line in lines: - line = line.decode('utf-8') - grDirective = re.search(directive, line) - if grDirective: - grValue = re.search(value, line) - if grValue: - print(line) - - def _generateReport(self, objects): - # We can generate the report - for postfix in self._reports['postfix']: - self._reports['postfix'][postfix] = objects[postfix] - - def _parsingFile(self, line, obj, vulnerabilityFound) -> bool: - """ - This function parse the line and try to find the item in it - """ - result = bool() - - return result - - def _constructReports(self): - """ - Construct dictionary for result of the tests - Each entry contains: - Key: - - filename: filename of the test - - line: line of the test - - parse: Display the line where the vulnerabilites has been found - - description: description of the vulnerability - - level: high, medium or low - """ - self._reports['postfix'] = dict() - - def getResults(self) -> dict: - return self._reports diff --git a/core/plugins/apache.py b/core/plugins/apache.py index 82f16f9..dd73133 100644 --- a/core/plugins/apache.py +++ b/core/plugins/apache.py @@ -3,7 +3,7 @@ import re from os import listdir from os.path import isdir -from audit.system.plugins.apache.apache import apache +from audit.system.plugins.apache import apache class Apache: diff --git a/core/plugins/postfix.py b/core/plugins/postfix.py index 236a81f..45d3406 100644 --- a/core/plugins/postfix.py +++ b/core/plugins/postfix.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import re -from audit.system.plugins.postfix.postfix import postfix +from audit.system.plugins.postfix import postfix class Postfix: