当前位置: 首页>>代码示例>>Python>>正文


Python nt_errors.ERROR_MESSAGES属性代码示例

本文整理汇总了Python中impacket.nt_errors.ERROR_MESSAGES属性的典型用法代码示例。如果您正苦于以下问题:Python nt_errors.ERROR_MESSAGES属性的具体用法?Python nt_errors.ERROR_MESSAGES怎么用?Python nt_errors.ERROR_MESSAGES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在impacket.nt_errors的用法示例。


在下文中一共展示了nt_errors.ERROR_MESSAGES属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        error_class = SessionError.error_classes.get( self.error_class, None )
        if not error_class:
            error_code_str = self.error_code
            error_class_str = self.error_class
        else:
            error_class_str = error_class[0]
            error_code = error_class[1].get( self.error_code, None )
            if not error_code:
                error_code_str = self.error_code
            else:
                error_code_str = '%s(%s)' % error_code

        if self.nt_status:
            return 'SMB SessionError: %s(%s)' % nt_errors.ERROR_MESSAGES[self.error_code]
        else:
            # Fall back to the old format
            return 'SMB SessionError: class: %s, code: %s' % (error_class_str, error_code_str)


# Raised when an supported feature is present/required in the protocol but is not
# currently supported by pysmb 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:24,代码来源:smb.py

示例2: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if system_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = system_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = system_errors.ERROR_MESSAGES[key][1] 
            return 'NRPC SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        elif nt_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'NRPC SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'NRPC SessionError: unknown error code: 0x%x' % (self.error_code)

################################################################################
# CONSTANTS
################################################################################
# 2.2.1.2.5 NL_DNS_NAME_INFO
# Type 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:20,代码来源:nrpc.py

示例3: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if key in system_errors.ERROR_MESSAGES:
            error_msg_short = system_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = system_errors.ERROR_MESSAGES[key][1] 
            return 'NRPC SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        elif key in nt_errors.ERROR_MESSAGES:
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'NRPC SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'NRPC SessionError: unknown error code: 0x%x' % (self.error_code)

################################################################################
# CONSTANTS
################################################################################
# 2.2.1.2.5 NL_DNS_NAME_INFO
# Type 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:20,代码来源:nrpc.py

示例4: smbcheck

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def smbcheck(target):
    if checkPort(target,'445'):
        conn = MYSMB(target)
        try:
            conn.login(USERNAME, PASSWORD)
        except smb.SessionError as e:
            #print('Login failed: ' + nt_errors.ERROR_MESSAGES[e.error_code][0])
            sys.exit()
        finally:
            #print('OS: ' + conn.get_server_os())
            TragetOS = '(' + conn.get_server_os()+')'

        tid = conn.tree_connect_andx('\\\\'+target+'\\'+'IPC$')
        conn.set_default_tid(tid)

        # test if target is vulnerable
        TRANS_PEEK_NMPIPE = 0x23
        recvPkt = conn.send_trans(pack('<H', TRANS_PEEK_NMPIPE), maxParameterCount=0xffff, maxDataCount=0x800)
        status = recvPkt.getNTStatus()
        if status == 0xC0000205:  # STATUS_INSUFF_SERVER_RESOURCES
            #print('The target is not patched')
            CheckResult = 'MS17-010\t'+TragetOS

        return CheckResult 
开发者ID:k8gege,项目名称:K8CScan,代码行数:26,代码来源:K8Cscan.py

示例5: getErrorString

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def getErrorString( self ):
        return nt_errors.ERROR_MESSAGES[self.error] 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:4,代码来源:smbconnection.py

示例6: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        if nt_errors.ERROR_MESSAGES.has_key(self.error):
            return 'SMB SessionError: %s(%s)' % (nt_errors.ERROR_MESSAGES[self.error])
        else:
            return 'SMB SessionError: 0x%x' % self.error 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:7,代码来源:smbconnection.py

示例7: getErrorString

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def getErrorString( self ):
        return constants.ERROR_MESSAGES[self.error] 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:4,代码来源:kerberosv5.py

