securityblob.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ysrc 作者: myDreamShadow 项目源码 文件源码
def decodeChallengeSecurityBlob(data):
    try:
        d, _ = decoder.decode(data, asn1Spec = NegotiationToken())
        nt = d.getComponentByName('negTokenTarg')

        token = nt.getComponentByName('responseToken')
        if not token:
            raise BadSecurityBlobError('NTLMSSP_CHALLENGE security blob does not contain responseToken field')

        provider_oid = nt.getComponentByName('supportedMech')
        if provider_oid and str(provider_oid) != '1.3.6.1.4.1.311.2.2.10':  # This OID is defined in [MS-NLMP]: 1.9
            raise UnsupportedSecurityProvider('Security provider "%s" is not supported by pysmb' % str(provider_oid))

        result = nt.getComponentByName('negResult')
        return int(result), str(token)
    except Exception, ex:
        raise BadSecurityBlobError(str(ex))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号