MCPcopy Create free account
hub / github.com/Geeoon/asploit / __exploit

Method __exploit

src/LocalCommandProcessor.py:80–100  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

78 @throw CommandException if the pre-condition is not met.
79 """
80 def __exploit(self, options: str):
81 if self.exploit_status() == True:
82 raise CommandException("Already exploited target.")
83 for var in self.variables:
84 if (self.variables[var]["required"] and
85 len(self.variables[var]["value"]) == 0):
86 raise CommandException(f"{var} not set.")
87 print((f"Attempting to exploit "
88 f"{self.variables['TARGET_HOST']['value']} "
89 f"at {self.variables['TARGET_PATH']['value']}"))
90
91 for exploitClass in self.exploitClasses:
92 if (self.variables['TARGET_TYPE']['value'].upper()
93 == exploitClass.get_name().upper()):
94 self.exploit = (exploitClass(
95 self.variables['TARGET_HOST']['value'],
96 self.variables['TARGET_PATH']['value'],
97 self.variables['METHOD']['value'],
98 self.variables['HEADER']['value']))
99 return
100 raise CommandException("TARGET_TYPE is not supported.")
101
102 """
103 @brief Command to set and display exploit variables.

Callers

nothing calls this directly

Calls 3

exploit_statusMethod · 0.95
CommandExceptionClass · 0.85
get_nameMethod · 0.45

Tested by

no test coverage detected