示例8: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        retString = 'Kerberos SessionError: %s(%s)' % (constants.ERROR_MESSAGES[self.error])
        try:
            # Let's try to get the NT ERROR, if not, we quit and give the general one
            if self.error == constants.ErrorCodes.KRB_ERR_GENERIC.value:
                eData = decoder.decode(str(self.packet['e-data']), asn1Spec = KERB_ERROR_DATA())[0]
                nt_error = struct.unpack('<L', str(eData['data-value'])[:4])[0]
                retString += '\nNT ERROR: %s(%s)' % (nt_errors.ERROR_MESSAGES[nt_error])
        except:
            pass

        return retString 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:14,代码来源:kerberosv5.py

示例9: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if nt_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'LSAD SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'LSAD SessionError: unknown error code: 0x%x' % self.error_code

################################################################################
# CONSTANTS
################################################################################
# 2.2.1.1.2 ACCESS_MASK for Policy Objects 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:15,代码来源:lsad.py

示例10: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if nt_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'LSAT SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'LSAT SessionError: unknown error code: 0x%x' % self.error_code

################################################################################
# CONSTANTS
################################################################################
# 2.2.10 ACCESS_MASK 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:15,代码来源:lsat.py

示例11: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if nt_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'Mimikatz SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'Mimikatz SessionError: unknown error code: 0x%x' % self.error_code

################################################################################
# CONSTANTS
################################################################################ 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:14,代码来源:mimilib.py

示例12: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        key = self.error_code
        if nt_errors.ERROR_MESSAGES.has_key(key):
            error_msg_short = nt_errors.ERROR_MESSAGES[key][0]
            error_msg_verbose = nt_errors.ERROR_MESSAGES[key][1] 
            return 'MGMT SessionError: code: 0x%x - %s - %s' % (self.error_code, error_msg_short, error_msg_verbose)
        else:
            return 'MGMT SessionError: unknown error code: 0x%x' % self.error_code

################################################################################
# CONSTANTS
################################################################################ 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:14,代码来源:mgmt.py

示例13: execute

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def execute(self, host, port='139', user=None, password='', password_hash=None, domain='', persistent='1'):

    with Timing() as timing:
      fp, _ = self.bind(host, port)

    try:
      if user is None:
        fp.login('', '') # retrieve workgroup/domain and computer name
      else:
        with Timing() as timing:
          if password_hash:
            if ':' in password_hash:
              lmhash, nthash = password_hash.split(':')
            else:
              lmhash, nthash = 'aad3b435b51404eeaad3b435b51404ee', password_hash
            fp.login(user, '', domain, lmhash, nthash)

          else:
            fp.login(user, password, domain)

      logger.debug('No error')
      code, mesg = '0', '%s\\%s (%s)' % (fp.getServerDomain(), fp.getServerName(), fp.getServerOS())

      self.reset()

    except SessionError as e:
      code = '%x' % e.getErrorCode()
      mesg = nt_errors.ERROR_MESSAGES[e.getErrorCode()][0]

    if persistent == '0':
      self.reset()

    return self.Response(code, mesg, timing) 
开发者ID:lanjelot,项目名称:patator,代码行数:35,代码来源:patator.py

示例14: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        if self.error in nt_errors.ERROR_MESSAGES:
            return 'SMB SessionError: %s(%s)' % (nt_errors.ERROR_MESSAGES[self.error])
        else:
            return 'SMB SessionError: 0x%x' % self.error 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:7,代码来源:smbconnection.py

示例15: __str__

# 需要导入模块: from impacket import nt_errors [as 别名]
# 或者: from impacket.nt_errors import ERROR_MESSAGES [as 别名]
def __str__( self ):
        retString = 'Kerberos SessionError: %s(%s)' % (constants.ERROR_MESSAGES[self.error])
        try:
            # Let's try to get the NT ERROR, if not, we quit and give the general one
            if self.error == constants.ErrorCodes.KRB_ERR_GENERIC.value:
                eData = decoder.decode(self.packet['e-data'], asn1Spec = KERB_ERROR_DATA())[0]
                nt_error = struct.unpack('<L', eData['data-value'].asOctets()[:4])[0]
                retString += '\nNT ERROR: %s(%s)' % (nt_errors.ERROR_MESSAGES[nt_error])
        except:
            pass

        return retString 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:14,代码来源:kerberosv5.py


注:本文中的impacket.nt_errors.ERROR_MESSAGES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。