smbclientng.core.Module
1#!/usr/bin/env python3 2# -*- coding: utf-8 -*- 3# File name : InteractiveShell.py 4# Author : Podalirius (@podalirius_) 5# Date created : 23 may 2024 6 7 8import shlex 9 10 11class Module(object): 12 """ 13 A parent class for all modules in the smbclient-ng tool. 14 15 This class provides common attributes and methods that are shared among different modules. 16 """ 17 18 name = "" 19 description = "" 20 smbSession = None 21 options = None 22 23 def __init__(self, smbSession, config, logger): 24 self.smbSession = smbSession 25 self.config = config 26 self.logger = logger 27 28 def parseArgs(self): 29 raise NotImplementedError("Subclasses must implement this method") 30 31 def run(self): 32 """ 33 Placeholder method for running the module. 34 35 This method should be implemented by subclasses to define the specific behavior of the module. 36 """ 37 raise NotImplementedError("Subclasses must implement this method") 38 39 def processArguments(self, parser, arguments): 40 if type(arguments) == list: 41 arguments = ' '.join(arguments) 42 43 __iterableArguments = shlex.split(arguments) 44 45 try: 46 self.options = parser.parse_args(__iterableArguments) 47 except SystemExit as e: 48 pass 49 50 return self.options 51
class
Module:
12class Module(object): 13 """ 14 A parent class for all modules in the smbclient-ng tool. 15 16 This class provides common attributes and methods that are shared among different modules. 17 """ 18 19 name = "" 20 description = "" 21 smbSession = None 22 options = None 23 24 def __init__(self, smbSession, config, logger): 25 self.smbSession = smbSession 26 self.config = config 27 self.logger = logger 28 29 def parseArgs(self): 30 raise NotImplementedError("Subclasses must implement this method") 31 32 def run(self): 33 """ 34 Placeholder method for running the module. 35 36 This method should be implemented by subclasses to define the specific behavior of the module. 37 """ 38 raise NotImplementedError("Subclasses must implement this method") 39 40 def processArguments(self, parser, arguments): 41 if type(arguments) == list: 42 arguments = ' '.join(arguments) 43 44 __iterableArguments = shlex.split(arguments) 45 46 try: 47 self.options = parser.parse_args(__iterableArguments) 48 except SystemExit as e: 49 pass 50 51 return self.options
A parent class for all modules in the smbclient-ng tool.
This class provides common attributes and methods that are shared among different modules.
def
run(self):
32 def run(self): 33 """ 34 Placeholder method for running the module. 35 36 This method should be implemented by subclasses to define the specific behavior of the module. 37 """ 38 raise NotImplementedError("Subclasses must implement this method")
Placeholder method for running the module.
This method should be implemented by subclasses to define the specific behavior of the module.