How to use the ldaptor.protocols.pureldap.LDAPMessage function in ldaptor

To help you get started, we’ve selected a few ldaptor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JackOfMostTrades / bluebox / evil_dc / ldap / evil_server.py View on Github external
x.sockaddr.pdc_ip = '0.0.0.0'
    x.nt_version = 5
    x.lmnt_token = 0xffff
    x.lm20_token = 0xffff

    #print ndr.ndr_print(x)
    y = ndr.ndr_pack(x)
    attrs = [('netlogon', [ str(y) ])]

    print binascii.hexlify(str(y))
    result = ''
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultEntry(
		    objectName='',
	  	    attributes=attrs),
                id=msgId))
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultDone(
		    resultCode=ldaperrors.Success.resultCode),
                id=msgId))

    return result
github twisted / ldaptor / ldaptor / protocols / ldap / ldapclient.py View on Github external
def _send(self, op, controls=None):
        if not self.connected:
            raise LDAPClientConnectionLostException()
        msg = pureldap.LDAPMessage(op, controls=controls)
        if self.debug:
            log.msg('C->S %s' % repr(msg))
        assert msg.id not in self.onwire
        return msg
github JackOfMostTrades / bluebox / evil_dc / ldap / evil_server.py View on Github external
'1.2.840.113556.1.4.1339',
        '1.2.840.113556.1.4.1340',
        '1.2.840.113556.1.4.1413',
        '1.2.840.113556.1.4.1341'
    ]))
    attrs.append(('namingContexts', [
        dc,
        'CN=Configuration,' + dc,
        'CN=Schema,CN=Configuration,' + dc,
        'DC=DomainDnsZones,' + dc,
        'DC=ForestDnsZones,' + dc
    ]))
    attrs.append(('supportedSASLMechanisms', ['GSS-SPNEGO', 'GSSAPI', 'NTLM']))

    result = ''
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultEntry(
                    objectName='',
                    attributes=attrs),
                id=msgId))
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultDone(
                    resultCode=ldaperrors.Success.resultCode),
                id=msgId))

    return result
github JackOfMostTrades / bluebox / evil_dc / ldap / evil_server.py View on Github external
#x.user_name = ""
    x.server_site = "Default-First-Site-Name"
    x.client_site = "Default-First-Site-Name"
    x.sockaddr_size = 0
    x.sockaddr.pdc_ip = '0.0.0.0'
    x.nt_version = 5
    x.lmnt_token = 0xffff
    x.lm20_token = 0xffff

    #print ndr.ndr_print(x)
    y = ndr.ndr_pack(x)
    attrs = [('netlogon', [ str(y) ])]

    print binascii.hexlify(str(y))
    result = ''
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultEntry(
		    objectName='',
	  	    attributes=attrs),
                id=msgId))
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultDone(
		    resultCode=ldaperrors.Success.resultCode),
                id=msgId))

    return result
github twisted / ldaptor / ldaptor / protocols / ldap / ldapserver.py View on Github external
def queue(self, id, op):
        if not self.connected:
            raise LDAPServerConnectionLostException()
        msg = pureldap.LDAPMessage(op, id=id)
        if self.debug:
            log.msg('S->C %s' % repr(msg), debug=True)
        self.transport.write(msg.toWire())
github JackOfMostTrades / bluebox / evil_dc / ldap / evil_server.py View on Github external
]))
    attrs.append(('namingContexts', [
        dc,
        'CN=Configuration,' + dc,
        'CN=Schema,CN=Configuration,' + dc,
        'DC=DomainDnsZones,' + dc,
        'DC=ForestDnsZones,' + dc
    ]))
    attrs.append(('supportedSASLMechanisms', ['GSS-SPNEGO', 'GSSAPI', 'NTLM']))

    result = ''
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultEntry(
                    objectName='',
                    attributes=attrs),
                id=msgId))
    result += str(pureldap.LDAPMessage(pureldap.LDAPSearchResultDone(
                    resultCode=ldaperrors.Success.resultCode),
                id=msgId))

    return result