MCPcopy Create free account
hub / github.com/secdev/scapy / SMBSession_Setup_AndX_Response

Class SMBSession_Setup_AndX_Response

scapy/layers/smb.py:606–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604
605
606class SMBSession_Setup_AndX_Response(Packet):
607 name = "Session Setup AndX Response (CIFS)"
608 fields_desc = [
609 ByteField("WordCount", 0x3),
610 ByteEnumField("AndXCommand", 0xFF, SMB_COM),
611 ByteField("AndXReserved", 0),
612 LEShortField("AndXOffset", None),
613 FlagsField(
614 "Action",
615 0,
616 -16,
617 {
618 0x0001: "SMB_SETUP_GUEST",
619 0x0002: "SMB_SETUP_USE_LANMAN_KEY",
620 },
621 ),
622 LEShortField("ByteCount", 25),
623 _SMBStrNullField("NativeOS", "Windows 4.0"),
624 _SMBStrNullField("NativeLanMan", "Windows 4.0"),
625 _SMBStrNullField("PrimaryDomain", ""),
626 # Off spec?
627 ByteField("WordCount2", 3),
628 ByteEnumField("AndXCommand2", 0xFF, SMB_COM),
629 ByteField("Reserved3", 0),
630 LEShortField("AndXOffset2", 80),
631 LEShortField("OptionalSupport", 0x01),
632 LEShortField("ByteCount2", 5),
633 StrNullField("Service", "IPC"),
634 StrNullField("NativeFileSystem", ""),
635 ]
636
637 def post_build(self, pkt, pay):
638 if self.AndXOffset is None:
639 pkt = pkt[:3] + struct.pack("<H", len(pkt) + 32) + pkt[5:]
640 return pkt + pay
641
642
643bind_top_down(SMB_Header, SMBSession_Setup_AndX_Response, Command=0x73, Flags=0x80)

Callers 1

on_setup_andx_requestMethod · 0.90

Calls 6

ByteFieldClass · 0.90
ByteEnumFieldClass · 0.90
LEShortFieldClass · 0.90
FlagsFieldClass · 0.90
StrNullFieldClass · 0.90
_SMBStrNullFieldFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…