Coverage for /private/tmp/im/impacket/impacket/examples/ntlmrelayx/clients/__init__.py : 61%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright (c) 2013-2017 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Protocol Client Base Class definition # # Author: # Alberto Solino (@agsolino) # # Description: # Defines a base class for all clients + loads all available modules # # ToDo: #
# Base class for Protocol Clients for different protocols (SMB, MSSQL, etc) # Besides using this base class you need to define one global variable when # writing a plugin for protocol clients: # PROTOCOL_CLIENT_CLASS = "<name of the class for the plugin>" # PLUGIN_NAME must be the protocol name that will be matched later with the relay targets (e.g. SMB, LDAP, etc) self.serverConfig = serverConfig self.targetHost = target.hostname # A default target port is specified by the subclass if target.port is not None: # We override it by the one specified in the target self.targetPort = target.port else: self.targetPort = targetPort self.target = target self.extendedSecurity = extendedSecurity self.session = None self.sessionData = {}
raise RuntimeError('Virtual Function')
raise RuntimeError('Virtual Function')
""" Charged of sending the type 1 NTLM Message
:param bytes negotiateMessage: :return: """ raise RuntimeError('Virtual Function')
""" Charged of sending the type 3 NTLM Message to the Target
:param bytes authenticateMessageBlob: :param bytes serverChallenge: :return: """ raise RuntimeError('Virtual Function')
# Handle the situation When FLAGS2_EXTENDED_SECURITY is not set raise RuntimeError('Virtual Function')
# Should return the active session for the relayed connection raise RuntimeError('Virtual Function')
# Should return any extra data that could be useful for the SOCKS proxy to work (e.g. some of the # answers from the original server) return self.sessionData
# Should return the Challenge returned by the server when Extended Security is not set # This should only happen with against old Servers. By default we return None return None
# Charged of keeping connection alive raise RuntimeError('Virtual Function')
# Should return whether or not the user is admin in the form of a string (e.g. "TRUE", "FALSE") # Depending on the protocol, different techniques should be used. # By default, raise exception raise RuntimeError('Virtual Function')
# This seems to be None in some case (py3 only) # __spec__ is py3 only though, but I haven't seen this being None on py2 # so it should cover all cases. except NameError: package = __package__ # Python 2 else: except Exception as e: LOG.debug(e) pass
except Exception as e: LOG.debug(str(e)) |