@@ -497,46 +497,34 @@ def run(self):
497
497
Auxiliary ()
498
498
prefix = f"{ auxiliary .__name__ } ."
499
499
500
- # disable_screens = True
501
- # if self.options.get("disable_screens") == "0":
502
- # disable_screens = False
503
-
504
500
for _ , name , _ in pkgutil .iter_modules (auxiliary .__path__ , prefix ):
505
501
try :
506
- log .debug ('Importing auxiliary module "%s"...' , name )
507
- __import__ (name , globals (), locals (), ["dummy" ])
508
- # log.debug('Imported auxiliary module "%s"', name)
502
+ mod_name = name .split ("." )[- 1 ]
503
+ if hasattr (self .config , mod_name ) and getattr (self .config , mod_name , False ):
504
+ log .debug ('Importing auxiliary module "%s"...' , name )
505
+ __import__ (name , globals (), locals (), ["dummy" ])
506
+ # log.debug('Imported auxiliary module "%s"', name)
509
507
except ImportError as e :
510
508
log .warning ('Unable to import the auxiliary module "%s": %s' , name , e )
509
+
511
510
# Walk through the available auxiliary modules.
512
511
aux_modules = []
513
512
514
513
for module in sorted (Auxiliary .__subclasses__ (), key = lambda x : x .start_priority , reverse = True ):
515
- # Try to start the auxiliary module.
516
- # if module.__name__ == "Screenshots" and disable_screens:
517
- # continue
518
514
try :
519
515
aux = module (self .options , self .config )
520
516
log .debug ('Initialized auxiliary module "%s"' , module .__name__ )
521
517
aux_modules .append (aux )
522
-
523
- # The following commented out code causes the monitor to not upload logs.
524
- # If the auxiliary module is not enabled, we shouldn't start it
525
- # if hasattr(aux, "enabled") and not getattr(aux, "enabled", False):
526
- # log.debug('Auxiliary module "%s" is disabled.', module.__name__)
527
- # # We continue so that the module is not added to AUX_ENABLED
528
- # continue
529
- # else:
530
- log .debug ('Trying to start auxiliary module "%s"...' , module .__name__ )
518
+ log .debug ('Trying to start auxiliary module "%s"...' , module .__module__ )
531
519
aux .start ()
532
520
except (NotImplementedError , AttributeError ) as e :
533
521
log .warning ("Auxiliary module %s was not implemented: %s" , module .__name__ , e )
534
522
except Exception as e :
535
- log .warning ("Cannot execute auxiliary module %s: %s" , module .__name__ , e )
523
+ log .warning ("Cannot execute auxiliary module %s: %s" , module .__module__ , e )
536
524
else :
537
- log .debug ("Started auxiliary module %s" , module .__name__ )
525
+ log .debug ("Started auxiliary module %s" , module .__module__ )
538
526
AUX_ENABLED .append (aux )
539
-
527
+
540
528
"""
541
529
# Inform zer0m0n of the ResultServer address.
542
530
zer0m0n.resultserver(self.config.ip, self.config.port)
0 commit comments