Update Detectowor.py

Added debugging.
This commit is contained in:
Cutieguwu
2023-07-30 14:56:02 -04:00
parent 1b0c488997
commit df102c12b5

View File

@@ -1,10 +1,28 @@
from sys import exit from sys import exit
from os import name as osname from os import name as osname, path
from os import 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 #Temporarily hard coded library into script
def init_lib_filesearch(): def init_lib_filesearch():
__DEBUG.scan("Loading Library - Filesearch")
#Fractureiser #Fractureiser
global sus_files_fractureiser global sus_files_fractureiser
@@ -22,7 +40,7 @@ def init_lib_filesearch():
] ]
def init_lib(): def init_lib():
print("Initializing Linux Library: File Locations") print("Initializing Library: File Locations")
init_lib_filesearch() init_lib_filesearch()
print("NOTICE: Signature checks not implemented yet.") print("NOTICE: Signature checks not implemented yet.")
@@ -55,13 +73,19 @@ def scan_summary():
pass pass
def run(): 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. 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.") print("Ending here; Windows is not supported.")
exit() exit()
elif osname == "posix": elif osname == "posix":
print("Posix compliant (Linux) system detected")
__DEBUG.run("Posix compliant (Linux) system detected")
init_lib() init_lib()
global threats global threats
threats = [ threats = [
sus_files_fractureiser, sus_files_fractureiser,
@@ -74,11 +98,12 @@ def run():
] ]
scan() scan()
scan_summary() scan_summary()
exit() exit()
try:
run() if __name__ == '__main__':
except KeyboardInterrupt: try:
exit() run()
except KeyboardInterrupt:
exit()