Skip to content

Commit fd86652

Browse files
committed
more clean
1 parent 15d1002 commit fd86652

3 files changed

Lines changed: 0 additions & 30 deletions

File tree

nxc/connection.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,6 @@ def call_modules(self):
284284
context = Context(self.db, module_logger, self.args)
285285
context.localip = self.local_ip
286286

287-
if hasattr(module, "on_request") or hasattr(module, "has_response"):
288-
self.logger.debug(f"Module {module.name} has on_request or has_response methods")
289-
self.server.connection = self
290-
self.server.context.localip = self.local_ip
291-
292287
if hasattr(module, "on_login"):
293288
self.logger.debug(f"Module {module.name} has on_login method")
294289
module.on_login(context, self)
@@ -297,10 +292,6 @@ def call_modules(self):
297292
self.logger.debug(f"Module {module.name} has on_admin_login method")
298293
module.on_admin_login(context, self)
299294

300-
if (not hasattr(module, "on_request") and not hasattr(module, "has_response")) and hasattr(module, "on_shutdown"):
301-
self.logger.debug(f"Module {module.name} has on_shutdown method")
302-
module.on_shutdown(context, self)
303-
304295
def inc_failed_login(self, username):
305296
global global_failed_logins
306297
global user_failed_logins

nxc/modules/example_module.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,3 @@ def on_admin_login(self, context, connection):
4949
This gets called on each authenticated connection with Administrative privileges
5050
"""
5151

52-
def on_request(self, context, request):
53-
"""Optional.
54-
If the payload needs to retrieve additional files, add this function to the module
55-
"""
56-
57-
def on_response(self, context, response):
58-
"""Optional.
59-
If the payload sends back its output to our server, add this function to the module to handle its output
60-
"""
61-
62-
def on_shutdown(self, context, connection):
63-
"""Optional.
64-
Do something on shutdown
65-
"""

nxc/netexec.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ def main():
203203
if ans.lower() not in ["y", "yes", ""]:
204204
exit(1)
205205

206-
if hasattr(module, "on_request") or hasattr(module, "has_response"):
207-
if hasattr(module, "required_server"):
208-
args.server = module.required_server
209-
210-
if not args.server_port:
211-
args.server_port = server_port_dict[args.server]
212-
213206
# Add modules paths to the protocol object so it can load them itself
214207
proto_module_paths.append(modules[m]["path"])
215208
protocol_object.module_paths = proto_module_paths

0 commit comments

Comments
 (0)