scapy.layers.ldap

LDAP

RFC 1777 - LDAP v2 RFC 4511 - LDAP v3

Note: to mimic Microsoft Windows LDAP packets, you must set:

conf.ASN1_default_long_size = 4
class scapy.layers.ldap.ASN1F_LDAP_APPLICATION(*seq: Any, **kwargs: Any)[source]

Bases: ASN1F_SEQUENCE

ASN1_tag = <ASN1Tag APPLICATION[96]>
class scapy.layers.ldap.ASN1F_LDAP_Authentication_krbv42DSA(name: str, default: _A | None, context: Type[ASN1_Class] | None = None, implicit_tag: int | None = None, explicit_tag: int | None = None, flexible_tag: bool | None = False, size_len: int | None = None)[source]

Bases: ASN1F_STRING

ASN1_tag = <ASN1Tag krbv42DSA[162]>
class scapy.layers.ldap.ASN1F_LDAP_Authentication_krbv42LDAP(name: str, default: _A | None, context: Type[ASN1_Class] | None = None, implicit_tag: int | None = None, explicit_tag: int | None = None, flexible_tag: bool | None = False, size_len: int | None = None)[source]

Bases: ASN1F_STRING

ASN1_tag = <ASN1Tag krbv42LDAP[161]>
class scapy.layers.ldap.ASN1F_LDAP_Authentication_simple(name: str, default: _A | None, context: Type[ASN1_Class] | None = None, implicit_tag: int | None = None, explicit_tag: int | None = None, flexible_tag: bool | None = False, size_len: int | None = None)[source]

Bases: ASN1F_STRING

ASN1_tag = <ASN1Tag simple[160]>
class scapy.layers.ldap.ASN1_Class_LDAP[source]

Bases: ASN1_Class_UNIVERSAL

ANY = <ASN1Tag ANY[0]>
APPLICATION = <ASN1Tag APPLICATION[96]>
BIT_STRING = <ASN1Tag BIT_STRING[3]>
BMP_STRING = <ASN1Tag BMP_STRING[30]>
BOOLEAN = <ASN1Tag BOOLEAN[1]>
CHAR_STRING = <ASN1Tag CHAR_STRING[29]>
COUNTER32 = <ASN1Tag COUNTER32[65]>
COUNTER64 = <ASN1Tag COUNTER64[70]>
EMBEDDED_PDF = <ASN1Tag EMBEDDED_PDF[11]>
ENUMERATED = <ASN1Tag ENUMERATED[10]>
ERROR = <ASN1Tag ERROR[-3]>
EXTERNAL = <ASN1Tag EXTERNAL[8]>
GAUGE32 = <ASN1Tag GAUGE32[66]>
GENERALIZED_TIME = <ASN1Tag GENERALIZED_TIME[24]>
GENERAL_STRING = <ASN1Tag GENERAL_STRING[27]>
GRAPHIC_STRING = <ASN1Tag GRAPHIC_STRING[25]>
IA5_STRING = <ASN1Tag IA5_STRING[22]>
INTEGER = <ASN1Tag INTEGER[2]>
IPADDRESS = <ASN1Tag IPADDRESS[64]>
ISO646_STRING = <ASN1Tag ISO646_STRING[26]>
NONE = <ASN1Tag NONE[-1]>
NULL = <ASN1Tag NULL[5]>
NUMERIC_STRING = <ASN1Tag NUMERIC_STRING[18]>
OBJECT_DESCRIPTOR = <ASN1Tag OBJECT_DESCRIPTOR[7]>
OID = <ASN1Tag OID[6]>
PRINTABLE_STRING = <ASN1Tag PRINTABLE_STRING[19]>
RAW = <ASN1Tag RAW[-2]>
REAL = <ASN1Tag REAL[9]>
RELATIVE_OID = <ASN1Tag RELATIVE_OID[13]>
SEQUENCE = <ASN1Tag SEQUENCE[48]>
SET = <ASN1Tag SET[49]>
STRING = <ASN1Tag STRING[4]>
T61_STRING = <ASN1Tag T61_STRING[20]>
TIME_TICKS = <ASN1Tag TIME_TICKS[67]>
UNIVERSAL_STRING = <ASN1Tag UNIVERSAL_STRING[28]>
UTC_TIME = <ASN1Tag UTC_TIME[23]>
UTF8_STRING = <ASN1Tag UTF8_STRING[12]>
VIDEOTEX_STRING = <ASN1Tag VIDEOTEX_STRING[21]>
name = 'LDAP'
class scapy.layers.ldap.ASN1_Class_LDAP_Authentication[source]

