fix conflict

main
mpgn 2023-03-30 06:33:12 -04:00
commit 8aefa68279
3 changed files with 17 additions and 12 deletions

View File

@ -134,19 +134,22 @@ class connection(object):
context = Context(self.db, module_logger, self.args)
context.localip = self.local_ip
try:
if hasattr(module, 'on_request') or hasattr(module, 'has_response'):
self.server.connection = self
self.server.context.localip = self.local_ip
if hasattr(module, 'on_request') or hasattr(module, 'has_response'):
self.server.connection = self
self.server.context.localip = self.local_ip
if hasattr(module, 'on_login'):
module.on_login(context, self)
if hasattr(module, 'on_login'):
module.on_login(context, self)
if self.admin_privs and hasattr(module, 'on_admin_login'):
module.on_admin_login(context, self)
if self.admin_privs and hasattr(module, 'on_admin_login'):
module.on_admin_login(context, self)
if (not hasattr(module, 'on_request') and not hasattr(module, 'has_response')) and hasattr(module,'on_shutdown'):
module.on_shutdown(context, self)
if (not hasattr(module, 'on_request') and not hasattr(module, 'has_response')) and hasattr(module,'on_shutdown'):
module.on_shutdown(context, self)
except Exception as e:
self.logger.error(f"Error while loading module {module}: {e}")
pass
def inc_failed_login(self, username):
global global_failed_logins

View File

@ -185,7 +185,8 @@ def main():
cme_logger.display('{:<25} {}'.format(name, props['description']))
sys.exit(0)
elif args.module and args.show_module_options:
cme_logger.display(f"{args.module[0]} module options:\n{modules[args.module[0]]['options']}")
for module in args.module:
logger.info(f"{module} module options:\n{modules[module]['options']}")
sys.exit(0)
elif args.module:
cme_logger.debug(f"Modules to be Loaded: {args.module}, {type(args.module)}")

View File

@ -7,6 +7,7 @@
# - https://github.com/rapid7/metasploit-framework/blob/master/lib/rex/parser/winscp.rb
import traceback
from typing import Tuple
from impacket.dcerpc.v5.rpcrt import DCERPCException
from impacket.dcerpc.v5 import rrp
from impacket.examples.secretsdump import RemoteOperations
@ -105,7 +106,7 @@ class CMEModule:
clearpass = clearpass[len(key):]
return clearpass
def dec_next_char(self, passBytes) -> tuple[int, bytes]:
def dec_next_char(self, passBytes) -> "Tuple[int, bytes]":
"""
Decrypts the first byte of the password and returns the decrypted byte and the remaining bytes.
Parameters