From df102c12b53ffec9525f456930ce06331e690a26 Mon Sep 17 00:00:00 2001 From: Cutieguwu Date: Sun, 30 Jul 2023 14:56:02 -0400 Subject: [PATCH] Update Detectowor.py Added debugging. --- Detectowor.py | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/Detectowor.py b/Detectowor.py index aa0ffab..049accd 100644 --- a/Detectowor.py +++ b/Detectowor.py @@ -1,11 +1,29 @@ from sys import exit -from os import name as osname -from os import path +from os import name as osname, path + +__DEBUG_RUN = True +__DEBUG_LIBRARY = False +__DEBUG_SCAN = False + + +class __DEBUG(): + def run(report1, report2=""): + if __DEBUG_RUN == True: + print("__DEBUG_RUN >>>", report1, report2) + + def library(report1, report2=""): + if __DEBUG_LIBRARY == True: + print("__DEBUG_LIBRARY >>>", report1, report2) + + def scan(report1, report2=""): + if __DEBUG_SCAN == True: + print("__DEBUG_SCAN >>>", report1, report2) #Temporarily hard coded library into script def init_lib_filesearch(): - + __DEBUG.scan("Loading Library - Filesearch") + #Fractureiser global sus_files_fractureiser sus_files_fractureiser = [ @@ -22,7 +40,7 @@ def init_lib_filesearch(): ] def init_lib(): - print("Initializing Linux Library: File Locations") + print("Initializing Library: File Locations") init_lib_filesearch() print("NOTICE: Signature checks not implemented yet.") @@ -55,13 +73,19 @@ def scan_summary(): pass def run(): + __DEBUG.run("Checking OS") + if osname == "nt": #If OS is Windows, do Windows inits and scan, elif OS is Linux, do Linux inits and scan. - print("Windows system detected.") + __DEBUG.run("Windows system detected.") + print("Ending here; Windows is not supported.") exit() + elif osname == "posix": - print("Posix compliant (Linux) system detected") + + __DEBUG.run("Posix compliant (Linux) system detected") init_lib() + global threats threats = [ sus_files_fractureiser, @@ -74,11 +98,12 @@ def run(): ] scan() - scan_summary() exit() -try: - run() -except KeyboardInterrupt: - exit() \ No newline at end of file + +if __name__ == '__main__': + try: + run() + except KeyboardInterrupt: + exit() \ No newline at end of file