Bases: ASN1_Class_UNIVERSAL

ANY = <ASN1Tag ANY[0]>
BIT_STRING = <ASN1Tag BIT_STRING[3]>
BMP_STRING = <ASN1Tag BMP_STRING[30]>
BOOLEAN = <ASN1Tag BOOLEAN[1]>
CHAR_STRING = <ASN1Tag CHAR_STRING[29]>
COUNTER32 = <ASN1Tag COUNTER32[65]>
COUNTER64 = <ASN1Tag COUNTER64[70]>
EMBEDDED_PDF = <ASN1Tag EMBEDDED_PDF[11]>
ENUMERATED = <ASN1Tag ENUMERATED[10]>
ERROR = <ASN1Tag ERROR[-3]>
EXTERNAL = <ASN1Tag EXTERNAL[8]>
GAUGE32 = <ASN1Tag GAUGE32[66]>
GENERALIZED_TIME = <ASN1Tag GENERALIZED_TIME[24]>
GENERAL_STRING = <ASN1Tag GENERAL_STRING[27]>
GRAPHIC_STRING = <ASN1Tag GRAPHIC_STRING[25]>
IA5_STRING = <ASN1Tag IA5_STRING[22]>
INTEGER = <ASN1Tag INTEGER[2]>
IPADDRESS = <ASN1Tag IPADDRESS[64]>
ISO646_STRING = <ASN1Tag ISO646_STRING[26]>
NONE = <ASN1Tag NONE[-1]>
NULL = <ASN1Tag NULL[5]>
NUMERIC_STRING = <ASN1Tag NUMERIC_STRING[18]>
OBJECT_DESCRIPTOR = <ASN1Tag OBJECT_DESCRIPTOR[7]>
OID = <ASN1Tag OID[6]>
PRINTABLE_STRING = <ASN1Tag PRINTABLE_STRING[19]>
RAW = <ASN1Tag RAW[-2]>
REAL = <ASN1Tag REAL[9]>
RELATIVE_OID = <ASN1Tag RELATIVE_OID[13]>
SEQUENCE = <ASN1Tag SEQUENCE[48]>
SET = <ASN1Tag SET[49]>
STRING = <ASN1Tag STRING[4]>
T61_STRING = <ASN1Tag T61_STRING[20]>
TIME_TICKS = <ASN1Tag TIME_TICKS[67]>
UNIVERSAL_STRING = <ASN1Tag UNIVERSAL_STRING[28]>
UTC_TIME = <ASN1Tag UTC_TIME[23]>
UTF8_STRING = <ASN1Tag UTF8_STRING[12]>
VIDEOTEX_STRING = <ASN1Tag VIDEOTEX_STRING[21]>
krbv42DSA = <ASN1Tag krbv42DSA[162]>
krbv42LDAP = <ASN1Tag krbv42LDAP[161]>
name = 'LDAP Authentication'
sasl = <ASN1Tag sasl[163]>
simple = <ASN1Tag simple[160]>
class scapy.layers.ldap.ASN1_LDAP_APPLICATION(val: _K)[source]

Bases: ASN1_SEQUENCE

tag = <ASN1Tag APPLICATION[96]>
class scapy.layers.ldap.ASN1_LDAP_Authentication_krbv42DSA(val: _K)[source]

Bases: ASN1_STRING

tag = <ASN1Tag krbv42DSA[162]>
class scapy.layers.ldap.ASN1_LDAP_Authentication_krbv42LDAP(val: _K)[source]

Bases: ASN1_STRING

tag = <ASN1Tag krbv42LDAP[161]>
class scapy.layers.ldap.ASN1_LDAP_Authentication_simple(val: _K)[source]

Bases: ASN1_STRING

