ttp:Optional[str]=None#: TTP of this attack. Or ??? if unknown
references=None# A list of urls or other references
references:list[str]=[]#: A list of urls or other references
required_files:list[str]=[]# Better use the other required_files features
required_files_attacker:list[str]=[]#: A list of files to automatically install to the attacker
@ -33,27 +34,28 @@ class AttackPlugin(BasePlugin):
requirements:Optional[list[Requirement]]=[]#: Requirements to run this plugin, Available are METASPLOIT and CALDERA at the moment
def__init__(self):
def__init__(self)->None:
super().__init__()
self.conf:dict={}# Plugin specific configuration
# self.sysconf = {} # System configuration. common for all plugins
self.attacker_machine_plugin=None# The machine plugin referencing the attacker. The Kali machine should be the perfect candidate
self.target_machine_plugin=None# The machine plugin referencing the target
self.caldera=None# The Caldera connection object
self.targets=None
self.attacker_machine_plugin:Optional[MachineryPlugin]=None# The machine plugin referencing the attacker. The Kali machine should be the perfect candidate
self.target_machine_plugin:Optional[MachineryPlugin]=None# The machine plugin referencing the target
self.caldera:Optional[CalderaControl]=None# The Caldera connection object
self.targets:list[Any]=[]
self.metasploit_password:str="password"
self.metasploit_user:str="user"
self.metasploit=None
self.metasploit:Optional[MetasploitInstant]=None
defrun(self,targets:list[str]):
defrun(self,targets:list[str])->str:
""" The attack is ran here. This method **must be implemented**
@ -98,13 +103,19 @@ class AttackPlugin(BasePlugin):
username=self.metasploit_user)
# If metasploit requirements are not set, self.metasploit stay None and using metasploit from a plugin not having the requirements will trigger an exception
defcopy_to_attacker_and_defender(self):
defcopy_to_attacker_and_defender(self)->None:
""" Copy attacker/defender specific files to the machines. Called by setup, do not call it yourself. template processing happens before
:metaprivate:
"""
ifself.plugin_pathisNone:
raisePluginError("Path for plugin not set")
ifself.attacker_machine_pluginisNone:
raisePluginError("Attacker machine not registered")