@@ -14,18 +14,17 @@ class NXCModule:
1414 supported_protocols = ["ldap" ]
1515 category = CATEGORY .ENUMERATION
1616
17-
1817 def options (self , context , module_options ):
1918 """
2019 FILTER Apply the FILTER (grep-like) (default: '')
2120 OUTPUTFILE Path to a file to save the results (default: None)
2221 """
2322 self .FILTER = ""
2423 self .OUTPUTFILE = None
25-
24+
2625 if "FILTER" in module_options :
2726 self .FILTER = module_options ["FILTER" ]
28-
27+
2928 if "OUTPUTFILE" in module_options :
3029 self .OUTPUTFILE = module_options ["OUTPUTFILE" ]
3130
@@ -54,13 +53,13 @@ def on_login(self, context, connection):
5453 context .log .warning ("No results found after filtering." )
5554
5655 def filter_answer (self , context , answers ):
57- # No filter
56+ # No filter
5857 if not self .FILTER :
5958 context .log .debug ("No filter option enabled" )
6059 return answers
6160 # Filter
6261 context .log .debug (f"Filter info field with: { self .FILTER } " )
63- return [answer for answer in answers if self .FILTER in answer [0 ]]
62+ return [answer for answer in answers if self .FILTER in answer [0 ]]
6463
6564 def save_to_file (self , context , answers ):
6665 """Save the results to a JSON file."""
@@ -72,6 +71,6 @@ def save_to_file(self, context, answers):
7271 with open (self .OUTPUTFILE , "w" ) as f :
7372 json .dump (json_data , f , indent = 4 )
7473 context .log .success (f"Results successfully saved to { self .OUTPUTFILE } " )
75-
74+
7675 except Exception as e :
7776 context .log .error (f"Failed to save results to file: { e } " )
0 commit comments