tag = <ASN1Tag simple[160]>
class scapy.layers.ldap.AttributeValueAssertion(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
AttributeValueAssertion fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.BERcodec_LDAP_APPLICATION[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag APPLICATION[96]>
class scapy.layers.ldap.BERcodec_LDAP_Authentication_krbv42DSA[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag krbv42DSA[162]>
class scapy.layers.ldap.BERcodec_LDAP_Authentication_krbv42LDAP[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag krbv42LDAP[161]>
class scapy.layers.ldap.BERcodec_LDAP_Authentication_simple[source]

Bases: BERcodec_SEQUENCE

tag = <ASN1Tag simple[160]>
class scapy.layers.ldap.CLDAP(_pkt, /, *, messageID=0x0 <ASN1_INTEGER[0]>, user=<ASN1_STRING['']>, protocolOp=<LDAP_SearchRequest  filter=<LDAP_Filter  filter=<LDAP_FilterPresent  |> |> |>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_CHOICE object>)>
aliastypes
answers(other)[source]
fields_desc
CLDAP fields

messageID

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

user

ASN1F_STRING

<ASN1_STRING['']>

protocolOp

ASN1F_CHOICE

<LDAP_SearchRequest  filter=<LDAP_Filter  filter=<LDAP_FilterPresent  |> |> |>

payload_guess

Possible sublayers: CLDAP

class scapy.layers.ldap.LDAP(_pkt, /, *, messageID=0x0 <ASN1_INTEGER[0]>, protocolOp=<LDAP_SearchRequest  filter=<LDAP_Filter  filter=<LDAP_FilterPresent  |> |> |>, Controls=None)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_CHOICE object>, <scapy.asn1fields.ASN1F_optional object>)>
aliastypes
answers(other)[source]
fields_desc
LDAP fields

messageID

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

protocolOp

ASN1F_CHOICE

<LDAP_SearchRequest  filter=<LDAP_Filter  filter=<LDAP_FilterPresent  |> |> |>

Controls

ASN1F_SEQUENCE_OF

None

mysummary()[source]
payload_guess

Possible sublayers: LDAP

class scapy.layers.ldap.LDAPReferral(_pkt, /, *, uri=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAPReferral fields

uri

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_AbandonRequest(_pkt, /, *, messageID=0x0 <ASN1_INTEGER[0]>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_INTEGER object>,)>
aliastypes
fields_desc
LDAP_AbandonRequest fields

messageID

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

class scapy.layers.ldap.LDAP_BindRequest(_pkt, /, *, version=0x2 <ASN1_INTEGER[2]>, bind_name=<ASN1_STRING['']>, authentication=None)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_CHOICE object>)>
aliastypes
fields_desc
LDAP_BindRequest fields

version

ASN1F_INTEGER

0x2 <ASN1_INTEGER[2]>

bind_name

ASN1F_STRING

<ASN1_STRING['']>

authentication

ASN1F_CHOICE

None

class scapy.layers.ldap.LDAP_BindResponse(_pkt, /, *, resultCode=0x0 <ASN1_ENUMERATED[0]>, matchedDN=<ASN1_STRING['']>, diagnosticMessage=<ASN1_STRING['']>, referral=[], serverSaslCreds=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_ENUMERATED object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_optional object>)>
aliastypes
fields_desc
LDAP_BindResponse fields

resultCode

ASN1F_ENUMERATED

0x0 <ASN1_ENUMERATED[0]>

matchedDN

ASN1F_STRING

<ASN1_STRING['']>

diagnosticMessage

ASN1F_STRING

<ASN1_STRING['']>

referral

ASN1F_SEQUENCE_OF

[]

serverSaslCreds

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_Control(_pkt, /, *, controlType=<ASN1_STRING['']>, criticality=False <ASN1_BOOLEAN[False]>, controlValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_optional object>, <scapy.asn1fields.ASN1F_optional object>)>
aliastypes
fields_desc
LDAP_Control fields

controlType

ASN1F_STRING

<ASN1_STRING['']>

criticality

ASN1F_BOOLEAN

False <ASN1_BOOLEAN[False]>

controlValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_Filter(_pkt, /, *, filter=<LDAP_FilterPresent  |>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_CHOICE object>
aliastypes
fields_desc
LDAP_Filter fields

filter

ASN1F_CHOICE

<LDAP_FilterPresent  |>

class scapy.layers.ldap.LDAP_FilterAnd(_pkt, /, *, and_=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SET_OF and_>
aliastypes
fields_desc
LDAP_FilterAnd fields

and_

ASN1F_SET_OF

[]

class scapy.layers.ldap.LDAP_FilterApproxMatch(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
LDAP_FilterApproxMatch fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_FilterEqual(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
LDAP_FilterEqual fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_FilterGreaterOrEqual(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
LDAP_FilterGreaterOrEqual fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_FilterLessOrEqual(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
LDAP_FilterLessOrEqual fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_FilterLesserOrEqual(_pkt, /, *, attributeType=<ASN1_STRING['organizationName']>, attributeValue=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>)>
aliastypes
fields_desc
LDAP_FilterLesserOrEqual fields

attributeType

ASN1F_STRING

<ASN1_STRING['organizationName']>

attributeValue

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_FilterOr(_pkt, /, *, or_=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SET_OF or_>
aliastypes
fields_desc
LDAP_FilterOr fields

or_

ASN1F_SET_OF

[]

class scapy.layers.ldap.LDAP_FilterPresent(_pkt, /, *, present=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_FilterPresent fields

present

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SaslCredentials(_pkt, /, *, mechanism=<ASN1_STRING['']>, credentials=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <scapy.layers.ldap._SaslCredentialsField object>)>
aliastypes
fields_desc
LDAP_SaslCredentials fields

mechanism

ASN1F_STRING

<ASN1_STRING['']>

credentials

_SaslCredentialsField

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SearchRequest(_pkt, /, *, baseObject=<ASN1_STRING['']>, scope=0x0 <ASN1_ENUMERATED[0]>, derefAliases=0x0 <ASN1_ENUMERATED[0]>, sizeLimit=0x0 <ASN1_INTEGER[0]>, timeLimit=0x0 <ASN1_INTEGER[0]>, attrsOnly=False <ASN1_BOOLEAN[False]>, filter=<LDAP_Filter  filter=<LDAP_FilterPresent  |> |>, attributes=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_ENUMERATED object>, <scapy.asn1fields.ASN1F_ENUMERATED object>, <scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_INTEGER object>, <scapy.asn1fields.ASN1F_BOOLEAN object>, <scapy.asn1fields.ASN1F_PACKET object>, <ASN1F_SEQUENCE_OF attributes>)>
aliastypes
fields_desc
LDAP_SearchRequest fields

baseObject

ASN1F_STRING

<ASN1_STRING['']>

scope

ASN1F_ENUMERATED

0x0 <ASN1_ENUMERATED[0]>

derefAliases

ASN1F_ENUMERATED

0x0 <ASN1_ENUMERATED[0]>

sizeLimit

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

timeLimit

ASN1F_INTEGER

0x0 <ASN1_INTEGER[0]>

attrsOnly

ASN1F_BOOLEAN

False <ASN1_BOOLEAN[False]>

filter

ASN1F_PACKET

<LDAP_Filter  filter=<LDAP_FilterPresent  |> |>

attributes

ASN1F_SEQUENCE_OF

[]

class scapy.layers.ldap.LDAP_SearchRequestAttribute(_pkt, /, *, type=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_SearchRequestAttribute fields

type

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SearchResponseEntry(_pkt, /, *, objectName=<ASN1_STRING['']>, attributes=<LDAP_SearchResponseEntryAttribute  |>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_STRING object>, <ASN1F_SEQUENCE_OF attributes>)>
aliastypes
fields_desc
LDAP_SearchResponseEntry fields

objectName

ASN1F_STRING

<ASN1_STRING['']>

attributes

ASN1F_SEQUENCE_OF

<LDAP_SearchResponseEntryAttribute  |>

class scapy.layers.ldap.LDAP_SearchResponseEntryAttribute(_pkt, /, *, type=<ASN1_STRING['']>, values=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <ASN1F_SET_OF values>)>
aliastypes
fields_desc
LDAP_SearchResponseEntryAttribute fields

type

ASN1F_STRING

<ASN1_STRING['']>

values

ASN1F_SET_OF

[]

class scapy.layers.ldap.LDAP_SearchResponseEntryAttributeValue(_pkt, /, *, value=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_SearchResponseEntryAttributeValue fields

value

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SearchResponseResultDone(_pkt, /, *, resultCode=0x0 <ASN1_ENUMERATED[0]>, matchedDN=<ASN1_STRING['']>, diagnosticMessage=<ASN1_STRING['']>, referral=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_LDAP_APPLICATION(<scapy.asn1fields.ASN1F_ENUMERATED object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_STRING object>, <scapy.asn1fields.ASN1F_optional object>)>
aliastypes
fields_desc
LDAP_SearchResponseResultDone fields

resultCode

ASN1F_ENUMERATED

0x0 <ASN1_ENUMERATED[0]>

matchedDN

ASN1F_STRING

<ASN1_STRING['']>

diagnosticMessage

ASN1F_STRING

<ASN1_STRING['']>

referral

ASN1F_SEQUENCE_OF

[]

class scapy.layers.ldap.LDAP_SubstringFilter(_pkt, /, *, type=<ASN1_STRING['']>, filters=[])[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_STRING object>, <ASN1F_SEQUENCE_OF filters>)>
aliastypes
fields_desc
LDAP_SubstringFilter fields

type

ASN1F_STRING

<ASN1_STRING['']>

filters

ASN1F_SEQUENCE_OF

[]

class scapy.layers.ldap.LDAP_SubstringFilterAny(_pkt, /, *, any=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_SubstringFilterAny fields

any

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SubstringFilterFinal(_pkt, /, *, final=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_SubstringFilterFinal fields

final

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SubstringFilterInitial(_pkt, /, *, initial=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_STRING object>
aliastypes
fields_desc
LDAP_SubstringFilterInitial fields

initial

ASN1F_STRING

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_SubstringFilterStr(_pkt, /, *, str=<ASN1_STRING['']>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_CHOICE object>
aliastypes
fields_desc
LDAP_SubstringFilterStr fields

str

ASN1F_CHOICE

<ASN1_STRING['']>

class scapy.layers.ldap.LDAP_UnbindRequest(_pkt, /, *, info=<ASN1_NULL[0]>)[source]

Bases: ASN1_Packet

ASN1_codec = <ASN1Codec BER[1]>
ASN1_root = <scapy.asn1fields.ASN1F_NULL object>
aliastypes
fields_desc
LDAP_UnbindRequest fields

info

ASN1F_NULL

<ASN1_NULL[0]>

class scapy.layers.ldap.LdapPing_am(self, NetbiosDomainName='DOMAIN', DomainGuid=UUID('192bc4b3-0085-4521-83fe-062913ef59f2'), DcSiteName='Default-First-Site-Name', NetbiosComputerName='SRV1', DnsForestName=None, DnsHostName=None, src_ip=None, src_ip6=None)[source]

Bases: AnsweringMachine

filter: str | None = 'udp port 389'
function_name = 'ldappingd'
is_request(req)[source]
make_reply(req)[source]
optam0: Dict[str, Any]
optam1: Dict[str, Any]
optam2: Dict[str, Any]
optsend: Dict[str, Any]
optsniff: Dict[str, Any]
parse_options(NetbiosDomainName='DOMAIN', DomainGuid=UUID('192bc4b3-0085-4521-83fe-062913ef59f2'), DcSiteName='Default-First-Site-Name', NetbiosComputerName='SRV1', DnsForestName=None, DnsHostName=None, src_ip=None, src_ip6=None)[source]
scapy.layers.ldap.dclocator(realm, qtype='A', mode='ldap', port=None, timeout=1, NtVersion=None, debug=0)[source]

Perform a DC Locator as per [MS-ADTS] sect 6.3.6 or RFC4120.

Parameters:
  • realm – the kerberos realm to locate

  • mode – Detect if a server is up and joinable thanks to one of:

  • ‘nocheck’: Do not check that servers are online.

  • ‘ldap’: Use the LDAP ping (CLDAP) per [MS-ADTS]. Default.

    This will however not work with MIT Kerberos servers.

  • ‘connect’: connect to specified port to test the connection.

Parameters:
  • mode – in connect mode, the port to connect to. (e.g. 88)

  • debug – print debug logs

This is cached in conf.netcache.dclocator.