MCPcopy Index your code
hub / github.com/secdev/scapy / CommonAuthVerifier

Class CommonAuthVerifier

scapy/layers/dcerpc.py:465–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463
464
465class CommonAuthVerifier(Packet):
466 name = "Common Authentication Verifier"
467 fields_desc = [
468 ByteEnumField(
469 "auth_type",
470 0,
471 RPC_C_AUTHN,
472 ),
473 ByteEnumField("auth_level", 0, RPC_C_AUTHN_LEVEL),
474 ByteField("auth_pad_length", None),
475 ByteField("auth_reserved", 0),
476 XLEIntField("auth_context_id", 0),
477 MultipleTypeField(
478 [
479 # SPNEGO
480 (
481 PacketLenField(
482 "auth_value",
483 GSSAPI_BLOB(),
484 GSSAPI_BLOB,
485 length_from=lambda pkt: pkt.parent.auth_len,
486 ),
487 lambda pkt: pkt.auth_type == 0x09 and pkt.parent and
488 # Bind/Alter
489 pkt.parent.ptype in [11, 12, 13, 14, 15, 16],
490 ),
491 (
492 PacketLenField(
493 "auth_value",
494 GSSAPI_BLOB_SIGNATURE(),
495 GSSAPI_BLOB_SIGNATURE,
496 length_from=lambda pkt: pkt.parent.auth_len,
497 ),
498 lambda pkt: pkt.auth_type == 0x09
499 and pkt.parent
500 and (
501 # Other
502 not pkt.parent
503 or pkt.parent.ptype not in [11, 12, 13, 14, 15, 16]
504 ),
505 ),
506 # Kerberos
507 (
508 PacketLenField(
509 "auth_value",
510 Kerberos(),
511 Kerberos,
512 length_from=lambda pkt: pkt.parent.auth_len,
513 ),
514 lambda pkt: pkt.auth_type == 0x10 and pkt.parent and
515 # Bind/Alter
516 pkt.parent.ptype in [11, 12, 13, 14, 15, 16],
517 ),
518 (
519 PacketLenField(
520 "auth_value",
521 KRB_InnerToken(),
522 KRB_InnerToken,

Callers 3

recvMethod · 0.90
_bindMethod · 0.90
out_pktMethod · 0.85

Calls 13

ByteEnumFieldClass · 0.90
ByteFieldClass · 0.90
XLEIntFieldClass · 0.90
MultipleTypeFieldClass · 0.90
PacketLenFieldClass · 0.90
GSSAPI_BLOBClass · 0.90
KerberosClass · 0.90
KRB_InnerTokenClass · 0.90
NTLM_HeaderClass · 0.90
NL_AUTH_MESSAGEClass · 0.85

Tested by

no test coverage detected