scapy.layers.ntlm
NTLM
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-NLMP/%5bMS-NLMP%5d.pdf
- class scapy.layers.ntlm.AV_PAIR(_pkt, /, *, AvId=0, AvLen=None, Value=None)[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AVID | AVLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. AV_PAIR
AV_PAIR fields AvId
0
AvLen
None
Value
MultipleTypeField
(LEIntEnumField, UTCTimeField, PacketField, XStrLenField, StrLenFieldUtf16)b''
- scapy.layers.ntlm.HTTP_ntlm_negotiate(ntlm_negotiate)[source]
Create an HTTP NTLM negotiate packet from an NTLM_NEGOTIATE message
- class scapy.layers.ntlm.LM_RESPONSE(_pkt, /, *, Response=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPONSE | + + | | + + | | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LM_RESPONSE
LM_RESPONSE fields Response
b''
- class scapy.layers.ntlm.LMv2_RESPONSE(_pkt, /, *, Response=b'', ChallengeFromClient=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPONSE | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CHALLENGEFROMCLIENT | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LMv2_RESPONSE
LMv2_RESPONSE fields Response
b''
ChallengeFromClient
b''
- class scapy.layers.ntlm.NEGOEX_EXCHANGE_NTLM(_pkt, /, *, items=[])[source]
Bases:
ASN1_Packet
GSSAPI NegoEX Exchange metadata blob This was reversed and may be meaningless
- ASN1_codec = <ASN1Codec BER[1]>
- ASN1_root = <ASN1F_SEQUENCE(<ASN1F_SEQUENCE(<ASN1F_SEQUENCE_OF items>,)>,)>
- aliastypes
- class scapy.layers.ntlm.NEGOEX_EXCHANGE_NTLM_ITEM(_pkt, /, *, oid=<ASN1_OID['.']>, token=<ASN1_PRINTABLE_STRING['']>)[source]
Bases:
ASN1_Packet
- ASN1_codec = <ASN1Codec BER[1]>
- ASN1_root = <ASN1F_SEQUENCE(<ASN1F_SEQUENCE(<ASN1F_SEQUENCE(<scapy.asn1fields.ASN1F_OID object>, <scapy.asn1fields.ASN1F_PRINTABLE_STRING object>)>,)>,)>
- aliastypes
- class scapy.layers.ntlm.NTLMSSP_MESSAGE_SIGNATURE(_pkt, /, *, Version=1, Checksum=b'', SeqNum=0)[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CHECKSUM | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SEQNUM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLMSSP_MESSAGE_SIGNATURE
NTLMSSP_MESSAGE_SIGNATURE fields Version
1
Checksum
b''
SeqNum
0
- class scapy.layers.ntlm.NTLM_AUTHENTICATE(_pkt, /, *, Signature=b'NTLMSSP\x00', MessageType=3, LmChallengeResponseLen=None, LmChallengeResponseMaxLen=None, LmChallengeResponseBufferOffset=None, NtChallengeResponseLen=None, NtChallengeResponseMaxLen=None, NtChallengeResponseBufferOffset=None, DomainNameLen=None, DomainNameMaxLen=None, DomainNameBufferOffset=None, UserNameLen=None, UserNameMaxLen=None, UserNameBufferOffset=None, WorkstationLen=None, WorkstationMaxLen=None, WorkstationBufferOffset=None, EncryptedRandomSessionKeyLen=None, EncryptedRandomSessionKeyMaxLen=None, EncryptedRandomSessionKeyBufferOffset=None, NegotiateFlags=<Flag 0 ()>, ProductMajorVersion=0, ProductMinorVersion=0, ProductBuild=0, res_ver=0, NTLMRevisionCurrent=15, MIC=b'', Payload=[])[source]
Bases:
_NTLMPayloadPacket
- NTLM_VERSION = 1
- OFFSET = 88
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MESSAGETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LMCHALLENGERESPONSELEN | LMCHALLENGERESPONSEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LMCHALLENGERESPONSEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTCHALLENGERESPONSELEN | NTCHALLENGERESPONSEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTCHALLENGERESPONSEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMELEN | DOMAINNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | USERNAMELEN | USERNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | USERNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONLEN | WORKSTATIONMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ENCRYPTEDRANDOMSESSIONKEYLEN |ENCRYPTEDRANDOMSESSIONKEYMAXLEN| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ENCRYPTEDRANDOMSESSIONKEYBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEGOTIATEFLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |PRODUCTMAJORVER|PRODUCTMINORVER| PRODUCTBUILD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RES VER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |NTLMREVISIONCUR| MIC | +-+-+-+-+-+-+-+-+ + | | + + | | + + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PAYLOAD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_AUTHENTICATE
NTLM_AUTHENTICATE fields Signature
b'NTLMSSP\x00'
MessageType
3
LmChallengeResponseLen
None
LmChallengeResponseMaxLen
None
LmChallengeResponseBufferOffset
None
NtChallengeResponseLen
None
NtChallengeResponseMaxLen
None
NtChallengeResponseBufferOffset
None
DomainNameLen
None
DomainNameMaxLen
None
DomainNameBufferOffset
None
UserNameLen
None
UserNameMaxLen
None
UserNameBufferOffset
None
WorkstationLen
None
WorkstationMaxLen
None
WorkstationBufferOffset
None
EncryptedRandomSessionKeyLen
None
EncryptedRandomSessionKeyMaxLen
None
EncryptedRandomSessionKeyBufferOffset
None
NegotiateFlags
<Flag 0 ()>
ProductMajorVersion
0
ProductMinorVersion
0
ProductBuild
0
res_ver
0
NTLMRevisionCurrent
15
MIC
XStrFixedLenField
(Cond)b''
Payload
_NTLMPayloadField
[]
- messageType = 3
- class scapy.layers.ntlm.NTLM_AUTHENTICATE_V2(_pkt, /, *, Signature=b'NTLMSSP\x00', MessageType=3, LmChallengeResponseLen=None, LmChallengeResponseMaxLen=None, LmChallengeResponseBufferOffset=None, NtChallengeResponseLen=None, NtChallengeResponseMaxLen=None, NtChallengeResponseBufferOffset=None, DomainNameLen=None, DomainNameMaxLen=None, DomainNameBufferOffset=None, UserNameLen=None, UserNameMaxLen=None, UserNameBufferOffset=None, WorkstationLen=None, WorkstationMaxLen=None, WorkstationBufferOffset=None, EncryptedRandomSessionKeyLen=None, EncryptedRandomSessionKeyMaxLen=None, EncryptedRandomSessionKeyBufferOffset=None, NegotiateFlags=<Flag 0 ()>, ProductMajorVersion=0, ProductMinorVersion=0, ProductBuild=0, res_ver=0, NTLMRevisionCurrent=15, MIC=b'', Payload=[])[source]
Bases:
NTLM_AUTHENTICATE
- NTLM_VERSION = 2
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MESSAGETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LMCHALLENGERESPONSELEN | LMCHALLENGERESPONSEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LMCHALLENGERESPONSEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTCHALLENGERESPONSELEN | NTCHALLENGERESPONSEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTCHALLENGERESPONSEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMELEN | DOMAINNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | USERNAMELEN | USERNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | USERNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONLEN | WORKSTATIONMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ENCRYPTEDRANDOMSESSIONKEYLEN |ENCRYPTEDRANDOMSESSIONKEYMAXLEN| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ENCRYPTEDRANDOMSESSIONKEYBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEGOTIATEFLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |PRODUCTMAJORVER|PRODUCTMINORVER| PRODUCTBUILD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RES VER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |NTLMREVISIONCUR| MIC | +-+-+-+-+-+-+-+-+ + | | + + | | + + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PAYLOAD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_AUTHENTICATE_V2
NTLM_AUTHENTICATE_V2 fields Signature
b'NTLMSSP\x00'
MessageType
3
LmChallengeResponseLen
None
LmChallengeResponseMaxLen
None
LmChallengeResponseBufferOffset
None
NtChallengeResponseLen
None
NtChallengeResponseMaxLen
None
NtChallengeResponseBufferOffset
None
DomainNameLen
None
DomainNameMaxLen
None
DomainNameBufferOffset
None
UserNameLen
None
UserNameMaxLen
None
UserNameBufferOffset
None
WorkstationLen
None
WorkstationMaxLen
None
WorkstationBufferOffset
None
EncryptedRandomSessionKeyLen
None
EncryptedRandomSessionKeyMaxLen
None
EncryptedRandomSessionKeyBufferOffset
None
NegotiateFlags
<Flag 0 ()>
ProductMajorVersion
0
ProductMinorVersion
0
ProductBuild
0
res_ver
0
NTLMRevisionCurrent
15
MIC
XStrFixedLenField
(Cond)b''
Payload
_NTLMPayloadField
[]
- class scapy.layers.ntlm.NTLM_CHALLENGE(_pkt, /, *, Signature=b'NTLMSSP\x00', MessageType=3, TargetNameLen=None, TargetNameMaxLen=None, TargetNameBufferOffset=None, NegotiateFlags=<Flag 0 ()>, ServerChallenge=None, Reserved=None, TargetInfoLen=None, TargetInfoMaxLen=None, TargetInfoBufferOffset=None, ProductMajorVersion=0, ProductMinorVersion=0, ProductBuild=0, res_ver=0, NTLMRevisionCurrent=15, Payload=[])[source]
Bases:
_NTLMPayloadPacket
- OFFSET = 56
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MESSAGETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TARGETNAMELEN | TARGETNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TARGETNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEGOTIATEFLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SERVERCHALLENGE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TARGETINFOLEN | TARGETINFOMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TARGETINFOBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |PRODUCTMAJORVER|PRODUCTMINORVER| PRODUCTBUILD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RES VER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |NTLMREVISIONCUR| PAYLOAD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_CHALLENGE
NTLM_CHALLENGE fields Signature
b'NTLMSSP\x00'
MessageType
3
TargetNameLen
None
TargetNameMaxLen
None
TargetNameBufferOffset
None
NegotiateFlags
<Flag 0 ()>
ServerChallenge
None
Reserved
None
TargetInfoLen
None
TargetInfoMaxLen
None
TargetInfoBufferOffset
None
ProductMajorVersion
0
ProductMinorVersion
0
ProductBuild
0
res_ver
0
NTLMRevisionCurrent
15
Payload
_NTLMPayloadField
[]
- messageType = 2
- class scapy.layers.ntlm.NTLM_Client(self, debug: int = 0, store: int = 1, **kargs: Any)[source]
Bases:
_NTLM_Automaton
A class to overload to create a client automaton when using NTLM.
- actions: Dict[str, List[_StateWrapper]] = {}
- bind(srv_atmt: NTLM_Server) None [source]
- breakpoints: Set[_StateWrapper]
- conditions: Dict[str, List[_StateWrapper]] = {}
- initial_states: List[_StateWrapper] = []
- interception_points: Set[_StateWrapper]
- ioevents: Dict[str, List[_StateWrapper]] = {}
- ionames: List[str] = []
- iosupersockets: List[SuperSocket] = []
- kwargs_cls = {}
- packets: PacketList
- port = 445
- recv_conditions: Dict[str, List[_StateWrapper]] = {}
- ssl = False
- states: Dict[str, _StateWrapper] = {}
- stop_states: List[_StateWrapper] = []
- threadid: int | None
- timeout: Dict[str, _TimerList] = {}
- class scapy.layers.ntlm.NTLM_Header(_pkt, /, *, Signature=b'NTLMSSP\x00', MessageType=3)[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MESSAGETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_Header
NTLM_Header fields Signature
b'NTLMSSP\x00'
MessageType
3
- class scapy.layers.ntlm.NTLM_NEGOTIATE(_pkt, /, *, Signature=b'NTLMSSP\x00', MessageType=3, NegotiateFlags=<Flag 0 ()>, DomainNameLen=None, DomainNameMaxLen=None, DomainNameBufferOffset=None, WorkstationNameLen=None, WorkstationNameMaxLen=None, WorkstationNameBufferOffset=None, ProductMajorVersion=0, ProductMinorVersion=0, ProductBuild=0, res_ver=0, NTLMRevisionCurrent=15, Payload=[])[source]
Bases:
_NTLMPayloadPacket
- OFFSET = 40
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIGNATURE | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MESSAGETYPE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEGOTIATEFLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMELEN | DOMAINNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOMAINNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONNAMELEN | WORKSTATIONNAMEMAXLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | WORKSTATIONNAMEBUFFEROFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |PRODUCTMAJORVER|PRODUCTMINORVER| PRODUCTBUILD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RES VER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |NTLMREVISIONCUR| PAYLOAD | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_NEGOTIATE
NTLM_NEGOTIATE fields Signature
b'NTLMSSP\x00'
MessageType
3
NegotiateFlags
<Flag 0 ()>
DomainNameLen
None
DomainNameMaxLen
None
DomainNameBufferOffset
None
WorkstationNameLen
None
WorkstationNameMaxLen
None
WorkstationNameBufferOffset
None
ProductMajorVersion
0
ProductMinorVersion
0
ProductBuild
0
res_ver
0
NTLMRevisionCurrent
15
Payload
_NTLMPayloadField
[]
- messageType = 1
- class scapy.layers.ntlm.NTLM_RESPONSE(_pkt, /, *, Response=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPONSE | + + | | + + | | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLM_RESPONSE
NTLM_RESPONSE fields Response
b''
- class scapy.layers.ntlm.NTLM_Server(self, debug: int = 0, store: int = 1, **kargs: Any)[source]
Bases:
_NTLM_Automaton
A class to overload to create a server automaton when using NTLM.
- Parameters:
NTLM_VALUES – a dict whose keys are - “NetbiosDomainName” - “NetbiosComputerName” - “DnsDomainName” - “DnsComputerName” - “DnsTreeName” - “Flags” - “Timestamp”
IDENTITIES – a dict {“username”: NTOWFv2(“password”, “username”, “domain”)} (this is the KeyResponseNT). Setting this value enables signature computation and authenticates inbound users.
DOMAIN_AUTH – a tuple (“<DC IP>”, “machineName”, b”machinePassword”) to use for domain authentication, used to establish the netlogon session. (UNIMPLEMENTED)
- actions: Dict[str, List[_StateWrapper]] = {}
- bind(cli_atmt: NTLM_Client) None [source]
- breakpoints: Set[_StateWrapper]
- conditions: Dict[str, List[_StateWrapper]] = {}
- initial_states: List[_StateWrapper] = []
- interception_points: Set[_StateWrapper]
- ioevents: Dict[str, List[_StateWrapper]] = {}
- ionames: List[str] = []
- iosupersockets: List[SuperSocket] = []
- packets: PacketList
- port = 445
- recv_conditions: Dict[str, List[_StateWrapper]] = {}
- states: Dict[str, _StateWrapper] = {}
- stop_states: List[_StateWrapper] = []
- threadid: int | None
- timeout: Dict[str, _TimerList] = {}
- class scapy.layers.ntlm.NTLMv2_CLIENT_CHALLENGE(_pkt, /, *, RespType=0, HiRespType=0, Reserved1=0, Reserved2=0, TimeStamp=None, ChallengeFromClient=b'12345678', Reserved3=0, AvPairs=[<AV_PAIR |>])[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPTYPE | HIRESPTYPE | RESERVED1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TIMESTAMP | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CHALLENGEFROMCLIENT | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AVPAIRS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLMv2_CLIENT_CHALLENGE
NTLMv2_CLIENT_CHALLENGE fields RespType
0
HiRespType
0
Reserved1
0
Reserved2
0
TimeStamp
None
ChallengeFromClient
b'12345678'
Reserved3
0
AvPairs
[<AV_PAIR |>]
- class scapy.layers.ntlm.NTLMv2_RESPONSE(_pkt, /, *, NTProofStr=b'', RespType=0, HiRespType=0, Reserved1=0, Reserved2=0, TimeStamp=None, ChallengeFromClient=b'12345678', Reserved3=0, AvPairs=[<AV_PAIR |>])[source]
Bases:
Packet
- aliastypes
- computeNTProofStr(ResponseKeyNT, ServerChallenge)[source]
- Set temp to ConcatenationOf(Responserversion, HiResponserversion,
Z(6), Time, ClientChallenge, Z(4), ServerName, Z(4))
- Set NTProofStr to HMAC_MD5(ResponseKeyNT,
ConcatenationOf(CHALLENGE_MESSAGE.ServerChallenge,temp))
Remember ServerName = AvPairs
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTPROOFSTR | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESPTYPE | HIRESPTYPE | RESERVED1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TIMESTAMP | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CHALLENGEFROMCLIENT | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED3 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AVPAIRS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NTLMv2_RESPONSE
NTLMv2_RESPONSE fields NTProofStr
b''
RespType
0
HiRespType
0
Reserved1
0
Reserved2
0
TimeStamp
None
ChallengeFromClient
b'12345678'
Reserved3
0
AvPairs
[<AV_PAIR |>]
- scapy.layers.ntlm.RC4K(key, data)[source]
Indicates the encryption of data item D with the key K using the RC4 algorithm.
- class scapy.layers.ntlm.Single_Host_Data(_pkt, /, *, Size=0, Z4=0, CustomData=b'', MachineID=b'')[source]
Bases:
Packet
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SIZE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Z4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CUSTOMDATA | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MACHINEID | + + | | + + | | + + | | + + | | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. Single_Host_Data
Single_Host_Data fields Size
0
Z4
0
CustomData
b''
MachineID
b''
- scapy.layers.ntlm.ntlm_relay(serverCls, remoteIP, remoteClientCls, DROP_MIC_v1=False, DROP_MIC_v2=False, DROP_EXTENDED_SECURITY=False, ALLOW_SMB2=None, server_kwargs=None, client_kwargs=None, iface=None, debug=2)[source]
NTLM Relay
This class aims at implementing a simple pass-the-hash attack across various protocols.
- Usage example:
- ntlm_relay(port=445,
remoteIP=”192.168.122.65”, remotePort=445, iface=”eth0”)
- Parameters:
port – the port to open the relay on
remoteIP – the address IP of the server to connect to for auth
remotePort – the proto to connect to the server into